caion90 Posted June 16, 2012 Report Share Posted June 16, 2012 pessoal, beleza?estou tentando fazer uma função que gere uma chave de 16 bytes.estou emperrado nela, se alguém souber a resolvela, kkkkk nem eu to conseguindo!function serial(str:string):string;var val: array[0..15] of byte; i,j: integer; tmp: byte;begin val[0] := $37; val[1] := $72; val[2] := $96; val[3] := $93; val[4] := $10; val[5] := $25; val[6] := $45; val[7] := $61; val[8] := $81; val[9] := $97; val[10] := $6; val[11] := $22; val[12] := $42; val[13] := $77; val[14] := $82; val[15] := $64;for I := 0 to length(val)-1 do for j := 1 to length(str) do begin case (j mod 3) of 0: tmp := tmp + val; 1: tmp := tmp - val; 2: tmp := tmp * i; end; end; result := result + char(tmp); tmp := $0;end; Quote Link to comment Share on other sites More sharing options...
0 Jhonas Posted June 17, 2012 Report Share Posted June 17, 2012 exemplohttp://wzmsoftware.com.br/download/Serial.zipabraço Quote Link to comment Share on other sites More sharing options...
Question
caion90
pessoal, beleza?
estou tentando fazer uma função que gere uma chave de 16 bytes.
estou emperrado nela, se alguém souber a resolvela, kkkkk nem eu to conseguindo!
function serial(str:string):string;
var val: array[0..15] of byte;
i,j: integer;
tmp: byte;
begin
val[0] := $37;
val[1] := $72;
val[2] := $96;
val[3] := $93;
val[4] := $10;
val[5] := $25;
val[6] := $45;
val[7] := $61;
val[8] := $81;
val[9] := $97;
val[10] := $6;
val[11] := $22;
val[12] := $42;
val[13] := $77;
val[14] := $82;
val[15] := $64;
for I := 0 to length(val)-1 do
for j := 1 to length(str) do begin
case (j mod 3) of
0: tmp := tmp + val;
1: tmp := tmp - val;
2: tmp := tmp * i;
end;
end;
result := result + char(tmp);
tmp := $0;
end;
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.