AccesS密码的打击[1]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 programlover 的 blog

 

type
  tform1 = class(tform)
    button1: tbutton;
    chk2000: tcheckbox;
    edit1: tedit;
    button2: tbutton;
    edit2: tedit;
    opendialog1: topendialog;
    button3: tbutton;
    label1: tlabel;
    procedure button1click(sender: tobject);
    procedure button2click(sender: tobject);
    procedure button3click(sender: tobject);
    procedure edit2keypress(sender: tobject; var key: char);
  private
  procedure wmdropfiles(var msssage: tmessage); message wm_dropfiles ;
    { private declarations }
  public
    { public declarations }
  end;

var
  form1: tform1;

implementation

{$r *.dfm}

const
  xorstring:array[0..12]of byte=
    ( $86, $fb, $ec, $37,
      $5d, $44, $9c, $fa,
      $c6, $5e, $28, $e6,$13 );
  xorstring2:array[0..20]of byte=
    ( $d3, $ec, $08, $9c,
      $93, $28, $46, $8a,
      $01, $7b, $a0, $df,
      $22, $13, $9a, $b1,
      $61, $79, $c7, $7c,$5b);

procedure tform1.wmdropfiles(var msssage: tmessage);
begin
  showmessage('hello boy');
end;
procedure tform1.button1click(sender: tobject);


var
passbuff: array[0..14]of byte;
pass: array[0..14]of char;
passbuff2: array[0..40]of byte;
pass2: array[0..20]of char;
b: byte;
f:tfilestream;
i,j:integer;

begin
  file://showmessage(char($86)+ char($f8)+char($ec))
  if not fileexists(edit1.text) then
   begin
     messagebox(handle,'你是mm呀','我好种意你呀',mb_ok + mb_iconinformation);
     exit;
   end;
  f :=  tfilestream.create(edit1.text,fmopenread);
  if not chk2000.checked then
  begin
    try
      f.seek($42,sofrombeginning);
      f.read(passbuff,14);
      for i := 0 to 13 do
      begin
        b := passbuff[i] xor xorstring[i];
        pass[i] := char(b);
      end;
      pass[sizeof(pass)-1] := #0;
      edit2.text := strpas(pass);
      finally
    f.free;
    end;
  end
  else
  begin
     try
     f.seek($42,sofrombeginning);
     f.read(passbuff2,40);
     i:=0;j:=0;
     while i<40 do
     begin
        b := passbuff2[i] xor xorstring2[j];
        pass2[j]:=char(b);
        inc(i,2);inc(j);
     end;
    pass2[sizeof(pass2) - 1] := #0;
    edit2.text:=strpas(pass2);
   finally
    f.free;
   end;
  end;
end;

procedure tform1.button2click(sender: tobject);
begin
  if opendialog1.execute then
    edit1.text := opendialog1.filename;
end;

 


procedure tform1.button3click(sender: tobject);
var
passbuff: array[0..14]of byte;
pass: array[0..14]of char;
passbuff2: array[0..40]of byte;
pass2: array[0..20]of char;
b: byte;
f:tfilestream;
i,j:integer;
s: string;
begin
  file://showmessage(char($86)+ char($f8)+char($ec))
  if not fileexists(edit1.text) then
   begin
     messagebox(handle,'你是mm呀','我好种意你呀',mb_ok + mb_iconinformation);
     exit;
   end;
  f :=  tfilestream.create(edit1.text,fmopenwrite);
  if not chk2000.checked then
  begin
    try
      fillchar(pass,14,#0);
      s := edit2.text;
      strcopy(@pass,pchar(trim(s)));
      for i := 0 to 13 do
      begin
        b := byte(pass[i]);

本文关键:AccesS密码的打击
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top