MCPcopy Create free account
hub / github.com/bwapi/bwapi / _GetFunctionsList

Function _GetFunctionsList

bwapi/BWAPI/Source/NewHackUtil.cpp:52–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 }
51
52 DWORD* _GetFunctionsList(char* sourceModule, char* importModule)
53 {
54 HMODULE tempModule = GetModuleHandleA(sourceModule);
55 if ( !tempModule )
56 return NULL;
57
58 IMAGE_IMPORT_DESCRIPTOR *imports = _GetImportDescriptor(tempModule);
59 if ( !imports )
60 return NULL;
61
62 for (u32 i = 0; imports[i].Name != 0; i++)
63 {
64 if (lstrcmpiA((char*)(imports[i].Name + (u32)tempModule), importModule) == 0)
65 return (DWORD*)(imports[i].FirstThunk + (u32)tempModule);
66 }
67 return NULL;
68 }
69
70 FARPROC PatchImportOld(char* sourceModule, char* importModule, LPCSTR name, void* patchFunction)
71 {

Callers 1

PatchImportOldFunction · 0.85

Calls 1

_GetImportDescriptorFunction · 0.85

Tested by

no test coverage detected