The MASM Forum

General => The Campus => Topic started by: xandaz on August 08, 2020, 04:16:30 AM

Title: RET problems
Post by: xandaz on August 08, 2020, 04:16:30 AM
   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.
Title: Re: RET problems
Post by: hutch-- on August 08, 2020, 05:34:28 AM
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.
Title: Re: RET problems
Post by: xandaz on August 08, 2020, 06:32:17 AM
   thanks. that has enlightmened my mind on the subject.
   Thanks Hutch
Title: Re: RET problems
Post by: hutch-- on August 08, 2020, 06:34:51 AM
 :biggrin:

Now the question is, is your young bloke old enough to borrow the car keys and your credit card yet ?  :tongue:
Title: Re: RET problems
Post by: xandaz on August 08, 2020, 06:58:25 AM
   no....it's an old photo but she's still a little girl. 10 years old to be exact.
Title: Re: RET problems
Post by: hutch-- on August 08, 2020, 07:04:48 AM
I confess to being hopeless at picking the gender of kids.