Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get interface pointers without using the exported CreateInterface function.
// Find the pointer to 'InterfaceReg::s_pInterfaceRegs' - works on Valve game libraries. (32-bit)
uintptr_t interface_list_addr = FindPattern("bin/", "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());
typedef void* (*InstantiateInterfaceFn) ();
class InterfaceReg {
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