Friday 15 March 2013

c++ - Address of a method defined within the class -


Say I have a class: (sorry for other questions)

  Class MyClass {Private: int a; Public: Int Getaway () {Return; }};   

If GetA () CPP can be cosmic on code . } I can debug it and find the address of this function, but when it is defined within the class I can not do this.

In the real problem, I gate direction () but as you can see that there is no address in it, I tried to search for the searchers searching for them but no one Also the code is not call directions

enter image details here

If it was defined outside of orbit, I would do:

  int callGetAFunction (DWORD * pointerToThatClass) {int retMe; __asm ​​{mov ecx, pointerToThatClass mov eax, 0x00427110 // myclass :: example address address :: GetA () eax mov retMe, eax} return retMe call; }   

Now I have the indicators of that class, but there is no address for GetA () method because it is defined, I How can I call GetA? () then the method? (The actual pointer is retrieved on DLL, I am trying to call from GetA () )

  int main () {void * pClass = FunctionThatReturnsAPointerToAMyClassObject (); }    

You can not locate memory MyClass :: GetA when it is already compiled, because it is considered inline

The difference between fully configuring the class member function to include its definition within your class or only the prototype and later, is that in the first case, the function is automatically a compiler Inline member function will be considered, whereas in the other it will be a normal (non-inline) class member function, which in fact does not consider any difference in behavior.

As described.

No comments:

Post a Comment