How to understand the call stack of Visual Studio?

前端 未结 3 541
不思量自难忘°
不思量自难忘° 2020-12-21 05:13
  VCamD.ax!CFactoryTemplate::CreateInstance()  + 0x3f bytes 
> VCamD.ax!CClassFactory::CreateInstance()  + 0x7f bytes 

What\'s 0x7f

3条回答
  •  一生所求
    2020-12-21 05:18

    If it's at the top of the stack, then it's the offset of the instruction pointer relative to the given symbol. So if the top stack frame is VCamD.ax!CClassFactory::CreateInstance() + 0x7f bytes, and VCamD.ax!CClassFactory::CreateInstance() is at location 0x3000 in memory (fictional obviously), then EIP is currently 0x307f. This shows you how far into the function you are.

    If it's further up the stack then it's the return offset from the start of the given symbol. So if VCamD.ax!CFactoryTemplate::CreateInstance() called VCamD.ax!CClassFactory::CreateInstance(), and VCamD.ax!CFactoryTemplate::CreateInstance() is at location 0x4000 , then when VCamD.ax!CClassFactory::CreateInstance() returns, EIP will be at 0x403f.

    One important thing to notice though is that if you see something like somedll!SomeFunc() + 0x5f33 bytes, you can be pretty certain that this is NOT the correct symbol. Since functions are rarely 0x5f33 bytes long, you can see that EIP is simply in a place that the debugger doesn't have symbols for.

提交回复
热议问题