BabyCat
BabyCat

Reputation: 21

How to get real address of function in VC++

I am learning about Win32API . My Program have two function . I try use debug mode in VC++ . I set a break point when call dumy function

void CALLBACK Dummy(){

    printf("\n Hello Dummy Func!");
}

//////////////////////////////////////////////////////////////////////////

int _tmain(int argc, _TCHAR* argv[]){

      (breakPoint) Dummy();
}

when I call dumy() function . Program jump to a address 012110D7 as flow code

Dummy:
012110D7  jmp         Dummy(12113A0h) 

while real address of dummy function is 12113A0h My Question is How to get real address of Dummy function is 12113A0h The Problem resolved when i run in release Mode. This is first time i join StackOver flow . I hope every body help me. Thank you !! BUZZ

Upvotes: 2

Views: 276

Answers (1)

Hans Passant
Hans Passant

Reputation: 941208

This jmp instruction is inserted by the linker to support Edit + Continue in the Debug configuration. Which allows editing and compiling your code while you debug. The extra indirection through the jmp instruction allows generating a different version of the function, the jmp destination is altered to make the changes effective.

Turn Edit and Continue off with Project + Properties, Linker, General, Enabled Incremental Linking = No.

Upvotes: 5

Related Questions