Hi my friends
Today show how to use array to store values
Target: Ace Buddy
Original code:
@ab_004A6770:
MOV ECX,DWORD PTR SS:[EBP-4] // move name to ecx
MOVZX ECX,BYTE PTR DS:[ECX+EDX-1]// mov char name one by one to ecx
ADD EBX,ECX // sum char name value in ebx
INC EDX
DEC EAX
JNZ @ab_004A6770
MOV EAX,EBX // move totat name to eax
SHL EAX,3
SUB EAX,EBX // part1=eax after shl - ebx [total name]
ADD EBX,043h // totat name + $43
LEA EAX,DWORD PTR DS:[EBX+EBX*2]// part2 = (ebx*2)+ebx
Key gen code:
At first we need to make function to calculate our names
function TotalName(n : string):DWORD;
var
i : Integer;
begin
Result := 0 ; i := 1;
while i <= Length (n)do
begin
inc (Result , ord(n[i]));
inc (i);
end;
end;
then btn press event
procedure TForm1.btn1Click(Sender: TObject);
var
s : array [1..3] of Integer;
begin
if Edit1.Text <> '' then
begin
FillChar(s,SizeOf(s),0);
s[1] := TotalName(edit1.Text);// call fun then Store sum name in array s p1 .
s[2] := (s[1]shl 3)- s[1];// Store Part1 in array s p2 .
s[3] := ( (s[1] + $43)* 2 ) + s[1]+ $43;// Store Part2 in array s p3 .
Edit2.Text := format('%.u-%.u',[s[2],s[3]]);// Display serial at textBox
end else
Edit2.Text :='Pls.enter ur name';
end;
at last if any feedback I will be thanks
BR
Esso_x
implicit conversion (think forward)