Hey a little interface I've written for my S4 League hack.
It's copying the virtual table of the given class instance and resetting
the instance's vtable pointer to point to our copy. In the copy we will
place our hooks. It also includes a function to easily call a virtual of a class.
Maybe it's useful.
VMT.h
VMT.cpp
usage of CallVirtual:
TODO:
- add normal vtable function replace (without copying the whole table)
It's copying the virtual table of the given class instance and resetting
the instance's vtable pointer to point to our copy. In the copy we will
place our hooks. It also includes a function to easily call a virtual of a class.
Maybe it's useful.
VMT.h
VMT.cpp
usage of CallVirtual:
Code:
using tEndScene = HRESULT( __stdcall* )( IDirect3DDevice9* ); auto retValue = VMT::CallVirtual<tEndScene>( pDevice, 42 )( pDevice );
- add normal vtable function replace (without copying the whole table)