home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / hackers / tools / crack-ut.arj / SHOWREAD.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1994-02-15  |  2.5 KB  |  105 lines

  1. {$I-}
  2. uses
  3.    DOS, CRT, Hex;
  4.  
  5. type
  6.    TResult =
  7.    Array [1..1024] of
  8.    record
  9.       Num          :Word;
  10.  
  11.       Drive, Head  :Byte;
  12.       Sector, Track:Byte;
  13.       Count        :Byte;
  14.  
  15.       Size         :Word;
  16.       Buffer       :Pointer;
  17.  
  18.       DPT          :Array [0..10] of Byte;
  19.    end;
  20.  
  21.    TCommon =
  22.    record
  23.       Id           :String[8];
  24.       RMax,
  25.       RNum, RPos   :Word;
  26.       Result       :TResult;
  27.    end;
  28.  
  29. var
  30.    C               :^TCommon;
  31.    i, iDPT         :Integer;
  32.    CurDPT          :Array [0..10] of Byte;
  33.    DPTAddr         :Pointer;
  34.  
  35.    FileName        :String[12];
  36.    f               :File;
  37.  
  38. function  NormalDPT(var DPT            :Array of Byte)     :Boolean;
  39. begin
  40.    NormalDPT:=True;
  41.    for iDPT:=0 to 10 do
  42.    if DPT[iDPT]<>CurDPT[iDPT] then NormalDPT:=False;
  43. end;
  44.  
  45. procedure ShowRead;
  46. begin
  47.    with C^.Result[i] do
  48.    begin
  49.       Write(i:3, '   ', Char(Drive+Ord('A')), ':   ',
  50.          'Head ', Head:1, '   Track ', Track:2, '   Sector ', Sector:2,
  51.          '   Count ', Count:1, '   Size ', Size:5);
  52.       if Not NormalDPT(DPT) then
  53.       begin
  54.          WriteLn;
  55.          Write(' Used DPT    :');
  56.          for iDPT:=0 to 10 do
  57.          begin
  58.             if DPT[iDPT]<>CurDPT[iDPT] then HighVideo else LowVideo;
  59.             Write(HexByte(DPT[iDPT]):3);
  60.          end;
  61.          WriteLn;
  62.          Write(' Current DPT :');
  63.          for iDPT:=0 to 10 do
  64.          begin
  65.             if DPT[iDPT]<>CurDPT[iDPT] then HighVideo else LowVideo;
  66.             Write(HexByte(CurDPT[iDPT]):3);
  67.          end;
  68.          LowVideo; WriteLn;
  69.       end
  70.       else WriteLn(' ; DPT is normal');
  71.  
  72.       if (Buffer<>nil) and (Size<>0) then
  73.       begin
  74.          Str(i:3, FileName);
  75.          if FileName[1]=' ' then FileName[1]:='0';
  76.          if FileName[2]=' ' then FileName[2]:='0';
  77.          FileName:='SAVEREAD.'+FileName;
  78.          Assign(f, FileName);
  79.          Rewrite(f, 1);
  80.          BlockWrite(f, Buffer^, Size);
  81.          Close(f);
  82.       end;
  83.    end;
  84. end;
  85.  
  86. begin
  87.    WriteLn('Floppy Drive Reads Viewer  Copyright (c) 1994 by Sasha Peslyak');
  88.  
  89.    GetIntVec($64, Pointer(C));
  90.    with C^ do
  91.    begin
  92.       if Id<>'SAVEREAD' then
  93.       begin
  94.          WriteLn('SAVEREAD.EXE not loaded.'); Halt;
  95.       end;
  96.  
  97.       GetIntVec($1E, DPTAddr);
  98.       Move(DPTAddr^, CurDPT, 11);
  99.  
  100.       WriteLn(#13#10'Total reads : ', RNum, #13#10);
  101.       if RPos<RNum then for i:=RPos+1 to RMax do ShowRead;
  102.       for i:=1 to RPos do ShowRead;
  103.    end;
  104. end.
  105.