很久没见到这么简单的玩意儿了,不容易。
使用,转载请保持完整性。
;======================================================================
;BootStar v7.33 keygen by arbiter. Feb.2002.
;Assemble:
;tasm32
/mx /m4 /z keygen.asm
;tlink32 -x -V4.0 -Tpe -aa -c keygen.obj,keygen,,,keygen.def,keygen.res
;======================================================================
.386
.MODEL FLAT, STDCALL
LOCALS
UNICODE =
0
include E:\TASM5Plus\TASM5Plus\INCLUDE\w32.inc
includelib E:\TASM5Plus\TASM5Plus\LIB\imp32i.lib
IDD_DIALOG equ 101
EDIT_NAME equ 1001
EDIT_CODE
equ 1002
BT_ABOUT
equ 1003
BT_EXIT equ
1004
extrn wsprintfA :
PROC
extrn CharUpperA :
PROC
extrn memset
: PROC
minl
= 10
maxl = 60
.DATA
defName db "arbiter[CCG]",
0
cap db "BootStar
v7.33 KeyGen by arbiter[CCG]", 0
format db
"BM1-%s-%s-%s", 0
abouttxt db "$^)
", 13, 10
db "Key
Generator for BootStar v7.33 ", 13, 10
db "@@@ Made by arbiter[CCG] @@@
", 13, 10, 13, 10
db "Hope you'll be satisfied! with ", 13, 10
db "this release
from arbiter. ", 13, 10
db "to
be continue... ", 0
aboutcap db "uh-huh!",
0
insuLen db "Name
length must equal or greater 10!", 0
.DATA?
hdlg
dd ?
_hInst dd ?
nlen
dd ?
uName db
60 dup( ? )
uCode db 30 dup( ? )
temp db 30 dup( ? )
part1
db 10 dup( ? )
part2 db
10 dup( ? )
part3 db 10 dup( ? )
.CODE
Start: pushad
call
GetModuleHandle, 0
test eax,
eax
je @out
mov
_hInst, eax
call DialogBoxParamA,
_hInst, IDD_DIALOG, 0, offset DlgProc, 0
@out:
popad
call ExitProcess, 0
RET
;----------------------------------------------------------------------
DlgProc PROC __hWnd : DWORD, wmsg : UINT,
_wParam : WPARAM, _lParam : LPARAM
uses ebx,
esi, edi
mov eax, wmsg
cmp
eax, WM_CLOSE
jz _wmDes
cmp eax, WM_COMMAND
jz
_wmCmd
cmp eax, WM_INITDIALOG
jz _wmInit
xor
eax, eax
RET
;----------------------------------------------------------------------
_wmDes:
call EndDialog, hdlg, 0
RET
;----------------------------------------------------------------------
_wmCmd:
mov eax, _wParam
cmp ax, EDIT_NAME
jnz
nochange
shr eax, 16
cmp ax, EN_CHANGE
jnz
nochange
call Generate
xor eax, eax
RET
nochange:
cmp ax, BT_ABOUT
jnz noAbout
call MessageBoxA, hdlg, offset abouttxt,
offset aboutcap, \
MB_ICONINFORMATION
OR MB_OK OR MB_APPLMODAL
jmp
cout
noAbout:
cmp ax,
BT_EXIT
jz _wmDes
cout:
xor eax, eax
RET
;-----------------------------------------------------------------------
_wmInit:
mov
eax, __hWnd
mov hdlg, eax
call GetDlgItem, __hWnd, EDIT_NAME
call SendMessageA, eax, EM_SETLIMITTEXT,
maxl, 0
call SetWindowTextA, __hWnd,
offset cap
call SetDlgItemTextA, __hWnd,
EDIT_NAME, offset defName
push 1
pop eax
RET
DlgProc ENDP
;-----------------------------------------------------------------------
Generate PROC
call GetDlgItemtextA,
__hWnd, EDIT_NAME, offset uName, maxl + 1
cmp eax,
minl
jl @CharsInsufficient
mov nlen, eax
push
offset uName
call CharUpperA
mov ecx, nlen
xor
eax, eax
xor edx, edx
lea esi, uName
@conti:
mov
al, byte ptr[esi]
add edx,
eax
inc esi
dec
ecx
jnz @conti
xchg dh, dl
push dx
call memset, offset part1, 0, 10
add esp, 12
pop
dx
lea edi, part1
mov byte ptr[edi], 2
mov
word ptr[edi+1], dx
push edi
push offset temp
call
Computel
mov eax, dword
ptr[temp]
mov dword ptr[part2], eax
mov al, byte ptr[uName]
mov byte ptr[part2+4], al ;finish constructing
the 2nd part.
mov dx,
word ptr[uName]
push dx
call memset, offset part1, 0, 10
add
esp, 12
pop dx
lea edi, part1
mov
byte ptr[edi], 2
mov word
ptr[edi+1], dx
push edi
push offset temp
call
Computel
mov eax, dword
ptr[temp]
mov dword ptr[part3], eax
;finish constructing the 3rd part.
call
memset, offset part1, 0, 10
add esp,
12
lea edi, part1
mov
byte ptr[edi], 1
mov eax,
nlen
mov byte ptr[edi+1], al
push edi
push offset
temp
call Computel
mov
ax, word ptr[temp]
push ax
push ax
call memset, offset part1, 0, 10
add esp, 12
pop ax
lea edi, part1
lea
esi, uName
mov word ptr[edi],
ax
mov al, byte ptr[esi+1]
inc edi
inc edi
stosb
;be preparing the 1st part...
call memset, offset temp, 0, 30
add
esp, 12
push offset part3
push offset part2
push
offset part1
call wsprintfA,
offset temp, offset format
add esp,
20
;now checking out the mid-age buffer length.
or
ecx, 0FFFFFFFFH
lea edi,
temp
xor al, al
repnz
scasb
neg ecx
dec ecx
xor edx,
edx
lea esi, [temp]
;sum up the temp buf for finalizing the part1.
sum2: xor
eax, eax
mov al, byte ptr[esi]
add dx, ax
inc
esi
dec cl
jnz
sum2
push dx
call memset, offset temp, 0, 30
add
esp, 12
pop dx
lea edi, [part1]
mov
byte ptr[edi], 1
mov byte
ptr[edi+1], dl
push edi
push offset temp
call
Computel
call memset, offset
part1, 0, 10
add esp, 12
pop ax
lea edi,
[part1]
mov word ptr[edi], ax
mov ax, word ptr[temp]
mov
word ptr[edi+2], ax
mov al,
byte ptr[uName+1]
mov byte ptr[edi+4],
al ;finishing constructing
1st part.
call memset,
offset uCode, 0, 30
add esp, 12
push offset part3
push
offset part2
push offset
part1
call wsprintfA, offset uCode,
offset format
add esp, 20
call SetDlgItemTextA, hdlg,
EDIT_CODE, offset uCode
GenOk: xor eax,
eax
RET
@CharsInsufficient:
call
SetDlgItemTextA, hdlg, EDIT_CODE, offset insuLen
jmp
GenOk
Generate ENDP
;-----------------------------------------------------------------------
Computel PROC
push ebp
mov ebp, esp
push
ebx
push edi
push esi
xor eax,
eax
xor ebx, ebx
xor
edx, edx
mov esi, [ebp+12]
mov edi, [ebp+8]
mov
bh, byte ptr[esi]
xor ecx,
ecx
goon:
inc esi
mov
bl, byte ptr[esi]
inc cl
mov eax, 0A5H
shl
eax, cl
xor bl, cl
xor bl, 0A5H
xor
al, bl
mov dl, al
and edx, 15
shr al,
4
movzx eax, al
mov
al, cctab[eax]
mov ah, cctab[edx]
stosw
dec bh
jnz goon
pop esi
pop
edi
pop ebx
pop ebp
RET 8
cctab db "0123456789ABCDEF"
Computel ENDP
;----------------------------------------------------------------------
END Start
- 标 题:BootStar v7.33 keygen in pure win32asm. (6千字)
- 作 者:arbiter
- 时 间:2002-2-8 22:03:15
- 链 接:http://bbs.pediy.com