google-site-verification: googlebaca44933768a824.html ASM return data question - Old Royal Hack Forum

Announcement

Collapse
No announcement yet.

ASM return data question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ASM return data question

    Hi.
    Since I'm renewing my hack atm, I want to use DrawModelEx instead of D3D hooks. In PaintTraverse hook I use the following (thanks to aVitamin!):
    Code:
    __asm
    {
    	PUSH allowForce
    	PUSH forceRepaint
    	PUSH vguiPanel
    	MOV ECX, pPanel
    	CALL pPaintTraverse
    }
    In DrawModelEx, I wanted to use the same but realized that I need the return data of the original function (integer). Is there a way to get that data?

    Here is how it _should_ be:
    Code:
    int iReturn = 0;
    __asm
    {
    	PUSH pInfo
    	MOV ECX, pModelRender
    	CALL pDrawModelEx
    	// copy <data>, iReturn
    }
    
    return iReturn;
    Thanks in advance!

    #2
    Indeed there is,

    Code:
    int iReturn = 0;
    
    __asm
    {
    	PUSH pInfo
    	MOV ECX, pModelRender
    	CALL pDrawModelEx
    	MOV iReturn, EAX
    }
    
    return iReturn;
    EAX is a register that generally holds return values from function calls.

    Comment


      #3
      Thanks. Works perfectly :)

      Comment

      Working...
      X