News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

RET problems

Started by xandaz, August 08, 2020, 04:16:30 AM

Previous topic - Next topic

xandaz

   Hello guys. i'm using unrar.dll on an application to recover passwords of RAR files. The library uses a Callback procedure to take care of some of the operations. I process an UCM_NEEDPASSWORD message and use lstrcpy to copy the password into the the specified buffer. Suposatelly you ret eax=1 to continuing processing the message but the RET menemonic doesm't find it's way back into the Thread procedure that takes care of operations.
   Any sugestions on why RET doesn't find it's way to the propper IP?
   Thanks in advance.

hutch--

If the call is STDCALL each argument passed on the stack has to be balanced on exit with 4 bytes. A 4 argument procedure call uses,

  ret 16  ; 4 * 4

If the function call is in the C calling convention, the caller balances the stack so you only use a RET in the procedure.

xandaz

   thanks. that has enlightmened my mind on the subject.
   Thanks Hutch

hutch--

 :biggrin:

Now the question is, is your young bloke old enough to borrow the car keys and your credit card yet ?  :tongue:

xandaz

   no....it's an old photo but she's still a little girl. 10 years old to be exact.

hutch--

I confess to being hopeless at picking the gender of kids.