本文整理汇总了C++中ProxyHelper::HasProfile方法的典型用法代码示例。如果您正苦于以下问题:C++ ProxyHelper::HasProfile方法的具体用法?C++ ProxyHelper::HasProfile怎么用?C++ ProxyHelper::HasProfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProxyHelper
的用法示例。
在下文中一共展示了ProxyHelper::HasProfile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DllMain
// CBT Hook-style injection.
BOOL APIENTRY DllMain( HINSTANCE hModule, DWORD fdwReason, LPVOID lpReserved )
{
if (fdwReason == DLL_PROCESS_ATTACH) // When initializing....
{
hDLL = hModule;
// We don't need thread notifications for what we're doing. Thus, get
// rid of them, thereby eliminating some of the overhead of this DLL
DisableThreadLibraryCalls(hModule);
// Only hook the APIs if this is the right process.
GetModuleFileName(GetModuleHandle(NULL), targetExe, sizeof(targetExe));
PathStripPath(targetExe);
GetModuleFileName(GetModuleHandle(NULL), targetPath, sizeof(targetPath));
targetPathString = std::string(targetPath);
targetPathString = targetPathString.substr(0, targetPathString.find_last_of("\\/"));
OutputDebugString("HIJACKDLL checking process: ");
OutputDebugString(targetExe);
OutputDebugString("\n");
ParsePaths();
ProxyHelper helper = ProxyHelper();
if (helper.HasProfile(targetExe))
{
if (HookAPICalls(&D3DHook))
{
OutputDebugString("HookAPICalls(D3D): TRUE\n");
}
else if(HookAPICalls(&KernelHook))
{
OutputDebugString("HookAPICalls(Kernel): TRUE\n");
}
else
{
OutputDebugString("HookAPICalls(Both): FALSE\n");
}
SetDllDirectory(dllDir);
SaveExeName(targetExe);
}
}
return TRUE;
}
示例2: DllMain
// CBT Hook-style injection.
BOOL APIENTRY DllMain( HINSTANCE hModule, DWORD fdwReason, LPVOID lpReserved )
{
if (fdwReason == DLL_PROCESS_ATTACH) // When initializing....
{
hDLL = hModule;
// We don't need thread notifications for what we're doing. Thus, get
// rid of them, thereby eliminating some of the overhead of this DLL
DisableThreadLibraryCalls(hModule);
// Only hook the APIs if this is the right process.
GetModuleFileName(GetModuleHandle(NULL), targetExe, sizeof(targetExe));
PathStripPath(targetExe);
/*if(std::string(targetExe) == "GitHub.exe")
{
OutputDebugString("Ignoring process: ");
OutputDebugString(targetExe);
OutputDebugString("\n");
return TRUE;
}*/
GetModuleFileName(GetModuleHandle(NULL), targetPath, sizeof(targetPath));
targetPathString = std::string(targetPath);
targetPathString = targetPathString.substr(0, targetPathString.find_last_of("\\/") + 1);
OutputDebugString("HIJACKDLL checking process: ");
OutputDebugString(targetExe);
OutputDebugString("\n");
#ifndef x64
ParsePaths();
#endif
ProxyHelper helper = ProxyHelper();
if (helper.HasProfile(targetExe, targetPathString.c_str()))
{
#ifndef x64
//Need to check that the d3d9.dll is actually in the game folder - If it is, then we don't need to hook API calls
//using the methods below as d3d9 will just be loaded by the game's executable
if (!fileExists(targetPathString + "D3D9.dll"))
{
if (HookAPICalls(&D3DHook))
{
OutputDebugString("HookAPICalls(D3D): TRUE\n");
}
else if(HookAPICalls(&KernelHook))
{
OutputDebugString("HookAPICalls(Kernel): TRUE\n");
}
else
{
OutputDebugString("HookAPICalls(Both): FALSE\n");
}
SetDllDirectory(dllDir);
}
else
{
OutputDebugString(std::string("D3D9.dll found in game directory (" + targetPathString + ") - Bypassing API injection").c_str());
}
#endif
}
else
{
OutputDebugString((std::string("Game profile not found for: ") + targetExe).c_str());
}
}
return TRUE;
}