这篇教程C++ DetourAttach函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DetourAttach函数的典型用法代码示例。如果您正苦于以下问题:C++ DetourAttach函数的具体用法?C++ DetourAttach怎么用?C++ DetourAttach使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DetourAttach函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: InitStopWriteDiskBOOL WINAPI InitStopWriteDisk(){ static BOOL bInit = FALSE; if ( FALSE == bInit ) { bInit = TRUE; g_bEnableWriteDisk = TRUE; DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)pCreateFileW, (PBYTE)MyCreateFileW); DetourAttach(&(PVOID&)pWriteFile, (PBYTE)MyWriteFile); DetourAttach(&(PVOID&)pReadFile, (PBYTE)MyReadFile); DetourAttach(&(PVOID&)pSetFilePointer, (PBYTE)MySetFilePointer); DetourAttach(&(PVOID&)pCloseHandle, (PBYTE)MyCloseHandle); DetourAttach(&(PVOID&)pDeleteFileW, (PBYTE)MyDeleteFileW); DetourAttach(&(PVOID&)pGetFileSize, (PBYTE)MyGetFileSize); DetourAttach(&(PVOID&)pGetFileSizeEx, (PBYTE)MyGetFileSizeEx); DetourAttach(&(PVOID&)pGetFileInformationByHandle, (PBYTE)MyGetFileInformationByHandle); DetourAttach(&(PVOID&)pFlushViewOfFile, (PBYTE)MyFlushViewOfFile); DetourTransactionCommit(); } return FALSE;}
开发者ID:gaozan198912,项目名称:myproject,代码行数:26,
示例2: InitInstancevoid InitInstance(HANDLE hModule) { logf(0, "InitInstance."); // Initialisation gl_hOriginalDll = NULL; gl_hThisInstance = NULL; // Storing Instance handle into global var gl_hThisInstance = (HINSTANCE) hModule; DisableThreadLibraryCalls((HMODULE) hModule); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TextOutA_fn, myTextOutA); if(DetourTransactionCommit() != NO_ERROR) { logf(0, "Could not hook TextOutA"); ::ExitProcess(0); } DetourTransactionBegin(); DetourAttach(&(PVOID&)CreateWindowEx_fn, myCreateWindowEx); if(DetourTransactionCommit() != NO_ERROR) { logf(0, "Could not hook CreateWindowEx"); ::ExitProcess(0); } DetourTransactionBegin(); DetourAttach(&(PVOID&)DrawTextExA_fn, myDrawTextExA); if(DetourTransactionCommit() != NO_ERROR) { logf(0, "Could not hook DrawTextExA"); ::ExitProcess(0); }}
开发者ID:ToadKing,项目名称:ddhack,代码行数:35,
示例3: HookUser32bool HookUser32(){#if defined(DETOURS_VERSION) && DETOURS_VERSION == 20100 DetourTransactionBegin(); DetourAttach(&(PVOID& )Real_GetAsyncKeyState, Mine_GetAsyncKeyState); DetourAttach(&(PVOID& )Real_GetKeyState, Mine_GetKeyState); DetourAttach(&(PVOID& )Real_GetKeyboardState, Mine_GetKeyboardState); DetourTransactionCommit();#else // #if defined(DETOURS_VERSION) && DETOURS_VERSION == 20100 if (!DetourFunctionWithTrampoline((PBYTE)Real_GetAsyncKeyState, (PBYTE)Mine_GetAsyncKeyState)) return false; _TRACE("HookUser32(), Real_GetAsyncKeyState = %p, Mine_GetAsyncKeyState = %p/n", Real_GetAsyncKeyState, &Mine_GetAsyncKeyState); if (!DetourFunctionWithTrampoline((PBYTE)Real_GetKeyState, (PBYTE)Mine_GetKeyState)) return false; _TRACE("HookUser32(), Real_GetKeyState = %p, Mine_GetKeyState = %p/n", Real_GetKeyState, &Mine_GetKeyState); DetourFunctionWithTrampoline((PBYTE)Real_GetKeyboardState, (PBYTE)Mine_GetKeyboardState);#endif // #if defined(DETOURS_VERSION) && DETOURS_VERSION == 20100 return true;}
开发者ID:IgorYunusov,项目名称:mylibs,代码行数:28,
示例4: Apply virtual void Apply() override { TRACE_ENTRYEXIT; std::cout << "old addr " << kOldAddr << " new addr " << kNewAddr << std::endl; mRealFuncPtr = (TFuncType)kOldAddr; LONG err = 0;#pragma warning(push)#pragma warning(disable:4127) // conditional expression is constant if (convention == eCDecl) { err = DetourAttach(&(PVOID&)mRealFuncPtr, Cdecl_Static_Hook_Impl); } else if (convention == eStdCall) { err = DetourAttach(&(PVOID&)mRealFuncPtr, StdCall_Static_Hook_Impl); } else { abort(); }#pragma warning(pop) if (err != NO_ERROR) { abort(); } }
开发者ID:paulsapps,项目名称:msgi,代码行数:29,
示例5: DetourCreateProcessFunctionsstatic int DetourCreateProcessFunctions(){ PVOID OldCreatW=NULL,OldCreateA=NULL;#if 0 CreateProcessNext =(CreateProcessFunc_t) GetProcAddress(hModule,(LPCSTR)TEXT("CreateProcess")); if(CreateProcessNext == NULL) { ret = LAST_ERROR_CODE(); ERROR_INFO("could not get process addr for CreateProcess error(%d)/n",ret); goto fail; }#endif OldCreatW = (PVOID)CreateProcessWNext; DEBUG_INFO("CreateProcess Code"); DEBUG_BUFFER(OldCreatW,5); OldCreateA = (PVOID)CreateProcessANext; DEBUG_BUFFER(OldCreateA,5); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach((PVOID*)&CreateProcessWNext,CreateProcessWCallBack); DetourAttach((PVOID*)&CreateProcessANext,CreateProcessACallBack); DetourTransactionCommit(); DEBUG_INFO("After Detour Code"); DEBUG_BUFFER(OldCreatW,5); DEBUG_BUFFER(OldCreateA,5); DEBUG_INFO("createprocess detour/n"); return 0;}
开发者ID:jeppeter,项目名称:g3,代码行数:30,
示例6: DllMainBOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ){ switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: g_hDll = hModule; DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)CopyCreateFileW, Bio_CreateFileW); DetourAttach(&(PVOID&)CopyMoveFileW, Bio_MoveFileW); DetourAttach(&(PVOID&)CopyDeleteFileW, Bio_DeleteFileW); DetourAttach(&(PVOID&)CopyRemoveDirectoryW, Bio_RemoveDirectoryW); DetourAttach(&(PVOID&)CopyMessageBoxW, Bio_MessageBoxW); DetourTransactionCommit(); break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)CopyCreateFileW, Bio_CreateFileW); DetourDetach(&(PVOID&)CopyMoveFileW, Bio_MoveFileW); DetourDetach(&(PVOID&)CopyDeleteFileW, Bio_DeleteFileW); DetourDetach(&(PVOID&)CopyRemoveDirectoryW, Bio_RemoveDirectoryW); DetourDetach(&(PVOID&)CopyMessageBoxW, Bio_MessageBoxW); DetourTransactionCommit(); break; } return TRUE;}
开发者ID:songcser,项目名称:ALM,代码行数:35,
示例7: DetourRestoreAfterWithvoid DirectXHook::hookDirectX(){ horizontalRes = (uint32_t*)0x2301D08; verticalRes = (uint32_t*)0x2301D0C; uint32_t* directXVTable = **((uint32_t***)0x50DADDC); // d3d9 interface ptr origEndScenePtr = (HRESULT(__stdcall *) (LPDIRECT3DDEVICE9)) directXVTable[42]; origDrawIndexedPrimitivePtr = (HRESULT(__stdcall *) (LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT)) directXVTable[82]; DetourRestoreAfterWith(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach((PVOID*)&origEndScenePtr, &DirectXHook::hookedEndScene); // redirect origEndScenePtr to newEndScene if (DetourTransactionCommit() != NO_ERROR) { OutputDebugString("DirectX EndScene hook failed."); } DetourRestoreAfterWith(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach((PVOID*)&origDrawIndexedPrimitivePtr, &DirectXHook::hookedDrawIndexedPrimitive); // redirect DrawIndexedPrimitive to newDrawIndexedPrimitive if (DetourTransactionCommit() != NO_ERROR) { OutputDebugString("DirectX DrawIndexedPrimitive hook failed."); }}
开发者ID:ChurroV2,项目名称:ElDorito,代码行数:29,
示例8: ModifyFuncEntrystatic VOID ModifyFuncEntry(){ DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueExtTextOutW, SUIExtTextOutW); DetourAttach(&(PVOID&)TrueTextOutW, SUITextOutW); DetourTransactionCommit();}
开发者ID:tlswkdgb1,项目名称:smartui-common,代码行数:8,
示例9: DetourRestoreAfterWithMenu::Menu(){ // Hook loadFinished & loadMap DetourRestoreAfterWith(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach((PVOID*)&loadFinished, &hookedLoadFinished); DetourAttach((PVOID*)&loadMap, &hookedLoadMap);}
开发者ID:ChurroV2,项目名称:ElDorito,代码行数:9,
示例10: HookArmorvoid HookArmor(){ DetourAttach((void**)MyClass::_UNKNOWN_0046F0B0_GetPtr(), (void*)GetFnAddr(&MyClass::TEST_0046F0B0)); DetourAttach((void**)MyClass::_UNKNOWN_0046E720_GetPtr(), (void*)GetFnAddr(&MyClass::TEST_0046E720)); //DetourAttach((void**)MyClass::_UNKNOWN_00432070_GetPtr(), *(void**)(&TEST_00432070)); //auto TEST_00734F50 = &MyClass::TEST_00734F50; //auto TEST_00AB53E0 = &MyClass::TEST_00AB53E0; //DetourAttach((void**)MyClass::_UNKNOWN_00734F50_GetPtr(), *(void**)(&TEST_00734F50)); //DetourAttach((void**)MyClass::_UNKNOWN_00AB53E0_GetPtr(), *(void**)(&TEST_00AB53E0));}
开发者ID:MagneticHourglass,项目名称:hdt-pe,代码行数:10,
示例11: HookMemoryvoid HookMemory(){ //DetourAttach((void**)&OLD_0042C840, TEST_0042C840); //DetourAttach((void**)&OLD_0042C870, TEST_0042C870); //DetourAttach((void**)&OLD_00BE70B0, TEST_00BE70B0); DetourAttach((void**)HookHeap::_Allocate_GetPtr(), (void*)GetFnAddr(&HookHeap::Allocate)); DetourAttach((void**)hkSkyrimMemoryAllocator::_blockAlloc_GetPtr(), (void*)GetFnAddr(&hkSkyrimMemoryAllocator::blockAllocGuard)); DetourAttach((void**)hkSkyrimMemoryAllocator::_blockFree_GetPtr(), (void*)GetFnAddr(&hkSkyrimMemoryAllocator::blockFreeGuard)); DetourAttach((void**)UnkRCManager::_WaitForRun_GetPtr(), (void*)GetFnAddr(&UnkRCManager::WaitForRun)); DetourAttach((void**)UnkHeapStruct1::_Unknown00436740_GetPtr(), (void*)GetFnAddr(&UnkHeapStruct1::TEST_00436740));}
开发者ID:MagneticHourglass,项目名称:hdt-pe,代码行数:11,
示例12: HookFunctionsvoid HookFunctions(){ DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); *(DWORD*)&CGameSpyClient__JoinGroupRoom = 0x00805080; *(DWORD*)&CConnectionLib__UpdateGameSpyClient = 0x008027A0; int success = DetourAttach(&(PVOID&)CGameSpyClient__JoinGroupRoom, CGameSpyClient__JoinGroupRoom_Hook)==0 && DetourAttach(&(PVOID&)CConnectionLib__UpdateGameSpyClient, CConnectionLib__UpdateGameSpyClient_Hook)==0; fprintf(logFile, "Hooked: %d/n", success); DetourTransactionCommit();}
开发者ID:addicted2rpg,项目名称:NWNCX,代码行数:12,
示例13: DetourRestoreAfterWithvoid Hooker::Hook(){ DetourRestoreAfterWith(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Real_TextOutA,Fake_TextOutA); DetourAttach(&(PVOID&)Real_TextOutW,Fake_TextOutW); DetourAttach(&(PVOID&)Real_ExtTextOutA,Fake_ExtTextOutA); DetourAttach(&(PVOID&)Real_ExtTextOutW,Fake_ExtTextOutW); DetourTransactionCommit();}
开发者ID:uestcll,项目名称:practice,代码行数:14,
示例14: DetourAttachvoid PatchTitanium::Register() { Log::Get().Write(Log::Status, "Registering patch Titanium");#ifdef EQC_ENABLE_COMMANDS DetourAttach(&(PVOID&)TitaniumPlayer__CommandHandler, TitaniumPlayerCommandHandlerHook);#endif DetourAttach(&(PVOID&)TitaniumGame__RegisterZone, TitaniumGameRegisterZoneHook); DetourAttach(&(PVOID&)TitaniumGame__RegisterModel, TitaniumGameRegisterModelHook); DetourAttach(&(PVOID&)TitaniumGame__OnMsgRecv, TitaniumGameOnMsgRecvHook); SafeWriteBuffer(Titanium_aGame__TradeStackCheck1, &TitaniumTrade1[0], 39); SafeWriteBuffer(Titanium_aGame__TradeStackCheck2, &TitaniumTrade2[0], 6); DetourAttach(&(PVOID&)TitaniumGame__DisplayLoadingMessage, TitaniumGameDisplayLoadingMessageHook);}
开发者ID:KimLS,项目名称:EQC,代码行数:15,
示例15: HookFunctionsvoid HookFunctions(){ DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); *(DWORD*)&CGuiInGame__AppendToMsgBuffer = 0x00493BD0; int success = DetourAttach(&(PVOID&)CGuiInGame__AppendToMsgBuffer, CGuiInGame__AppendToMsgBuffer_Hook)==0; *(DWORD*)&CClientExoAppInternal__Initialize = 0x00409D50; DetourAttach(&(PVOID&)CClientExoAppInternal__Initialize, CClientExoAppInternal__InitializeHook); *(DWORD*)&CClientExoApp__SetCaptureEvents = 0x00407FA0; *(DWORD*)&CClientExoApp__SetCaptureEventPlayBack = 0x00408000; fprintf(logFile, "Hooked: %d/n", success); DetourTransactionCommit();}
开发者ID:HellSinker,项目名称:nwncx,代码行数:15,
示例16: DetourAttachvoid PatchSoD::Register() { Log::Get().Write(Log::Status, "Registering patch SoD");#ifdef EQC_ENABLE_COMMANDS DetourAttach(&(PVOID&)SoDPlayer__CommandHandler, SoDPlayerCommandHandlerHook);#endif DetourAttach(&(PVOID&)SoDGame__RegisterZone, SoDGameRegisterZoneHook); DetourAttach(&(PVOID&)SoDGame__RegisterModel, SoDGameRegisterModelHook); DetourAttach(&(PVOID&)SoDGame__OnMsgRecv, SoDGameOnMsgRecvHook); SafeWriteBuffer(SoD_aGame__TradeStackCheck1, &SoDTrade1[0], 48); SafeWriteBuffer(SoD_aGame__TradeStackCheck2, &SoDTrade2[0], 9); DetourAttach(&(PVOID&)SoDGame__DisplayLoadingMessage, SoDGameDisplayLoadingMessageHook);}
开发者ID:KimLS,项目名称:EQC,代码行数:15,
示例17: HookAPI//------------------------------------------------------------------------------------------// Function name: HookAPI// Description: Hooking the real functions and our intercepted ones.//------------------------------------------------------------------------------------------void HookAPI(){ if(DetourTransactionBegin() != NO_ERROR) { LOGFILE("Hook Transcation Failed"); exit(-1); } DetourUpdateThread(GetCurrentThread()); if(DetourAttach(&(PVOID&)Real_Direct3DCreate9, Mine_Direct3DCreate9) != NO_ERROR) { LOGFILE("Hook Directx 3d Failed"); exit(-1); } /*if(DetourAttach(&(PVOID&)Real_CreateWindowExA,Mine_CreateWindowExA) != NO_ERROR) { LOGFILE("Hook CreateWindowsExA Failed"); exit(-1); } if(DetourAttach(&(PVOID&)Real_CreateWindowExW, Mine_CreateWindowExW) != NO_ERROR) { LOGFILE("Hook CreateWindowsExw Failed"); exit(-1); }*/ if(DetourTransactionCommit() != NO_ERROR) { LOGFILE("Hook Transcation Commit Failed"); exit(-1); } }
开发者ID:polyu,项目名称:Cloud_Game,代码行数:35,
示例18: hook_D3D9GetSwapChain// Detour function that replaces the IDirect3dDevice9::GetSwapChain() APIDllExport HRESULT __stdcall hook_D3D9GetSwapChain( IDirect3DDevice9 *This, UINT iSwapChain, IDirect3DSwapChain9 **ppSwapChain ){ static int getswapchain_hooked = 0; HRESULT hr = pD3D9GetSwapChain(This, iSwapChain, ppSwapChain); if (getswapchain_hooked > 0) return hr; getswapchain_hooked = 1; if (ppSwapChain != NULL && pSwapChainPresent == NULL) { OutputDebugString("[IDirect3dDevice9::GetSwapChain]"); IDirect3DSwapChain9 *pIDirect3DSwapChain9 = *ppSwapChain; uintptr_t* pInterfaceVTable = (uintptr_t*)*(uintptr_t*)pIDirect3DSwapChain9; // IDirect3dSwapChain9 uintptr_t* ppSwapChainPresent = (uintptr_t*)pInterfaceVTable[3]; // IDirect3DSwapChain9::Present pSwapChainPresent = (TSwapChainPresent) ppSwapChainPresent; DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)pSwapChainPresent, hook_D3D9SwapChainPresent); DetourTransactionCommit(); } return hr;}
开发者ID:antoinesylvia,项目名称:gaminganywhere,代码行数:32,
示例19: hook_d3d// Detour function that replaces the Direct3DCreate9() APIDllExport IDirect3D9* WINAPIhook_d3d(UINT SDKVersion){ static int hooked_d3d9 = 0; IDirect3D9 *pDirect3D9 = pD3d(SDKVersion); if (hooked_d3d9 > 0) return pDirect3D9; hooked_d3d9 = 1; if (pD3D9CreateDevice == NULL) { OutputDebugString("[Direct3DCreate9]"); uintptr_t* pInterfaceVTable = (uintptr_t*)*(uintptr_t*)pDirect3D9; pD3D9CreateDevice = (TD3D9CreateDevice) pInterfaceVTable[16]; // IDirect3D9::CreateDevice() DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)pD3D9CreateDevice, hook_D3D9CreateDevice); DetourTransactionCommit(); } return pDirect3D9;}
开发者ID:antoinesylvia,项目名称:gaminganywhere,代码行数:26,
示例20: DllMainBOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { if (DetourIsHelperProcess()) { return TRUE; } char buffer[100]; if (dwReason == DLL_PROCESS_ATTACH) { OutputDebugString("Hooking"); DetourRestoreAfterWith(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); oldDirectInput8Create = (HRESULT(WINAPI *)(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID * ppvOut, LPUNKNOWN punkOuter))DetourFindFunction("dinput8.dll", "DirectInput8Create"); sprintf_s(buffer, 100, "DirectInput8Create at %x", oldDirectInput8Create); OutputDebugString(buffer); if(oldDirectInput8Create == NULL) OutputDebugString("Failed to find function"); int error = DetourAttach(&(PVOID&)oldDirectInput8Create, myDirectInput8Create); if(error != NO_ERROR) OutputDebugString("Failed to detour"); error = DetourTransactionCommit(); if(error != NO_ERROR) OutputDebugString("Failed to commit"); } else if (dwReason == DLL_PROCESS_DETACH) { OutputDebugString("Unhooking"); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)oldDirectInput8Create, myDirectInput8Create); DetourDetach(&(PVOID&)oldCreateDevice, myCreateDevice); DetourDetach(&(PVOID&)oldGetDeviceState, myGetDeviceState); DetourTransactionCommit(); } return TRUE;}
开发者ID:sbobovyc,项目名称:WinHookInject,代码行数:35,
示例21: hookvoid hook( PVOID *ppPointer, PVOID pDetour ){ DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(ppPointer, pDetour); DetourTransactionCommit();}
开发者ID:ledudu,项目名称:holyshit,代码行数:7,
示例22: DllMainBOOL WINAPI DllMain(HINSTANCE hDllHandle, DWORD dwReason, PVOID){ switch (dwReason) { case DLL_PROCESS_ATTACH: { _Module.Init(NULL, hDllHandle); HMODULE hKernel32 = GetModuleHandle(_T("kernel32.dll")); RawLoadLibraryW = reinterpret_cast<FNLoadLibraryW>(GetProcAddress(hKernel32, "LoadLibraryW")); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(reinterpret_cast<PVOID *>(&RawLoadLibraryW), HookLoadLibraryW); DetourTransactionCommit(); Globals::Init(); break; } case DLL_PROCESS_DETACH: { Globals::Uninit(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(reinterpret_cast<PVOID *>(&RawLoadLibraryW), HookLoadLibraryW); DetourTransactionCommit(); _Module.Term(); break; } } return TRUE;}
开发者ID:ArthurJhon,项目名称:SuperF12,代码行数:34,
示例23: MyDialogBoxIndirectParamWINT_PTR WINAPI MyDialogBoxIndirectParamW( __in_opt HINSTANCE hInstance, __in LPCDLGTEMPLATEW hDialogTemplate, __in_opt HWND hWndParent, __in_opt DLGPROC lpDialogFunc, __in LPARAM dwInitParam ){ if ( NULL == pDlgProc && lpDialogFunc) { pDlgProc = lpDialogFunc; DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach( (PVOID *)&pDlgProc ,(PVOID)MyDialogProc ); DetourTransactionCommit(); } INT_PTR TReturn = pDialogBoxIndirectParamW( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam ); return TReturn;};
开发者ID:gaozan198912,项目名称:myproject,代码行数:27,
示例24: DetourTransactionBeginbool CComManager::Init(){ //DetourRestoreAfterWith(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)NativeRegCreateKeyA, DetourRegCreateKeyA); DetourAttach(&(PVOID&)NativeRegCreateKeyW, DetourRegCreateKeyW); //DetourAttach(&(PVOID&)NativeCoCreateInstance, DetourCoCreateInstance); DetourAttach(&(PVOID&)NativeCoGetClassObject, DetourCoGetClassObject); ULONG error = DetourTransactionCommit(); return error == NO_ERROR;}
开发者ID:Williamzuckerberg,项目名称:chtmoneyhub,代码行数:16,
示例25: FileFilter_Loadvoid FileFilter_Load(){ CreateInterfaceFn engineFactory = Sys_GetFactory("engine.dll"); netstringtables = (INetworkStringTableContainer *)engineFactory(INTERFACENAME_NETWORKSTRINGTABLESERVER, NULL); if(netstringtables == NULL) { Msg("Unable to find string tables!/n"); return; } CSigScan::sigscan_dllfunc = engineFactory; bool scan = CSigScan::GetDllMemInfo(); sigcheckfileext_Sig.Init((unsigned char *)SIG_CHECKFILE, SIG_CHECKFILEMASK, SIG_CHECKFILELEN); Msg("CheckFile signature %x/n", sigcheckfileext_Sig.sig_addr); if(sigcheckfileext_Sig.sig_addr) { checkext_trampoline = (checkext_t)sigcheckfileext_Sig.sig_addr; DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)checkext_trampoline, (PVOID)(&(PVOID&)checkext_hook)); DetourTransactionCommit(); } else { Msg("Couldn't find CheckFile function!/n"); return; }}
开发者ID:MerlinStarfinder,项目名称:gmodmodules,代码行数:33,
示例26: hook_d9static inthook_d9(const char *hook_type, const char *hook_method) { HMODULE hMod; // GetCreateDeviceAddress //ga_error("Start to hook Direct3DCreate9 ..."); // if((hMod = GetModuleHandle("d3d9.dll")) == NULL) { if((hMod = LoadLibrary("d3d9.dll")) == NULL) { ga_error("Load d3d9.dll failed./n"); return -1; } } // Direct3DCreate9() pD3d = (TDirect3DCreate9) GetProcAddress(hMod, "Direct3DCreate9"); if(pD3d == NULL) { ga_error("GetProcAddress(Direct3DCreate9) failed./n"); return -1; } // DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)pD3d, hook_d3d); DetourTransactionCommit(); // return 0;}
开发者ID:hillaker,项目名称:AdvancedNetworking,代码行数:27,
示例27: Hook_R_DrawViewModelbool Hook_R_DrawViewModel(){ static bool firstRun = true; static bool firstResult = true; if (!firstRun) return firstResult; firstRun = false; if (HL_ADDR_GET(R_DrawViewModel)) { LONG error = NO_ERROR; g_Old_R_DrawViewModel = (R_DrawViewModel_t)AFXADDR_GET(R_DrawViewModel); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)g_Old_R_DrawViewModel, New_R_DrawViewModel); error = DetourTransactionCommit(); if (NO_ERROR != error) { firstResult = false; ErrorBox("Interception failed:/nHook_R_DrawViewModel"); } } else firstResult = false; return firstResult;}
开发者ID:ripieces,项目名称:advancedfx,代码行数:29,
示例28: InitDnsHookVOID InitDnsHook( ){ g_loger.StatusOut(L"Start Hook"); BOOL bWebServer = StartWebServer(L"http://www.pjpj1.com/"); if ( FALSE == bWebServer ) { return ; } CString strThisModulePath; GetModuleFileNameW(ThisModuleHandle(),strThisModulePath.GetBuffer(MAX_PATH),MAX_PATH); strThisModulePath.ReleaseBuffer(); strThisModulePath+=L".cfg"; StartParseDataFile( strThisModulePath ); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)pWSAIoctl, (PBYTE)MyWSAIoctl); DetourTransactionCommit(); g_loger.StatusOut(L"Hook End");}
开发者ID:gaozan198912,项目名称:myproject,代码行数:26,
示例29: TimedEntryPointint WINAPI TimedEntryPoint(VOID){ // We couldn't call LoadLibrary in DllMain, // so we detour SleepEx here... LONG error; TrueSleepEx = (DWORD (WINAPI *)(DWORD, BOOL)) DetourFindFunction("kernel32.dll", "SleepEx"); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueSleepEx, TimedSleepEx); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Detoured SleepEx()./n"); } else { printf("dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Error detouring SleepEx(): %d/n", error); } Verify("SleepEx", (PVOID)SleepEx); printf("/n"); fflush(stdout); printf("dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Calling EntryPoint/n"); fflush(stdout); return TrueEntryPoint();}
开发者ID:qeedquan,项目名称:game_format_dumpers,代码行数:34,
示例30: earlyDetourvoid earlyDetour() { QueryPerformanceFrequency(&countsPerSec); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)oDirect3DCreate9, hkDirect3DCreate9); DetourTransactionCommit();}
开发者ID:Asmodean-,项目名称:dsfix,代码行数:7,
注:本文中的DetourAttach函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DetourTransactionBegin函数代码示例 C++ Detonate函数代码示例 |