Skip to content

Instantly share code, notes, and snippets.

@aixxe
Created December 18, 2016 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aixxe/6774e34826eb1d66ac10fe0efc6b8ae5 to your computer and use it in GitHub Desktop.
Save aixxe/6774e34826eb1d66ac10fe0efc6b8ae5 to your computer and use it in GitHub Desktop.
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/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());
}
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