home *** CD-ROM | disk | FTP | other *** search
/ CD-X 1 / cdx_01.iso / demodisc / tyrant / vk / vk.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1995-03-17  |  3.3 KB  |  143 lines

  1. {Ez egy LEGO nevû vírus-t keres meg, úgyhogy ezt a progit a kényszer szülte!}
  2.  
  3. Uses Crt,Dos,Kurzor;
  4.  
  5. const   Vazon : Array[1..6] Of Byte = ($BA,$00,$50,$81,$C2,$45);
  6.  
  7. Type Ftype = record
  8. Nev       : String[12];
  9. Meret     : Longint;
  10. Tipus     : Byte;
  11. Hely      : String;
  12. End;
  13.  
  14. Var
  15.   X,I,X2        :       longint;
  16.   Rec           : Word;
  17.   c             : longint;
  18.   Fdb           : Longint;
  19.   Fok           : Array[1..200] Of Ftype absolute $9000:$0000;
  20.   vq,dq         : Integer;
  21.  
  22.   CONT          : Integer;
  23.   wl            : Byte;
  24.   F2            : File of Byte;
  25.   F3            : Text;
  26.  
  27. Procedure Pure(Nev:String);
  28. Var
  29.           S      : Byte;
  30. Begin
  31. Assign(F2,Nev);
  32. {$I-}
  33. Reset(F2);
  34. {$I+}
  35. If IoResult=0 Then
  36. Begin
  37. If Filesize(F2)>1000 Then Begin Seek(F2,FileSize(F2)-1000); End;
  38. wl:=0;
  39. cont:=0;
  40. Repeat
  41. Inc(cont);
  42. Read(F2,S);
  43. If Vazon[wl+1]=S Then Wl:=Wl+1
  44.                  Else Wl:=0;
  45. If Wl=6 Then Begin
  46.              GotoXY(68,12);
  47.              Writeln('VIRUS!!!');
  48.              Writeln(F3,'VIRUS: ',Nev);
  49.              GotoXY(48,11);
  50.              Writeln('                  ');
  51.              inc(vq);
  52.              End;
  53. Until (Eof(F2)) or (cont>20);
  54. Close(F2); End Else Begin
  55.                     GotoXY(68,11);
  56.                     Writeln('DOSERROR');
  57.                     Writeln(F3,'DOSERROR: ',Nev);
  58.                     inc(dq);
  59.                     End;
  60. End;
  61.  
  62. Procedure Read_Items(Path:String);
  63. Var
  64.   Kit           : String;
  65.   D             : SearchRec;
  66. Begin
  67.         inc(rec);
  68.     FindFirst(Path+'*.*',AnyFile,D);
  69.     While DosError=0 Do
  70.     Begin
  71.         inc(x);
  72.  
  73.         GotoXY(20,12);
  74.         Writeln('Workdir:  ',path,'                                     ');
  75.         GotoXY(20,13);
  76.         Writeln('Files   : ',x);
  77.         GotoXY(20,14);
  78.         Writeln('Virus   : ',vq);
  79.         GotoXY(20,15);
  80.         Writeln('Doserror: ',dq);
  81.         inc(c);
  82.         inc(c);
  83.         GotoXY(38,11);
  84.  
  85.         I:=2;
  86.         Repeat
  87.         Inc(I);
  88.         Until D.Name[I]='.';
  89.         Kit:=Copy(D.Name,I+1,3);
  90.         If D.Name<>'VK.EXE' Then
  91.         If (Kit='EXE') or (Kit='COM') Then Begin
  92.                                            Write(D.Name,'                               ');
  93.                                            Pure(Path+D.Name);
  94.                                            inc(X2);
  95.                                            End;
  96.         If D.Name[1]<>'.' Then
  97.         If D.Name[1]<>'..' Then
  98. Begin
  99.         If Fdb<=200 Then Begin
  100.                          Fok[Fdb].Nev:=D.name;
  101.                          Fok[Fdb].Meret:=D.size;
  102.                          Fok[Fdb].Tipus:=D.attr;
  103.                          End;
  104.         If FDb>=200 Then Begin
  105.                          Fdb:=0;
  106.                          End;
  107.         inc(fdb);
  108. End;
  109.         If (D.Attr And Directory = Directory) AND (D.Name[1]<>'.') Then Read_Items(Path+D.Name+'\');
  110.         FindNext(D);
  111.     End;
  112.         dec(rec);
  113. End;
  114.  
  115.  
  116. Begin
  117. Kurki;
  118. Assign(F3,'Virusos.txt');
  119. Rewrite(F3);
  120. vq:=0;
  121. dq:=0;
  122. Fdb:=1;
  123. x:=0;
  124. x2:=0;
  125. ClrScr;
  126. GotoXY(55,25);
  127. Writeln('By TyRaNT of MurmidoneS');
  128. GotoXY(20,11);
  129. Writeln('Files on Drive C: ');
  130. Read_Items('\');
  131. close(f3);
  132. GotoXY(38,5);
  133. writeln('-=-=-');
  134. GotoXY(38,6);
  135. writeln('»OK!«');
  136. GotoXY(38,7);
  137. writeln('-=-=-');
  138. GotoXY(28,8);
  139. Writeln('VIRUSOS.TXT was create...');
  140. readkey;
  141. Kurbe;
  142. End.
  143.