Created
December 18, 2016 03:26
-
-
Save aixxe/6774e34826eb1d66ac10fe0efc6b8ae5 to your computer and use it in GitHub Desktop.
Get interface pointers without using the exported CreateInterface function.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find the pointer to 'InterfaceReg::s_pInterfaceRegs' - works on Valve game libraries. (32-bit) | |
uintptr_t interface_list_addr = FindPattern("bin/client.so", "89 10 8B 15 ? ? ? ? A3") + 4; | |
InterfaceReg* interface_list = **reinterpret_cast<InterfaceReg***>(interface_list_addr); | |
for (InterfaceReg* current = interface_list; current; current = current->m_pNext) { | |
printf("* %s => 0x%x\n", current->m_pName, current->m_CreateFn()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef void* (*InstantiateInterfaceFn) (); | |
class InterfaceReg { | |
public: | |
InstantiateInterfaceFn m_CreateFn; | |
const char* m_pName; | |
InterfaceReg* m_pNext; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment