我试图在应用程序中绕行一个函数。我有它的来源可用。调用约定是错误的,我无法弄清楚。 C++
class Foot : public Something, public SomethingElse {
public:
Foot(double SomethingAgain, double Somethings,
Blahblah *AnotherThing = NULL);
virtual ~Foot();
virtual void detourmepls(const char *ARGUMENT);
};
这是如何在头文件中定义的。
这是我用来定义它,所以我会从我的dll使用正确的地址来调用它。
void (__cdecl* detourmepls)(const char *stuff);
虚拟void函数的真正调用约定是什么?
任何帮助表示赞赏。
新修改和INFOS:
我使用MS走弯路1.5
detourmepls = (void(__thiscall*)(void *Pthis,void *Unknown,const char *))DetourFunction((PBYTE)ADDRESS, (PBYTE)hookedFunction);
这是我试过的弯路(其漂亮搞砸了。)
我假设你传递函数作为C回调,这是不可能的。如果注册回调函数允许传递用户数据,则编写一个静态函数,并将'this'指针传递给注册函数。 –
你正在得到什么错误?当我尝试调用原始函数时, – vishram0709
应用程序崩溃。 – user3548518