예제 #1
0
GENERATE_INTERCEPT_HEADER(LoadLibraryExW, HMODULE, WINAPI, _In_ LPCWSTR lpLibFileName, _Reserved_ HANDLE hFile, _In_ DWORD dwFlags) {
	SDLOG(2, "DetouredLoadLibraryExW %s\n", CW2A(lpLibFileName));
	string fn((CW2A(lpLibFileName)));
	if(fn.find("GeDoSaTo") != fn.npos) return GetCurrentModule(); // find out why we need this
	HMODULE mod = TrueLoadLibraryExW(lpLibFileName, hFile, dwFlags);
	// restart detour in case we missed anything
	if(mod) restartDetour(CW2A(lpLibFileName));
	return mod;
}
예제 #2
0
파일: HookLL.cpp 프로젝트: 453483289/x360ce
HMODULE WINAPI HookLL::HookLoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
{
	if (!InputHookManager::Get().GetInputHook().GetState(InputHook::HOOK_LL)) return TrueLoadLibraryExW(lpLibFileName, hFile, dwFlags);

	if (SelfCheckW(lpLibFileName))
	{
		PrintLog("LoadLibraryExW");
		InputHookManager::Get().GetInputHook().StartTimeoutThread();

		std::wstring path;

		if (ModulePath(&path, InputHookManager::Get().GetInputHook().GetEmulator()))
			return TrueLoadLibraryExW(path.c_str(), hFile, dwFlags);
		else
			return TrueLoadLibraryExW(lpLibFileName, hFile, dwFlags);
	}

	return TrueLoadLibraryExW(lpLibFileName, hFile, dwFlags);
}