Hello dear human being,
if I recall correctly, SH_MANUALHOOK_RECONFIGURE expects a vtable index, a vtable offset, and a this pointer offset; not a vtable pointer.
Quote:
|
I passed into that stuff a pointer to the vtable obtained from dlsym() and the vfunc index.
|
Ah, so you have a vtable pointer and an index. And you want a VP hook. In this case, I guess this is the correct way to do it:
Code:
// First, declare a manual hook
SH_DECL_MANUALHOOK*(MyHook, [your vtable index here], 0, 0 [, possibly parameters and rettype etc] );
// If you do not know the vtable index at compile-time, pass some dummy value (probably something big like 0xdeadbeef so that you get immediate crashes if you forget to set it later) to SH_DECL_MANUALHOOK and later do:
// SH_MANUALHOOK_RECONFIGURE(MyHook, [your vtable index], 0, 0);
// do NOT pass vtable pointers to SH_MANUALHOOK_RECONFIGURE !
// Then, retreive the vtable pointer, and do this:
int hookid = SH_ADD_MANUALDVPHOOK(MyHook, [your vtable pointer here], [your handler], [pre/post]);
If that gives you crashes, please post / private message the relevant parts of your code as it may be a pretty serious bug
Thank you very much,
PM
EDIT:
Ah, yes, you are right, testvphooks.cpp is only in the MSVC 7.1 project file; I won't add it to the 8.0 file because I don't have a Visual Studio version which could open such files and I'm also afraid of editing them manually. If you could send me the original 8.0 file with added testvphooks.cpp, I'd be very thankful
__________________