home *** CD-ROM | disk | FTP | other *** search
/ The Elite Hackers Toolkit / TheEliteHackersToolkitVolume1_1998.rar / HACKERS.BIN / appcraks / TRAPIMPR.ZIP / TRAPIMPR.PAS < prev   
Pascal/Delphi Source File  |  1998-02-10  |  2KB  |  81 lines

  1. Program TrapImprover;
  2. Uses Crt,Dos;
  3. Label Go;
  4. Type
  5.   Header = Record
  6.     ID,
  7.     BILPage, NPages,
  8.     Entrie, HeaderS,
  9.     MinMem, MaxMem,
  10.     SS, SP, NegChk,
  11.     IP, CS, Reloc,
  12.     Overlay      : Word;
  13.   End;
  14. Var
  15.   F              : File of Header;
  16.   F1             : File of Byte;
  17.   H              : Header;
  18.   S              : LongInt;
  19.   P, P2          : String;
  20.   B, I, Rnd      : Byte;
  21.   Line           : String;
  22.  
  23. Function Exist (FileName : String): Boolean;
  24. Var
  25.   F     : File of Byte;
  26. Begin
  27.   Assign (F, FileName);
  28.   Reset (F);
  29.   If IOResult = 0 Then
  30.   Begin
  31.     S := FileSize (F);
  32.     Exist := True
  33.   End
  34.   Else
  35.     Exist := False;
  36. End;
  37.  
  38. Begin
  39.   Randomize;
  40.   Rnd := Random (100); If Rnd < 10 Then Inc (Rnd, 10);
  41.   Line [0] := #80; FillChar (Line [1], 80, '─'); Write (Line);
  42.   Write ('TrapImprover V1.00                                                    9 Feb 1998');
  43.   Write ('Copyright (c) 1998 by Daniel Arndt                           All rights reserved');
  44.   WriteLn ('Copy registered to: pUBLIC!');
  45.   If ParamCount < 1 Then
  46.     WriteLn (#13, #10, 'Usage: TrapImpr FileNam.Ext');
  47.   Write (Line);
  48.   If ParamCount < 1 Then
  49.     Halt;
  50.   P := ParamStr (1);
  51.   If Not Exist (P) Then
  52.   Begin
  53.     Write (#13, #10, 'File not found');
  54.     Halt;
  55.   End;
  56.   Assign (F1, P); Reset (F1);
  57.   S := FileSize (F1); Close (F1);
  58.   Assign (F, P); Reset (F);
  59.   If FileSize (F) < 32 Then
  60.     Goto Go;
  61.   Read (F, H);
  62.   If (H.ID <> $4d5a) and (H.ID <> $5a4d) Then
  63.     Goto Go;
  64.   Seek (F, 0);
  65.   S := S + Rnd;
  66.   H.ID := $4d5a;
  67.   H.BilPage := S Mod 512;
  68.   If S Mod 512 = 0 Then H.NPages := S Div 512
  69.   Else H.NPages := (S Div 512) + 1;
  70.   Write (F, H);
  71. Go:
  72.   Close (F);
  73.   Assign (F1, P); Reset (F1);
  74.   Seek (F1, FileSize (F1));
  75.   For I := Rnd DownTo 1 Do
  76.   Begin
  77.     B := Random (255);
  78.     Write (F1, B);
  79.   End;
  80.   Close (F1);
  81. End.