home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / hacking / phreak_utils_pc / litefix.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-04-01  |  841 b   |  45 lines

  1. uses dos;
  2. const fixstr1 = #27+'[2JCopyright (C) ';
  3.       fixstr2 = ' by Onkel Dittmeyer'+#26;
  4.  
  5. var f :file;
  6.     s :string;
  7.  
  8. function Stg(w:word):String;
  9. var s:string;
  10. begin
  11.   str(w,s);
  12.   stg:=s;
  13. end;
  14.  
  15. function date:string;
  16. var y,m,d,dum:word;
  17.     dummy:string;
  18. begin
  19.   getdate(y,m,d,dum);
  20.   dummy:='';
  21.   if m<10 then dummy:='0';
  22.   dummy:=dummy+stg(m)+'-';
  23.   if d<10 then dummy:=dummy+'0';
  24.   dummy:=dummy+stg(d)+'-'+copy(stg(y),3,2);
  25.   date:=dummy;
  26. end;
  27.  
  28. begin
  29.   assign(f,paramstr(1));
  30.   reset(f,1);
  31.   seek(f,30);
  32.   s[0]:=#6;
  33.   blockread(f,s[1],6);
  34.   if s<>'PKLITE' then begin
  35.     close(f);
  36.     writeln('cant fix --> not lited');
  37.     halt($ff);
  38.   end;
  39.   s:=fixstr1+date+fixstr2;
  40.   writeln('fixing ',length(s),' byte lite(c)note...');
  41.   seek(f,30);
  42.   blockwrite(f,s[1],length(s));
  43.   close(f);
  44. end.
  45.