Universe 1.63注册码生成分析及注册机原码(下) (3千字)
Universe 1.63注册码生成分析及注册机原码(下)下面是我用C++Builder5制作的源程序代码:
#include <vcl.h>
#pragma hdrstop
#include <math.h>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
unsigned __int64 Total=0;
Edit2->Text="";
if(Edit1->Text.IsEmpty())
{
ShowMessage("请输入姓名!");
Edit1->SetFocus();
}
else
{
char* cp = new char[Edit1->Text.Length() + 1];
strcpy( cp, Edit1->Text.c_str());
for(int i=0;i<Edit1->Text.Length();i+=2) //取奇字符求和
Total+=cp[i];
Total*=2; //乘以2
Total=Total*Total+Total; //求(x*x)+x
for(int i=0;i<4;i++) //循环四次
{
Total=Total*0X25A2A40D+1; //[(X*0x25A2A40D)+1] mod 0x78B30C40
Total=Total%0X78B30C40;
}
Edit2->Text=AnsiString(Total);
}
}
下面是窗体代码,可以不看:)
object Form1: TForm1
Left = 218
Top = 146
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'Universe1.63 KeyGen By Maomao[CCG]'
ClientHeight = 256
ClientWidth = 348
Color = clBtnFace
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = '宋体'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Image1: TImage
Left = 0
Top = 0
Width = 348
Height = 130
Align = alTop
AutoSize = True
Center = True
object Panel1: TPanel
Left = 0
Top = 130
Width = 348
Height = 63
Align = alTop
BevelInner = bvLowered
BevelOuter = bvSpace
Color = clScrollBar
TabOrder = 0
object Label1: TLabel
Left = 3
Top = 11
Width = 59
Height = 13
Caption = '输入姓名:'
end
object Label2: TLabel
Left = 16
Top = 40
Width = 46
Height = 13
Caption = '注册码:'
end
object Edit1: TEdit
Left = 72
Top = 5
Width = 265
Height = 21
TabOrder = 0
end
object Edit2: TEdit
Left = 72
Top = 36
Width = 265
Height = 21
ReadOnly = True
TabOrder = 1
end
end
object Button1: TButton
Left = 59
Top = 204
Width = 75
Height = 25
Caption = '生成注册码'
Default = True
TabOrder = 1
OnClick = Button1Click
end
object Button2: TButton
Left = 203
Top = 204
Width = 75
Height = 25
Caption = '退出'
TabOrder = 2
OnClick = Button2Click
end
object StatusBar1: TStatusBar
Left = 0
Top = 237
Width = 348
Height = 19
Panels = <
item
Text = 'KenGen By Maomao[CCG]'
Width = 200
end
item
Alignment = taRightJustify
Text = '2001.11.11'
Width = 50
end>
SimplePanel = False
end
end
(全文完)
怎么样,看累了吧,休息一会儿~~~~~~
