rendered paste bodyunit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var USERNAME:String;
LEN,SERIAL:Integer;
begin
USERNAME:=Edit1.Text;
LEN:=length(USERNAME);
ASM
MOV ECX,EAX
XOR EAX,EAX //Put TMP to 0
XOR EBX,EBX //GET EBX to 00000000
MOV ESI,USERNAME //Load nick in string
MOV ECX,LEN
@keygen:
MOVZX EAX,BYTE PTR DS:[ESI] //Get char
ADD EBX,EAX //Current tmp number to sum
INC ESI //remove 1st letter from left of string
LOOP @keygen //Loop it
MOV SERIAL,EBX //ebx=code
end;
//showmessage(format('%0.1X',[SERIAL]));
Edit.Text:='Serial '+ inttostr(SERIAL);
end;
end.