- UID
- 26818
注册时间2007-2-13
阅读权限20
最后登录1970-1-1
以武会友
TA的每日心情 | 开心 2018-10-21 14:56 |
---|
签到天数: 1 天 [LV.1]初来乍到
|
发表于 2007-3-1 15:34:57
|
显示全部楼层
飘过,丢个注册机模版
;
;不懂算法的keygen模版,欢迎随便修改
;
.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
include \masm32\include\comctl32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\comctl32.lib
dlgproc proto :DWORD,:DWORD,:DWORD,:DWORD
.const
.data
szName db 020h dup (0)
szSerial db 010h dup (0)
fmt db "%d",0
szErr db "错误",0
szErr1 db "名字长度必须为7",0
.data?
hInstance dd ?
.code
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,eax,101,NULL,offset dlgproc,0
invoke ExitProcess,NULL
dlgproc proc hWnd:DWORD,wMsg:DWORD,wParam:DWORD,lParam:DWORD
mov eax,wMsg
.if eax == WM_CLOSE
invoke EndDialog,hWnd,NULL
.elseif eax == WM_INITDIALOG
invoke LoadIcon,hInstance,1
invoke SendMessage,hWnd,WM_SETICON,0,eax
.elseif eax == WM_COMMAND
mov eax,wParam
.if eax == 1002
invoke GetDlgItemText,hWnd,1000,addr szName,11h
.if eax!=7
invoke MessageBox,NULL,addr szErr1,addr szErr,MB_OK
mov eax,FALSE
ret
.endif
xor eax,eax
movsx ebx,byte ptr ds:[szName]
movsx ecx,byte ptr ds:[szName+6]
imul ebx,ecx
add eax,ebx
movsx ebx,byte ptr ds:[szName+1]
movsx ecx,byte ptr ds:[szName+5]
imul ebx,ecx
add eax,ebx
movsx ebx,byte ptr ds:[szName+2]
movsx ecx,byte ptr ds:[szName+4]
imul ebx,ecx
add eax,ebx
imul eax,eax
movsx ebx,byte ptr ds:[szName+3]
xor eax,ebx
.while eax<1000000
imul eax,eax
cdq
xor eax,edx
sub eax,edx
.endw
invoke wsprintf,addr szName,addr fmt,eax
mov al,byte ptr ds:[szName+3]
mov byte ptr ds:[szSerial],al
mov al,byte ptr ds:[szName+4]
mov byte ptr ds:[szSerial+1],al
mov al,byte ptr ds:[szName+5]
mov byte ptr ds:[szSerial+2],al
mov al,byte ptr ds:[szName+6]
mov byte ptr ds:[szSerial+3],al
mov al,byte ptr ds:[szName]
mov byte ptr ds:[szSerial+4],al
mov al,byte ptr ds:[szName+1]
mov byte ptr ds:[szSerial+5],al
mov al,byte ptr ds:[szName+2]
mov byte ptr ds:[szSerial+6],al
mov byte ptr ds:[szSerial+7],037h
mov byte ptr ds:[szSerial+8],039h
mov byte ptr ds:[szSerial+9],0h
invoke SetDlgItemText,hWnd,1001,addr szSerial
.endif
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
dlgproc endp
end start |
|