MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / FindAndHook

Function FindAndHook

emmy_hook/src/emmy_hook.windows.cpp:430–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430void FindAndHook()
431{
432 HookLoadLibrary();
433
434 HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 0);
435 if (hSnapshot)
436 {
437 MODULEENTRY32 module;
438 module.dwSize = sizeof(MODULEENTRY32);
439 BOOL moreModules = Module32First(hSnapshot, &module);
440 while (moreModules)
441 {
442 PostLoadLibrary(module.hModule);
443 moreModules = Module32Next(hSnapshot, &module);
444 }
445 }
446 else
447 {
448 HMODULE module = GetModuleHandle(nullptr);
449 PostLoadLibrary(module);
450 }
451 CloseHandle(hSnapshot);
452}

Callers

nothing calls this directly

Calls 2

HookLoadLibraryFunction · 0.85
PostLoadLibraryFunction · 0.85

Tested by

no test coverage detected