欢迎来到 嗅灵易学

零基础也能上手的脚本技术课,一对一答疑带你入门

<span class="pediy"><span class="pediy">

<span class="pediy"><span class="pediy">

【总结】
这个软件还是耍了蛮多把戏的
注册算法
1. 注册用户名的长度在(3~25)间
2. 从注册用户名最末向前取,计算出一个中间值,然后把它转为元素是十进制值的整数数组;有两个值要注意:0xC7BC0D36、0x0000025C
3. 利用第2步中的结果计算真正的注册码,这个码长须为12位,计算结果若小了就在前面补0,若超过了12位,取前面12个字符
【注册机】
;  从反汇编中拷过来的,懒得(用高级语言伪指令)整理了;凑合着看吧
; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
; keygen.asm
            .386
            .model flat, stdcall
            option casemap : none
include     windows.inc
include     user32.inc
includelib  user32.lib
include     kernel32.inc
includelib  kernel32.lib
include     masm32.inc
includelib  masm32.lib
DLG_MAIN    equ     101
ICO_MAIN    equ     102
IDC_NAME    equ     1000
IDC_CODE    equ     1001
          .data?
hInstance   dd  ?
          .data
szErrTitle  db  "ErrInfo",0
szErr       db  "NameLen:[3, 25)", 0
bCounter    dd  4
bNameLen    dd  4
szUserName  db  32 dup (0)
szRegCode   db  32 dup (0)
szTemp      db  32 dup (0)
szTemp01    db  4  dup (0)
szTemp02    db  4  dup (0)
szTemp03    db  4  dup (0)
szTemp04    db  4  dup (0)
szTemp05    db  4  dup (0)
szTemp06    db  4  dup (0)
szTemp07  db  12 dup (0)
szTemp08  db  12 dup (0)
szFmt       db  "%s%s", 0
          .code
; =====================================================================
_CalcCode       proc
                pushad
                mov     dword ptr szTemp01, eax
                mov     dword ptr szTemp02, edx
                mov     eaxdword ptr szTemp04
                mul     dword ptr szTemp01
                mov     ecxeax
                mov     eaxdword ptr szTemp02
                mul     dword ptr szTemp03
                add     ecxeax
                mov     eaxdword ptr szTemp01
                mul     dword ptr szTemp03
                add     edxecx
                mov     dword ptr szTemp03, eax
                mov     dword ptr szTemp04, edx
                popad
                ret
_CalcCode       endp
; =====================================================================
_Temp2Code      proc
                pushad
                mov     esieax
                mov     ebp, 1
                mov     ebx, 1
                xor     ecxecx
                xor     ediedi
                mov     dword ptr szTemp05, 0
                mov     dword ptr szTemp06, 0
BEGIN :
                mov     albyte ptr [esi+ebp-1]
                mov     edxeax
                add     dl, 0D0h
                sub     dl, 0Ah
                jnb     GAMEOVER
                mov     edieax
                and     edi, 0FFh
                sub     edi, 030h
                cmp     dword ptr szTemp06, 0
                jnz     @F
                cmp     dword ptr szTemp05, 0
                jb      GAMEOVER
                jmp     JMP_HERE
@@ :
                jl      GAMEOVER
JMP_HERE :
                cmp     dword ptr szTemp06, 0CCCCCCCh
                jnz     @F
                cmp     dword ptr szTemp05, 0CCCCCCCCh
                jbe     JBE_HERE
                jmp     GAMEOVER
@@ :
                jg      GAMEOVER
JBE_HERE :
                mov     dword ptr szTemp03, 0Ah
                mov     dword ptr szTemp04, 0
                mov     eaxdword ptr szTemp05
                mov     edxdword ptr szTemp06
                call    _CalcCode
                mov     edxdword ptr szTemp04
                mov     eaxedi
                cdq
                add     eaxdword ptr szTemp03
                adc     edxdword ptr szTemp04
                mov     dword ptr szTemp05, eax
                mov     dword ptr szTemp06, edx
                inc     ebp
                xor     ebxebx
                jmp     BEGIN
GAMEOVER :
                popad
                ret
_Temp2Code      endp
; =====================================================================
_Name2Temp      proc
                pushad
                xor     ediedi
                mov     ebxdword ptr szTemp01
                mov     ecxdword ptr szTemp02
                or      ecxecx
                jnz     @F
                or      edxedx
                je      LAST
                or      ebxebx
                je      LAST
@@ :
                or      edxedx
                jns     @F
                neg     edx
                neg     eax
                sbb     edx, 0
                or      edi, 1
@@ :
                or      ecxecx
                jns     @F
                neg     ecx
                neg     ebx
                sbb     ecx, 0
@@ :
                mov     ebpecx
                mov     ecx, 040h
                xor     ediedi
                xor     esiesi
LOOP01 :
                shl     eax, 1
                rcl     edx, 1
                rcl     esi, 1
                rcl     edi, 1
                cmp     ediebp
                jb      @F
                ja      JUMP01
                cmp     esiebx
                jb      @F
JUMP01 :
                sub     esiebx
                sbb     ediebp
                inc     eax
@@ :                
                loop    LOOP01
                mov     eaxesi
                mov     dword ptr szTemp01, eax
                mov     edxedi
                mov     dword ptr szTemp02, edx
                test    ebx, 1
                je      @F
                neg     edx
                neg     eax
                sbb     edx, 0
@@ :
                popad
                ret
LAST :
                div     ebx
                xchg    eaxedx
                xor     edxedx
                jmp     @B
_Name2Temp      endp
; =====================================================================
_CalcRegCode    proc
                pushad
                xor     edxedx
                mov     dword ptr bCounter, edx
                mov     ebxdword ptr bNameLen
                jmp     @F
CALC_START :
                mov     eax, offset szUserName
                mov     albyte ptr [eax+ebx-01]
                and     eax, 000000FFh
                mov     dword ptr szTemp01, eax
                mov     dword ptr szTemp02, edx             
                mov     eax, 0C7BC0D36h
                mov     edx, 0000025Ch
                call    _Name2Temp
                mov     eaxdword ptr szTemp01
                invoke  dwtoa, eax, addr szTemp02
                mov     eaxdword ptr szTemp02
                mov     edidword ptr bCounter
                mov     dword ptr [szTemp+edi], eax
                invoke  lstrlen, addr szTemp02
                add     edieax
                mov     dword ptr bCounter, edi
                dec     ebx
@@ :
                mov     eaxdword ptr bNameLen
                sub     eax, 00000006
                cmp     ebxeax 
                jl      @F
                test    ebxebx
                jg      CALC_START
@@ :
                mov     eax, offset szTemp
                call    _Temp2Code
                mov    eaxdword ptr szTemp05
                invoke  dw2hex, eax, addr szTemp07
                mov    eaxdword ptr szTemp06
                invoke  dw2hex, eax, addr szTemp08
                invoke  wsprintf, addr szTemp, addr szFmt, \
                    addr szTemp08, addr szTemp07
                invoke  lstrlen, addr szTemp
                mov    esieax
                xor    ediedi
                xor    edxedx
                mov    eax, offset szTemp
                .repeat
                    mov    dlbyte ptr [eax+edi]
                    inc    edi
                .until  edx != 030h
                sub    esiedi
                inc    esi
                .if    esi <= 0Ch
                    invoke  rstr, addr szTemp, addr szRegCode, 0Ch
                .elseif  esi < 010h
                    mov    eax, offset szTemp
                    invoke  rstr, eax, addr szTemp, esi
                    invoke  lstr, addr szTemp, addr szRegCode, 0Bh
                .else
                    invoke  lstr, addr szTemp, addr szRegCode, 0Bh
                .endif
                popad
                ret
_CalcRegCode    endp
; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_ProDlgMain proc    uses    ebx edi esi hWnd, wMsg, wParam, lParam
            mov     eax, wMsg
            .if     eax == WM_CLOSE
                    invoke  EndDialog, hWnd, NULL
            .elseif eax == WM_INITDIALOG
                    invoke  LoadIcon, hInstance, ICO_MAIN
                    invoke  SendMessage, hWnd, WM_SETICON, ICON_BIG, eax
            .elseif eax == WM_COMMAND
                mov eax, wParam
                .if ax == IDOK
                    invoke  RtlZeroMemory,addr szRegCode, 32
                    invoke  GetDlgItemText, hWnd, IDC_NAME, \
                            addr szUserName, 32
                    invoke  lstrlen, addr szUserName
                    mov     bNameLen, eax
                    .if     bNameLen >= 3 && bNameLen < 25
                            call    _CalcRegCode
                    .else
                            invoke  MessageBox, NULL, addr szErr, \
                                    addr szErrTitle, MB_OK
                    .endif
                    invoke  SetDlgItemText, hWnd, IDC_CODE, addr szRegCode
                    
                .elseif ax == IDCANCEL
                    invoke  EndDialog, hWnd, NULL
                .endif
            .else
                mov eax, FALSE
                ret
            .endif
            mov eax, TRUE
            ret
_ProDlgMain endp
; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start:
    invoke  GetModuleHandle, NULL
    mov     hInstance, eax
    invoke  DialogBoxParam, hInstance, DLG_MAIN, \
            NULL, offset _ProDlgMain, NULL
    invoke  ExitProcess, NULL
    
    end     start
; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
; keygen.rc
#include <resource.h>
#define    DLG_MAIN  101
#define    ICO_MAIN  102
#define   IDC_NAME  1000
#define   IDC_CODE  1001
#define   IDC_STATIC  -1
IDI_MAIN  ICON    "KeyGen.ico"
DLG_MAIN DIALOG DISCARDABLE  174, 140, 187, 79
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "家庭银行家 V 2.53 KeyGen by lq7972 [bruceyu13@sina.com]"
FONT 10, "System"
BEGIN
    DEFPUSHBUTTON   "确定",IDOK,21,54,50,14
    PUSHBUTTON      "取消",IDCANCEL,101,55,50,14
    LTEXT           "用户名:",IDC_STATIC,7,14,27,11
    LTEXT           "注册码:",IDC_STATIC,7,34,29,11
    EDITTEXT        IDC_NAME,37,13,143,12,ES_AUTOHSCROLL
    EDITTEXT        IDC_CODE,36,33,144,12,ES_AUTOHSCROLL
END
; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
; makefile
NAME = KeyGen
OBJS = $(NAME).obj
RES = $(NAME).res
LINK_FLAG = /subsystem:windows
ML_FLAG = /c /coff
$(NAME).exe: $(OBJS) $(RES)
  Link $(LINK_FLAG) $(OBJS) $(RES)
.asm.obj:
  ml $(ML_FLAG) $<
.rc.res:
  rc $<
  
clean:
  del *.obj
  del *.res
; >>>>>>>>>>>>>>>>>>>>>>>>>>
thanks.

注意:上传附件及图片大小不得大于30M。

⚠️ 版权声明:
本博客所有内容(含教程、源码、工具)仅供个人技术学习与研究交流使用,严禁商用、倒卖、二次分发及非法用途
未经作者书面授权,任何组织或个人不得转载、复制或用于其他平台,违者将追究相关责任。

0 0 0 举报
复制成功