能力值:
( LV4,RANK:50 )
2 楼
.386
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
include user32.inc
includelib kernel32.lib
includelib user32.lib
include gdi32.inc
includelib gdi32.lib
DLG_MAIN EQU 1000H
IDC_OK EQU 2000H
IDC_EDIT1 EQU 3000H
IDC_EDIT2 EQU 4000H
IDC_EDIT3 EQU 4001
ICO_SMALL equ 777h
IDB_1 EQU 4002
.data
hInstance dd ?
hWinMain dd ?
hWin1 dd ?
hWin2 dd ?
hWin3 dd ?
szFmt db "mov dword ptr [%s+0%xh],0%x","h",0dh,0ah,0
szhuiche db "0d0a",0
szAdd dd ?
.code
_DLGPROC proc uses ebx ebp edi esi ,hWnd,uMsg,wParam,lParam
LOCAL @Buu [8]:byte
LOCAL @szBuffer [256]:byte
LOCAL @szOut [50]:byte
LOCAL @stCr:CHARRANGE
LOCAL @stRect:RECT
mov eax,uMsg
.if eax==WM_COMMAND
mov eax,wParam
.if ax==IDC_OK
mov szAdd,0
invoke RtlZeroMemory,addr @szBuffer,sizeof @szBuffer
invoke SendMessage,hWin3,EM_SETSEL,0,-1
invoke SendMessage,hWin3,EM_REPLACESEL,FALSE,addr @szBuffer
invoke GetDlgItemText,hWinMain,IDC_EDIT2,addr @Buu,sizeof @Buu
invoke GetDlgItemText,hWinMain,IDC_EDIT1,addr @szBuffer,sizeof @szBuffer
mov ecx,eax
lea edx,@szBuffer
f@@: mov eax,dword ptr [edx]
push edx
push ecx
invoke wsprintf,addr @szOut,offset szFmt,addr @Buu, szAdd,eax
invoke SendMessage,hWin3,EM_REPLACESEL,FALSE,addr @szOut
add szAdd,4
pop ecx
pop edx
add edx,4
sub ecx,4
cmp ecx,0
jge f@@
.endif
.elseif eax==WM_INITDIALOG
push hWnd
pop hWinMain
invoke GetDlgItem,hWinMain,IDC_EDIT1
mov hWin1,eax
invoke GetDlgItem,hWinMain,IDC_EDIT2
mov hWin2,eax
invoke GetDlgItem,hWinMain,IDC_EDIT3
mov hWin3,eax
invoke LoadIcon,hInstance,ICO_SMALL
invoke SendMessage,hWinMain,WM_SETICON,ICON_BIG,EAX
.elseif eax==WM_CLOSE
INVOKE EndDialog,hWinMain,NULL
.else
mov eax,TRUE
.endif
mov eax,FALSE
ret
_DLGPROC endp
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,eax,DLG_MAIN,NULL,offset _DLGPROC,NULL
invoke ExitProcess,NULL
end start