bruhmoment21 / UniversalHookX

Universal graphical hook for Windows apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic Vtable Index Recover

stevemk14ebr opened this issue · comments

Hey, your vtable hooks have hardcoded indices, you can recover these dynamically using this:

https://gist.github.com/stevemk14ebr/12d70ae90175e71194520e9bb0c5e1e5

Example of what I mean:

void* fnCreateSwapChain = pFactoryVTable[10];
void* fnCreateSwapChainForHwndChain = pFactoryVTable[15];
void* fnCreateSwapChainForCWindowChain = pFactoryVTable[16];
void* fnCreateSwapChainForCompChain = pFactoryVTable[24];
void* fnPresent = pVTable[8];
void* fnPresent1 = pVTable[22];
void* fnResizeBuffers = pVTable[13];
void* fnResizeBuffers1 = pVTable[39];
void* fnExecuteCommandLists = pCommandQueueVTable[10];

commented

i don't think windows will ever change the indexes but this is a good addition

I agree with you, you could use it to unify parts of the directx hooks across versions though.