Im trying to detour a member function in a binary executable. I only know the function signature and the VA of the method. With the help of the 'method' sample, included in Detours Express 3.0, I came up with this:
class Detour
{
public:
void mine_target(const char* text)
{
printf("text = %s\n", text);
(this->*real_target)(text);
}
static void (Detour::*real_target)(const char* text);
};
void (Detour::*real_target)(const char* text)
= (void (Detour::*)(const char*))0x401010;
Which gives me the error:
error C2440: 'type cast' : cannot convert from 'int' to 'void (__thiscall Detour:: *)(const char *)'
There are no conversions from integral values to pointer-to-member values