0 --> 71
1 --> 70
2 --> 73
3 --> 72
4 --> 75
5 --> 74
6 --> 77
7 --> 76
8 --> 79
9 --> 78
A --> 00
B --> 03
C --> 02
D --> 05
E --> 04
F --> 07
G --> 06
H --> 09
I --> 08
J --> 0B
K --> 0A
L --> 0D
M --> 0C
N --> 0F
O --> 0E
P --> 11
Q --> 10
R --> 13
S --> 12
T --> 15
U --> 14
V --> 17
W --> 16
X --> 19
Y --> 18
Z --> 1B
Private Sub Text1_Change()
'Keygen by KuNgBiM
Dim MachineCode As String
Dim n, m, i As Byte
Dim Sn, tmp As String
Dim Char As String
Dim Table As String
'字符串
Char = "0123456789" & "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
'字符串对应密码表
Table = "717073727574777679780003020504070609080B0A0D0C0F0E111013121514171619181B"
'输入机器码
MachineCode = Text1.Text
'计算注册码
If Len(MachineCode) > 20 Then MachineCode = Mid(MachineCode, 1, 20)
n = Len(MachineCode)
For i = 1 To n
tmp = Mid(MachineCode, i, 1)
m = InStr(1, Char, tmp)
Sn = Sn & Mid(Table, 2 * m - 1, 2)
Next
'输出注册码
Text2.Text = Sn
End Sub
procedure Tkeygen.Text1Change(Sender: TObject);
var
MachineCode, tmp, Char, Table : AnsiString;
n, m, Sn : Variant;
i : Char;
begin
// Keygen by KuNgBiM
// 字符串
Char := '0123456789'+'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
// 字符串对应密码表
Table := '717073727574777679780003020504070609080B0A0D0C0F0E111013121514171619181B';
// 输入机器码
MachineCode := Text1.Text;
// 计算注册码
if Length(MachineCode)>20 then begin MachineCode := Copy(MachineCode, 1, 20); end;
n := Length(MachineCode);
for i:=1 to n do begin
tmp := Copy(MachineCode, i, 1);
m := (1+Pos(tmp, PChar(Char)+1));
Sn := Sn+ Copy(Table, 2*m-1, 2);
end;
// 输出注册码
Text2.Text := Sn;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
MachineCode, tmp, Char, Table : AnsiString;
Sn : string;
i ,m,n: integer;
begin
// Keygen by KuNgBiM
// 字符串
Char := '0123456789'+'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
// 字符串对应密码表
Table := '717073727574777679780003020504070609080B0A0D0C0F0E111013121514171619181B';
// 输入机器码
MachineCode := Edit1.Text;
// 计算注册码
if Length(MachineCode)>20 then begin MachineCode := Copy(MachineCode, 1, 20); end;
n := Length(MachineCode);
for i:=1 to n do begin
tmp := Copy(MachineCode, i, 1);
m := (1+Pos(tmp, PChar(Char)+1));
Sn := Sn+ Copy(Table, 2*m-1, 2);
end;
// 输出注册码
edit2.Text := Sn;