How to get address of base stack pointer

后端 未结 6 1909
逝去的感伤
逝去的感伤 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:49

    If you need the precise "base pointer" then inline assembly is the only way to go.

    It is, surprisingly, possible to write code that munges the stack with relatively little platform-specific code, but it's hard to avoid assembly altogether (depending on what you're doing).

    If all you're trying to do is avoid overflowing the stack, you can just take the address of any local variable.

提交回复
热议问题