hey guys why doesnt this work in .686 mode?


.if wParam==1011
invoke GetDlgItemText,hWin,IDC_REGNAME,offset regnamebuffer,sizeof regnamebuffer
invoke lstrlen, OFFSET regnamebuffer
invoke crc32, OFFSET regnamebuffer,eax
invoke GetDlgItemInt,hWin,IDC_REGKEY,offset regpassbuffer,NULL
.endif

.if eax==regpassbuffer <<<<<It says this is the part not working
invoke MessageBox,hWin,addr goodtxt,addr goodcap,MB_OK
.else
invoke MessageBox,hWin,addr badtxt,addr badcap,MB_OK
.endif

Im working on this in radasm under a masm project. Any help is appreciated.
Posted on 2002-10-22 21:34:12 by resistance_is_futile
To check whether GetDlgItemInt worked or not you check if regpassbuffer is TRUE or FALSE, if it is true you can get the value from EAX.
Posted on 2002-10-23 06:48:39 by _js_
how do i check if its TRUE or FALSE? Any kinda api i could use?
Posted on 2002-10-23 17:29:04 by resistance_is_futile
cmp regpassbuffer, TRUE
je __okay
Posted on 2002-10-23 19:25:40 by stryker
ok well I tried that seems i cant get it to work correctly....So I tried this:


.IF wParam==1011
invoke GetDlgItemText,hWin,IDC_REGNAME,offset regnamebuffer,sizeof regnamebuffer
invoke lstrlen, OFFSET regnamebuffer
invoke crc32, OFFSET regnamebuffer,eax
invoke GetDlgItemInt,hWin,IDC_REGKEY,offset regpassbuffer,FALSE

.if eax==offset regpassbuffer

invoke MessageBox,hWin,addr goodtxt,addr goodcap,MB_OK
.else
invoke MessageBox,hWin,addr badtxt,addr badcap,MB_OK
.endif
.endif


It seems to work but what happens is it reads out the badtxt all the time (error saying the code was not correct). It gets the name right and also seems to do everything right. I dont see any errors but their must be one either in my code or in the hash. The hash is simple but I am just starting to work on protection schemes so bare with me please. The has is linked to this post
Posted on 2002-10-23 20:25:07 by resistance_is_futile