大家都要源码,我把核心的代码发一下吧,其实我也是根据别人提供的代码修改的。
function Base64(Src: string): string;
const
DataSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var
i, ModLen: integer;
Current: string;
Buf: array[1..3] of Byte;
NewBuf: array[1..4] of Byte;
begin
result := '';
if Src = '' then
exit;
ModLen := Length(Src) mod 3;
while Length(Src) > 0 do
begin
FillChar(Buf, 3, #0);
Current := Copy(Src, 1, 3);
Src := Copy(Src, 4, Length(Src) - 3);
for i := 1 to 3 do
Buf := Ord(Current);
NewBuf[1] := Buf[1] shr 2;
NewBuf[2] := (Buf[1] shl 6 shr 2 or Buf[2] shr 4) and $3F;
NewBuf[3] := (Buf[2] shl 4 shr 2 or Buf[3] shr 6) and $3F;
NewBuf[4] := Buf[3] and $3F;
for i := 1 to 4 do
result := result + DataSet[NewBuf + 1];
end;
if ModLen >= 1 then
result[Length(result)] := '=';
if ModLen = 1 then
result[Length(result) - 1] := '=';
end;
function getmpass(qqpws:string):string ;
type
md5x = array[0..15] of char;
var
md5: TIdHashMessageDigest5;
begin
md5 := TIdHashMessageDigest5.Create;
result:=Base64(md5x(md5.HashValue(QQPws))) ;
md5.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
var qqdl,qqdl1:string;
begin
QQNum:=edit2.text;
QQPw:=getmpass(edit3.Text);
qqdl:= ' /START QQUIN:' + edit2.text + ' PWDHASH:' +QQPw + ' /STAT:41';
qqdl1:= ' /START QQUIN:' + edit2.text + ' PWDHASH:' +QQPw + ' /STAT:40';
if checkbox1.Checked then
Winexec(pchar(edit1.text+qqdl1),5) else
Winexec(pchar(edit1.text+qqdl),5)
//最关键的就是这里,因为QQ本身就可以在命令行执行登录的,加密可以换上自己的函数,不容易被别人破解,知道这一句原理就够了,随便用什么语言都可以写了,命令行的具体参数可以在生成的一键登录里查看
end;
[ 此帖被love飘逸在2008-11-26 09:09重新编辑 ]