Author Topic: RET problems  (Read 242 times)

xandaz

  • Member
  • **
  • Posts: 152
  • I luv you babe
RET problems
« 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.
nothing to report.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7608
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: RET problems
« Reply #1 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

xandaz

  • Member
  • **
  • Posts: 152
  • I luv you babe
Re: RET problems
« Reply #2 on: August 08, 2020, 06:32:17 AM »
   thanks. that has enlightmened my mind on the subject.
   Thanks Hutch
nothing to report.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7608
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: RET problems
« Reply #3 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:
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

xandaz

  • Member
  • **
  • Posts: 152
  • I luv you babe
Re: RET problems
« Reply #4 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.
nothing to report.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7608
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: RET problems
« Reply #5 on: August 08, 2020, 07:04:48 AM »
I confess to being hopeless at picking the gender of kids.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: