diff --git a/texthook/engine/match32.cc b/texthook/engine/match32.cc index c98e93e..08a0e62 100644 --- a/texthook/engine/match32.cc +++ b/texthook/engine/match32.cc @@ -65,22 +65,8 @@ bool DeterminePCEngine() else for (int i = 0; i < 50; ++i) if (HMODULE module = GetModuleHandleW((DXVersion + L"_" + std::to_wstring(i)).c_str())) PcHooks::hookD3DXFunctions(module); - if (GetProcAddress((HMODULE)processStartAddress, "?Write@String@v8@@QBEHPAGHHH@Z")) - { - InsertV8Hook((HMODULE)processStartAddress); - return true; - } - if (HMODULE module = GetModuleHandleW(L"node.dll")) - { - InsertV8Hook(module); - return true; - } - - if (HMODULE module = GetModuleHandleW(L"nw.dll")) - { - InsertV8Hook(module); - return true; - } + for (HMODULE module : Array{ (HMODULE)processStartAddress, GetModuleHandleW(L"node.dll"), GetModuleHandleW(L"nw.dll") }) + if (GetProcAddress(module, "?Write@String@v8@@QBEHPAGHHH@Z")) return InsertV8Hook(module); if (InsertMonoHooks()) { return true;