飘云阁

 找回密码
 加入我们

QQ登录

只需一步,快速开始

查看: 6026|回复: 8

Windows优化大师x.xx注册机源码

[复制链接]
  • TA的每日心情
    开心
    2019-9-19 16:05
  • 签到天数: 4 天

    [LV.2]偶尔看看I

    发表于 2007-2-12 10:27:53 | 显示全部楼层 |阅读模式
    unit Unit1;

    interface

    uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, Registry, StdCtrls, Buttons;

    type
    TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Label3: TLabel;
    Edit3: TEdit;
    GetKeySpeedButton: TSpeedButton;
    CheckBox1: TCheckBox;
    Label4: TLabel;
    procedure GetKeySpeedButtonClick(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }
    end;

    var
    Form1: TForm1;
    Family, Model, Stepping: Byte;

    implementation

    {$R *.dfm}

    //获得CPU信息的过程,用汇编代码写的
    procedure GetCpuID;
    asm
    PUSH EAX
    MOV EAX, 1
    DW $A20F //汇编指令CPUID的机器代码
    MOV Stepping, AL
    AND Stepping, 0FH //取得CPU STEPPING数送入到变量Stepping中
    AND AL, 0F0H
    SHR AL, 4
    MOV Model, AL //取得CPU MODEL数送入到变量Model中
    SHR AX, 8
    AND AL, 0FH
    MOV Family, AL //取得CPU FAMILYG数送入到变量Family中
    POP EAX
    end;

    //RSA的加密和解密函数,等价于(m^e) mod n(即m的e次幂对n求余)
    function Encrypt_Decrypt(m: Int64; e: Int64=$2C86F9; n: Int64=$69AAA0E3): Int64;
    var
    a, b, c: Int64;
    begin
    a:=m;
    b:=e;
    c:=1;
    while b<>0 do
    if (b mod 2)=0
    then begin
    b:=b div 2;
    a:=(a * a) mod n;
    end
    else begin
    b:=b - 1;
    c:=(a * c) mod n;
    end;
    Result:=c;
    end;

    procedure TForm1.GetKeySpeedButtonClick(Sender: TObject);
    var
    ID, UserName, CpuVer: String;
    s: Array [1..4] of Cardinal;
    temp, Num1, Num2: Cardinal;
    Code1, Code2: Int64;
    i, ascii: Byte;
    Reg: TRegistry;
    begin
    if (Edit1.Text='') and (CheckBox1.Checked=False)
    then Application.MessageBox('请输入注册申请码!', '警告', MB_OK);
    if (Edit1.Text='') and (CheckBox1.Checked=True)
    then Application.MessageBox('请输入注册者姓名!', '警告', MB_OK);
    if (CheckBox1.Checked=true) and (Edit1.Text<>'')
    then begin
    UserName:=Edit1.Text; //从Edit1.Text中取得用户名
    GetCpuID; //调用过程GetCpuID
    CpuVer:='Level '+IntToStr(Family)+' Rev. '+IntToStr(Model)+'.'+IntToStr(Stepping);
    temp:=1;
    i:=1;
    while UserName<>#0 do begin
    ascii:=ord(UserName); //函数ord()的作用为取得字符的ASCII码
    temp:=(temp*ascii+$D0878) mod $F4240;
    inc(i);
    end;
    i:=1;
    while CpuVer<>#0 do begin
    ascii:=ord(CpuVer);
    temp:=(temp*ascii+$2597D) mod $F4240;
    inc(i);
    end;
    ID:=IntToStr(temp);
    end;
    if (CheckBox1.Checked=false) and (Edit1.Text<>'')
    then ID:=Edit1.Text;
    ID:=ID+'1234567';
    SetLength(ID, 8); //把字符串ID长度变为8个,并把后面的字符截掉

    //下面四行语句是把字符串'You are big pig.'的内存数据送到变量s中
    s[1]:=$20756f59;
    s[2]:=$20657261;
    s[3]:=$20676962;
    s[4]:=$2e676970;
    Num1:=0;
    for i:=4 downto 2 do
    Num1:=(Num1+ord(ID)) shl 8;
    Num1:=Num1+ord(ID[1]);
    Num2:=0;
    for i:=8 downto 6 do
    Num2:=(Num2+ord(ID)) shl 8;
    Num2:=Num2+ord(ID[5]);
    temp:=0;
    for i:=1 to 32 do begin
    temp:=temp+$9E3779B9;
    Num1:=Num1+(Num2 shl 4)+(s[1] xor Num2)+((Num2 shr 5) xor temp)+s[2];
    Num2:=Num2+(Num1 shl 4)+(s[3] xor Num1)+((Num1 shr 5) xor temp)+s[4];
    end;

    Code1:=(Num1 mod $40000000) + 2;
    Code2:=($93E0014 shl 2)+ Num1 div $40000000 + 2;
    Code1:=Encrypt_Decrypt(Code1);
    code2:=Encrypt_Decrypt(Code2);
    if (CheckBox1.Checked=False) and (Edit1.Text<>'')
    then begin
    Edit2.Text:=IntToHex(Code1, 8);
    Edit3.Text:=IntToHex(Code2, 8);
    end;
    if (CheckBox1.Checked=True) and (Edit1.Text<>'')
    then begin
    Reg:=TRegistry.Create;
    Reg.RootKey:=HKEY_LOCAL_MACHINE;
    if Reg.OpenKey('Software\Wom', True)
    then begin
    Reg.DeleteValue('Masters');
    Reg.WriteString('Register', UserName);
    Reg.WriteString('Register_1', IntToHex(Code1, 8));
    Reg.WriteString('Register_2', IntToHex(Code2, 8));
    end;
    Reg.Free;
    Application.MessageBox('自动注册完成!', '信息', MB_OK);
    end;
    end;

    procedure TForm1.CheckBox1Click(Sender: TObject);
    begin
    if CheckBox1.Checked=true
    then begin
    GetKeySpeedButton.Caption:='自动注册';
    Label1.Caption:='注册者姓名';
    Edit1.MaxLength:=0;
    Label2.Visible:=false;
    Label3.Visible:=false;
    Edit2.Visible:=false;
    Edit3.Visible:=false;
    end
    else begin
    GetKeySpeedButton.Caption:='取得注册码';
    Label1.Caption:='注册申请码';
    Edit1.MaxLength:=8;
    Label2.Visible:=true;
    Label3.Visible:=true;
    Edit2.Visible:=true;
    Edit3.Visible:=true;
    end;
    end;

    end.
    PYG19周年生日快乐!

    该用户从未签到

    发表于 2007-3-17 17:51:32 | 显示全部楼层
    学习学习啊/:01
    PYG19周年生日快乐!
  • TA的每日心情
    无聊
    2017-8-31 14:43
  • 签到天数: 7 天

    [LV.3]偶尔看看II

    发表于 2007-3-18 11:42:56 | 显示全部楼层
    强,,这个很强。。。
    PYG19周年生日快乐!

    该用户从未签到

    发表于 2007-3-27 07:44:31 | 显示全部楼层
    看懂的
    分享下原理撒
    别老是灌无意义的水啊
    PYG19周年生日快乐!

    该用户从未签到

    发表于 2007-4-7 11:59:55 | 显示全部楼层
    /:02 /:02 晕。。看不懂
    PYG19周年生日快乐!
  • TA的每日心情
    慵懒
    4 天前
  • 签到天数: 431 天

    [LV.9]以坛为家II

    发表于 2007-4-8 10:42:30 | 显示全部楼层
    原帖由 夜晚的路灯 于 2007-4-7 11:59 发表
    /:02 /:02 晕。。看不懂

    我也没看明白是那个Windows优化大师的注册机。
    PYG19周年生日快乐!

    该用户从未签到

    发表于 2007-4-22 11:20:27 | 显示全部楼层
    弄过优化大师的算法啊???
    怎么看怎么不象啊~~
    PYG19周年生日快乐!
  • TA的每日心情

    2024-2-10 22:48
  • 签到天数: 1 天

    [LV.1]初来乍到

    发表于 2008-2-8 14:37:17 | 显示全部楼层
    好象只是个演示...
    PYG19周年生日快乐!

    该用户从未签到

    发表于 2008-2-10 09:42:42 | 显示全部楼层
    不错啊/:good
    PYG19周年生日快乐!
    您需要登录后才可以回帖 登录 | 加入我们

    本版积分规则

    快速回复 返回顶部 返回列表