📄 alignit.asm
字号:
.386P
Locals
jumps
include tiny_win32.inc
.Model Flat, StdCall
.Data
caption db "http://csir.cjb.net http://beam.to/evc",0 ; about box
box_1_text db "R!SC eVC",0
blank2 db "name > 2 character's ok? ",0
buffer1 db 42 dup (?)
buffer2 db 42 dup (?)
about db 'Align it! v1.20 ** kEYGEN #8 bY R!SC ** risc@notme.com **',10,13,0 ;)
msg MSGSTRUCT <?>
wc WNDCLASS <?>
hIce dd 0
regcode db 14 dup (0)
tempreg db 40h dup (0)
lengthy db 0
num0 dd 0
num1 dd 0
num2 dd 0
num3 dd 0
num4 dd 0
;----------------------------------------------------------------------------------------------
.Code
main:
jmp boring ; do all the windows stuff
getit: ; begin keygen code :) hahaha
; this bit is executed when
; cmp word ptr [wparam],IDD_BOX1 ; box 1 iD
; is equal...(and when dialog is initialised)
; int 03
push 041 ; size of buffer
push offset buffer2 ; buffer
push IDD_BOX1 ; what box to snatch the text from
push hwnd ; our dialog handle
call GetDlgItemTextA ; do it
setit:
cmp eax, 03 ; eax=length of text
jl blank_box2 ; less than 1 character, put a message in box 2
mov byte ptr [lengthy],al ; save the length
lea esi, tempreg
mov dword ptr [esi],0
mov dword ptr [esi+4],0
mov dword ptr [esi+8],0
lea ecx, [eax+1]
start_conversion_of_name:
lea esi,buffer2
lea edi,buffer1
spaceloop:
cmp byte ptr [esi],20h
je skipspace
movsb
dec ecx
jnz spaceloop
lea esi, buffer1
call getlength
cmp eax, 3
jl blank_box2
jmp donespaces
skipspace:
inc esi
jmp spaceloop
xor ecx,ecx
chekk:
inc esi
cmp byte ptr [esi],0
jnz chekk ; find the end of the name, should have done 'add esi,eax'
ohmy:
dec esi
inc ecx
cmp byte ptr [esi],20h ; check for spaces at the end, as these dont get used..
jz ohmy
mov byte ptr [esi+1],0 ; null terminate the name, after killing all spaces..
lea edi, buffer1
cmp byte ptr [edi],0
jz blank_box2 ; check the whole input wasnt spaces, if so...
mov esi, edi
chekk2:
cmp byte ptr [esi],020h ; check start of name for spaces
jnz ohmy2
inc esi
jmp chekk2
ohmy2:
cmp esi, edi
jz calc_value_1
lpcpy:
movsb
cmp byte ptr [esi-1],0 ; moves the whole name to the left, killing any spaces at the beginning
jnz lpcpy
donespaces:
calc_value_1: ; we are now ready to do the maths :)
;int 03
lea esi, buffer1
movsx eax, byte ptr [esi]
mov dword ptr [num0], eax
movsx eax, byte ptr [esi+1]
mov dword ptr [num1], eax
call getlength
shr eax, 1
;inc eax
movsx eax, byte ptr [esi+eax]
mov dword ptr [num2], eax
call getlength
dec eax
dec eax
movsx eax, byte ptr [esi+eax]
mov dword ptr [num3], eax
call getlength
dec eax
movsx eax, byte ptr [esi+eax]
mov dword ptr [num4], eax
mov eax, [num1]
add eax, [num4]
cdq
mov ecx, 10
div ecx
mov eax,edx
call convert_eax_to_ascii_dec
mov eax, [num0]
add eax, [num1]
cdq
mov ecx, 10
div ecx
mov eax,edx
call convert_eax_to_ascii_dec
mov eax, [num0]
add eax, [num0]
cdq
mov ecx, 10
div ecx
mov eax,edx
call convert_eax_to_ascii_dec
mov eax, [num1]
add eax, [num2]
add eax, [num3]
cdq
mov ecx, 10
div ecx
mov eax,edx
call convert_eax_to_ascii_dec
mov eax, [num2]
add eax, [num4]
cdq
mov ecx, 10
div ecx
mov eax,edx
call convert_eax_to_ascii_dec
mov eax, [num3]
add eax, [num4]
cdq
mov ecx, 10
div ecx
mov eax,edx
call convert_eax_to_ascii_dec
mov eax, [num0]
add eax, [num1]
cdq
mov ecx, 10
div ecx
mov eax,edx
call convert_eax_to_ascii_dec
; INT 03
lea esi, tempreg
call getlength
DEC EAX
add esi,eax
xor edx,edx
conversion_done:
; point to first digit..(of ascii serial)
lea edi, regcode ; where to copy it to
copy_number:
mov bl, byte ptr [esi]
mov byte ptr [edi], bl
inc edi
dec esi
inc edx
cmp edx, 5
jne copy_number
mov bl, 32h ; put in the '26'
mov byte ptr [edi], bl
inc edi
mov bl, 36h
mov byte ptr [edi], bl
inc edi
mov bl, byte ptr [esi]
mov byte ptr [edi], bl
inc edi
dec esi
mov bl, byte ptr [esi]
mov byte ptr [edi], bl
inc edi
dec esi
mov byte ptr [edi],0 ; null terminate
print_code_into_box_2:
push offset regcode ; ASCii serial
push 0
push WM_SETTEXT ; command
push IDD_BOX2 ; what box?
push hwnd ; dialog handle
call SendDlgItemMessageA
mov eax, 1
jmp main_finish ; DONE!
getlength:
push esi
cmp byte ptr [esi],0
je _null@
length1:
inc esi
cmp byte ptr [esi],0
jnz length1
_null@:
lea eax, dword ptr [esi]
pop esi
sub eax,esi
ret
convert_eax_to_ascii_dec:
pushad
xor ebx,ebx
mov cx,10
dec_loop:
shl ebx, 8
xor dx,dx
div cx
add dl,030h
mov bl,dl
test ax,ax
jne dec_loop
lea esi, tempreg
call getlength
add esi,eax
fix_@1:
mov byte ptr [esi],bl
inc esi
ror ebx,08
test bl,bl
jne fix_@1
mov byte ptr [esi],0
popad
ret
blank_box2:
push offset blank2 ; oh, less than 1 character
push 0
push WM_SETTEXT
push IDD_BOX2
push hwnd
call SendDlgItemMessageA
mov eax, 1
jmp main_finish
;----------------------------------------------------------------------------------------------
boring: ; boring code, windows stuff
push 0
call GetModuleHandleA
mov [hIce], eax
mov [wc.clsStyle], CS_HREDRAW + CS_VREDRAW + CS_GLOBALCLASS
mov [wc.clsLpfnWndProc], offset WndProc
mov [wc.clsCbClsExtra], 0
mov [wc.clsCbWndExtra], 0
mov eax, [hIce]
mov [wc.clsHInstance], eax
push 0
push offset Main_DlgProc
push 0
push IDD_DLG
push [hIce]
call DialogBoxParamA
jmp finish
Main_DlgProc proc hwnd:DWORD, wmsg:DWORD, wparam:DWORD, lparam:DWORD
push ebx
push esi
push edi
cmp [wmsg], WM_COMMAND ; is the message a command?
jz main_command
cmp [wmsg], WM_INITDIALOG ; has the box been initialised?
jz main_init
cmp [wmsg], WM_CLOSE ; was close pressed?
jz main_dlgdestroy
mov eax, 0
main_finish:
pop edi
pop esi
pop ebx
ret
msg_loop:
push 0
push 0
push 0
push offset msg
call GetMessageA
cmp ax, 0
jz end_loop
push offset msg
call TranslateMessage
push offset msg
call DispatchMessageA
jmp msg_loop
end_loop:
push [msg.msWPARAM]
call ExitProcess
Main_DlgProc endp
WndProc proc hwnd:DWORD, wmsg:DWORD, wparam:DWORD, lparam:DWORD
push esi
push edi
push ebx
defwndproc:
push [lparam]
push [wparam]
push [wmsg]
push [hwnd]
call DefWindowProcA
finish:
pop ebx
pop edi
pop esi
ret
WndProc endp
main_abt: ; about messagebox...
push 0
push offset caption
push offset about
push 0
call MessageBoxA
mov eax, 1
jmp main_finish
main_init: ; initialise dialog text
push offset box_1_text
push 0
push WM_SETTEXT
push IDD_BOX1
push hwnd
call SendDlgItemMessageA
jmp getit ; getit, get text in box 1, and creates serial from it
main_command:
cmp [wparam], IDD_ABT ; about button iD
jz main_abt
cmp word ptr [wparam],IDD_BOX1 ; box 1 iD
jz getit
cmp [wparam], IDD_EXIT ; quit button iD
jz main_dlgdestroy
mov eax, 0
jmp main_finish
main_dlgdestroy:
call ExitProcess
End main
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -