Retrieve current function address

I'm currently working on a project. It requires me to get the address of the current function. The problem is my function is a loader function, it is injected to another process's space. I know this can be done in VC2005 using _ReturnAddress() or something. But I'm using VC6 and it seems no way to do it. So if it is possible please teach me. Thanks.
Last edited on
1
2
3
4
inline ULONG_PTR* GetAddressOfThisFunction()
{
  return (ULONG_PTR*)((ULONG_PTR)GetAddressOfThisFunction);
}


?
Last edited on
That won't work on injected code.

You have to do some pointer arithmetic, I think...
Topic archived. No new replies allowed.