Errores en MASM con RadASM

Iniciado por Erik#, 2 Enero 2009, 12:55 PM

0 Miembros y 1 Visitante están viendo este tema.

Erik#

Mirad:

Código (asm) [Seleccionar]
.386
.model flat, stdcall  ;32 bit memory model
option casemap :none  ;case sensitive

include CrackMe 1 - Erik.inc

.code

start:

invoke GetModuleHandle,NULL
mov hInstance,eax

    invoke InitCommonControls
invoke DialogBoxParam,hInstance,IDD_DIALOG1,NULL,addr DlgProc,NULL
invoke ExitProcess,0

;########################################################################

DlgProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM

mov eax,uMsg
.if eax==WM_INITDIALOG

.elseif eax==WM_COMMAND
.if eax==crackit
invoke GetDlgItemText,hWin,1001,Addr serial,10
eax serial,'hello'
je correct
invoke  MessageBox,HWND_DESKTOP,"El serial no es correcto","Incorrecto",MB_OK
        invoke  ExitProcess,0
correct:
invoke  MessageBox,HWND_DESKTOP,"El serial es correcto","Correcto",MB_OK
        invoke  ExitProcess,0
.endif

.elseif eax==WM_CLOSE
invoke EndDialog,hWin,0
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret

DlgProc endp

end start


Me da error en:

invoke GetDlgItemText,hWin,1001,Addr serial,10
invoke  MessageBox,HWND_DESKTOP,"El serial no es correcto","Incorrecto",MB_OK
invoke  MessageBox,HWND_DESKTOP,"El serial es correcto","Correcto",MB_OK
eax serial,9519511


karmany

¿Has incluído user32.dll? sólo veo un include CrackMe 1 - Erik.inc, tal vez lo hayas incluído ahí...
GetDlgItemText --> user32.dll
MessageBoxA --> user32.dll

Erik#

.inc:

Código (asm) [Seleccionar]

include windows.inc
include kernel32.inc
include user32.inc
include Comctl32.inc
include shell32.inc

includelib kernel32.lib
includelib user32.lib
includelib Comctl32.lib
includelib shell32.lib

DlgProc PROTO :HWND,:UINT,:WPARAM,:LPARAM

.const

IDD_DIALOG1 equ 101
crackit equ 1002
crack equ 1001
;#########################################################################

.data?

hInstance dd ?

;#########################################################################