Beispiel #1
0
GENERATE_INTERCEPT_HEADER(LoadLibraryA, HMODULE, WINAPI, _In_ LPCSTR lpLibFileName) {
	SDLOG(2, "DetouredLoadLibraryA %s\n", lpLibFileName);
	HMODULE mod = TrueLoadLibraryA(lpLibFileName);
	// restart detour in case we missed anything
	if(mod) restartDetour(lpLibFileName);
	return mod;
}
Beispiel #2
0
HMODULE WINAPI HookLL::HookLoadLibraryA(LPCSTR lpLibFileName)
{
	if (!InputHookManager::Get().GetInputHook().GetState(InputHook::HOOK_LL)) return TrueLoadLibraryA(lpLibFileName);

	if (SelfCheckA(lpLibFileName))
	{
		PrintLog("LoadLibraryA");
		InputHookManager::Get().GetInputHook().StartTimeoutThread();

		std::string path;

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

	return TrueLoadLibraryA(lpLibFileName);
}
Beispiel #3
0
HMODULE WINAPI MyLoadLibraryA(const char *lpFileName)
{
	const char *lpNewFileName = lpFileName;

	// The PCSC proxy will first try to call "REALPCSCLIB"
	if (lpFileName == NULL)
		lpNewFileName = NULL;
	else if (strcmp("REALPCSCLIB", lpFileName) == 0)
	{
		lpNewFileName = "C:\\WINDOWS\\system32\\winscard.dll";
		printf("==> proxy LoadLibrary(): PCSC proxy is loading the real PCSC lib\n");
	}
	else if (strstr(lpFileName, "winscard.dll") != NULL)
	{
		lpNewFileName = "C:\\Program Files\\Eid Test Infrastructure\\winscard.dll";
		printf("==> proxy LoadLibrary(): loading the proxy PCSC lib\n");
	}

	return TrueLoadLibraryA(lpNewFileName);
}