mindoverflow
08-29-2009, 11:13 AM
Hello,
Could someone help me reverse this code(keygen) please, i can nomore think about it, it's not working with me.
var
a,b,c: integer;
d,x,y: word;
e:byte;
key, ref: string;
k: array[1..36] of byte;
begin
ref:='ABCDEFGHIJKLMNOPQRSTUVW123456789';
key:='BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBB'; // 56
for x:=1 to 36 do k[x]:=0; // zero the result
for x:=1 to 56 do
begin
a:=(x-1)*5;
if a>=0 then b:=0 else b:=-1; // cdq, if i'm not wrong about it
b:=b and 7;
a:=a+b;
asm sar a, 3 end;
e:=a;
asm shl a, 3 end;
c:=((x-1)*5)-a;
for y:=1 to 32 do
begin
if key[x]:=ref[y] then
begin
d:=(y-1) shl (c and $ff);
k[e+1]:=k[e+1] or (d and $ff);
k[e+2]:=k[e+2] or ((d shr 8) and $ff);
break;
end;
end;
end;
end;
Thanks
Could someone help me reverse this code(keygen) please, i can nomore think about it, it's not working with me.
var
a,b,c: integer;
d,x,y: word;
e:byte;
key, ref: string;
k: array[1..36] of byte;
begin
ref:='ABCDEFGHIJKLMNOPQRSTUVW123456789';
key:='BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBB'; // 56
for x:=1 to 36 do k[x]:=0; // zero the result
for x:=1 to 56 do
begin
a:=(x-1)*5;
if a>=0 then b:=0 else b:=-1; // cdq, if i'm not wrong about it
b:=b and 7;
a:=a+b;
asm sar a, 3 end;
e:=a;
asm shl a, 3 end;
c:=((x-1)*5)-a;
for y:=1 to 32 do
begin
if key[x]:=ref[y] then
begin
d:=(y-1) shl (c and $ff);
k[e+1]:=k[e+1] or (d and $ff);
k[e+2]:=k[e+2] or ((d shr 8) and $ff);
break;
end;
end;
end;
end;
Thanks