浏览器大全:是一个提供流行浏览器教程、在线学习分享的学习平台!

容易的文件解码单元

uses
   crt,
   dos;

var
  key:string[8];

{ decode file ---------------------------------------------------------------}
{your code here}
procedure decode(infname:pathstr);
var
  infile,outfile:file;
  fdir:dirstr; fname:namestr; fext:extstr;
  dbuf,sbuf:pointer;
  idx,i,j,srcseg,srcofs,dstseg,dstofs,start,csize:word;
  src,rep:byte;
begin
  if maxavail<2*65500 then Begin
Writeln(#13#10,'No Memory');
halt;
End;
getmem(dbuf,65500);
getmem(sbuf,65500);
srcseg:=seg(sbuf^); srcofs:=ofs(sbuf^);
dstseg:=seg(dbuf^); dstofs:=ofs(dbuf^); start:=dstofs;
assign(infile,infname);
{$i-} reset(infile,1); {$i+}
if ioresult<>0 then Begin
     Writeln(#13#10'File I/O!');
     halt;
  End;
  if filesize(infile)>65500 then halt;
  blockread(infile,sbuf^,filesize(infile));
  csize:=filesize(infile);
  close(infile);
  randseed:=ord(key[length(key)]); j:=0;
  for i:=0 to csize do begin
    mem[srcseg:srcofs+i]:=mem[srcseg:srcofs+i] xor
(ord(key[j])+random(ord(key[j])));
    j:=1+j mod 8;
  end;
  idx:=0;
  while idx
0 then Begin
     Writeln(#13#10'Output Error!');
     halt(4);
  End;
  blockwrite(outfile,key[1],length(key)); {so I know which key did it!}
  blockwrite(outfile,dbuf^,csize);        {un encoded}
  close(outfile);
  freemem(sbuf,65500);
  freemem(dbuf,65500);
end;

{ main ----------------------------------------------------------------------}

Procedure ShowFile(FName:String); {just a test ... not used in live version!}
Var
   T:Text;
   S:String;

Begin
   Assign(T,FName);
   ReSet(T);
   While not eof(t) do begin
{$I-}      Readln(t,s); {$I+}
      Writeln(s);
   End;
   Close(T);
End;

Var
   Cnt1:Integer;        {character 1}
   Cnt2:Integer;        {2}
   Cnt3:Integer;        {3}
   Cnt4:Integer;        {4}
   Cnt5:Integer;        {5}
   Cnt6:Integer;        {6}
   Cnt7:Integer;        {7}
   Cnt8:Integer;        {8}
   Ch:Char;             {did I press a local key?}
   outfile:file;        {just for making an empty file to append to}
   Dumb:Byte;           {dumb!}
   done:boolean;        {tried from '' to #255#255#255#255#255#255#255#255}

begin
   assign(outfile,'hack.org');
   {$i-} rewrite(outfile,1); {$i+}
   Close(outfile); {made a 0 byte file to append to}
{init}
   Cnt1:=0;
   Cnt2:=0;
   Cnt3:=0;
   Cnt4:=0;
   Cnt5:=0;
   Cnt6:=0;
   Cnt7:=0;
   Cnt8:=0;
   done:=false;
   While not done do begin
{not I inc 1 char at a time}
      Inc(Cnt1);
      If Cnt1>255 then Begin
  Cnt1:=0;
  Inc(Cnt2);
      End;
      If Cnt2>255 then Begin
  Cnt2:=0;
  Inc(Cnt3);
      End;
      If Cnt3>255 then Begin
  Cnt3:=0;
  Inc(Cnt4);
      End;
      If Cnt4>255 then Begin
  Cnt4:=0;
  Inc(Cnt5);
      End;
      If Cnt5>255 then Begin
  Cnt5:=0;
  Inc(Cnt6);
      End;
      If Cnt6>255 then Begin
  Cnt6:=0;
  Inc(Cnt7);
      End;
      If Cnt7>255 then Begin
  Cnt7:=0;
  Inc(Cnt8);
      End;
      If Cnt8>255 then Halt;
      Key:='';
      If Cnt1<>0 then key:=key+chr(cnt1);
      If Cnt2<>0 then key:=key+chr(cnt2);
      If Cnt3<>0 then key:=key+chr(cnt3);
      If Cnt4<>0 then key:=key+chr(cnt4);
      If Cnt5<>0 then key:=key+chr(cnt5);
      If Cnt6<>0 then key:=key+chr(cnt6);
      If Cnt7<>0 then key:=key+chr(cnt7);
      If Cnt8<>0 then key:=key+chr(cnt8);
{call your decode method}
      Decode('HACK.DAT');
      {ShowFile('HACK.ORG');}
{so I can see its running:}
      Writeln('KEY: ',Key);
      If Keypressed then Begin
  Ch:=Readkey;
  if ch=#27 then halt;
      End;
   End;
(*  if (paramcount<>2) or (pos('?',paramstr(1))>0) then begin
    writeln('Syntax: DECODE  
  
');
    writeln('Both parameters are required!');
    halt;
  end;
  key:=paramstr(2);
  decode(paramstr(1));
  writeln('File successfully decoded!'); *)
end.

相关软件

2345加速浏览器官方版

2345加速浏览器官方版 | 56.2MB

2345加速浏览器官方版

新一代2345加速浏览器采用Chromium和IE双内核,主打极速与安全特性。基于Chromium深度定制,引入网页智能预加载技术,访问网页更快速..

QQ浏览器官方正式版

QQ浏览器官方正式版 | 49.67MB

QQ浏览器官方正式版

QQ浏览器秉承TT浏览器1-4系列方便易用的特点,但技术架构不同,交互和视觉表现也重新设计,采用Chromium内核+IE双内核,让浏览快速稳定...

百度浏览器最新版下载

百度浏览器最新版下载 | 13.3MB

百度浏览器最新版下载

q百度浏览器,是一款简洁轻快、智能懂你的浏览器。依靠百度强大的搜索平台,在满足用户浏览网页的基础上,它整合百度体系业务优势,带给用户更方便的浏览方式功能...

UC浏览器官方正式版

UC浏览器官方正式版 | 44.2MB

UC浏览器官方正式版

UC浏览器(UC Browser)是UC Mobile Limited在2004年8月开发的一款软件,分uc手机浏览器和uc浏览器电脑版。UC浏览器是全球使用量最大的第三方手机浏览器...

猎豹浏览器2022最新版下载

猎豹浏览器2022下载 | 45MB

猎豹浏览器2022最新版下载

猎豹安全浏览器对Chrome的Webkit内核进行了超过100项的技术优化,访问网页速度更快。其具有首创的智能切换引擎,动态选择内核匹配不同网页...

360安全浏览器官方版下载

360安全浏览器下载 | 21.4MB

360安全浏览器官方版下载

360安全浏览器拥有全国最大的恶意网址库,采用恶意网址拦截技术,可自动拦截挂马、欺诈、网银仿冒等恶意网址。独创沙箱技术,在隔离模式即使访问****也不会感染...