How to get address of base stack pointer

后端 未结 6 1914
逝去的感伤
逝去的感伤 2020-12-14 03:18

I am in the process of porting an application from x86 to x64. I am using Visual Studio 2009; most of the code is C++ and some portions are plain C. The __asm keyword is not

6条回答
  •  没有蜡笔的小新
    2020-12-14 03:50

    .code
    
    PUBLIC getStackFrameADDR _getStackFrameADDR
    getStackFrameADDR:
        mov RAX, RBP
        ret 0
    
    END
    

    Something like that could work for you.

    Compile it with ml64 or jwasm and call it using this in your code extern "C" void getstackFrameADDR(void);

提交回复
热议问题