detours

How to use DetourAttach() for a pointer to a function in hex?

淺唱寂寞╮ 提交于 2021-01-29 20:53:37
问题 I am trying to make a tutorial using the detour library. In older version of the detour library v1.5 the function DetourFunction was used to define the address so the DLL knows where to look for the function. It could for example be used as follows: InsertDateTime = (int (__stdcall*)(int))DetourFunction((PBYTE)0x01006F10, (PBYTE)MyInsertDateTime) see http://www.moddb.com/groups/ibepex/tutorials/function-hooking However in newer versions the function is changed to LONG DetourAttach( PVOID *

c++ d3d hooking - COM vtable

江枫思渺然 提交于 2020-01-02 08:48:09
问题 Trying to make a Fraps type program. See comment for where it fails. #include "precompiled.h" typedef IDirect3D9* (STDMETHODCALLTYPE* Direct3DCreate9_t)(UINT SDKVersion); Direct3DCreate9_t RealDirect3DCreate9 = NULL; typedef HRESULT (STDMETHODCALLTYPE* CreateDevice_t)(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface); CreateDevice_t RealD3D9CreateDevice = NULL; HRESULT

Hooking GetTickCount with C++

一曲冷凌霜 提交于 2020-01-02 05:46:14
问题 I'm not great at C++, more of a C# and PHP guy. I've been assigned a project that requires me to use GetTickCount and hooking into an application. I need some help as for some reason it's not working as planned... Here is the code for hooking, I know it works because i've used it in projects before. The only thing i'm not so sure about is the GetTickCount part of it. I tried GetTickCount64 thinking that was a fix to my problem (It didn't crash what i was injecting it into) but found out that

Can I redirect .NET method calls to a new method at runtime?

泄露秘密 提交于 2019-12-30 10:10:53
问题 Suppose I have the following .NET classes: public class C { public void M() { .... } } and public class D { public void N() { .... } } These 2 classes reside in different namespaces, in different assemblies. Is there a way to cause all call to C.M() to 'redirect' automatically to D.N() ? So, the calling method things its invoking C.M , but in reality, D.N is what actually gets called, with any parameters that C.M would have taken. It doesn't matter if this happens for all instantiations of

Using detours for hooking writing text in notepad

时光怂恿深爱的人放手 提交于 2019-12-24 09:57:17
问题 I'm trying to use detours to hook text output for example in notepad. I wrote the following code. I will not put here all code, but the most significant parts. DLL part: DLLEXPORT LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode < 0) { return CallNextHookEx(0, nCode, wParam, lParam); } if (nCode == HCBT_ACTIVATE) { HWND hWnd = (HWND)wParam; TCHAR szTemp[255]; GetWindowText(hWnd, szTemp, 255); DetourTransactionBegin(); DetourUpdateThread(hWnd); DetourAttach(&(PVOID

Detours alternative for Registry interception

被刻印的时光 ゝ 提交于 2019-12-18 12:36:34
问题 I'm looking for a way to intercept and redirect reads to a certain registry keys. Naturally, Detours can do it. But I need it for a commercial application and MS $10K license fee is a bit too steep. Are there any alternatives ? 回答1: Madshi's madCodeHook is what you're looking for. 回答2: The EasyHook Library might be what you are looking for. It is licensed under LGPL and its description sounds quite nice. I have never actually used it myself because Detours was always enough for my private

Detours alternative for Registry interception

痞子三分冷 提交于 2019-12-18 12:36:07
问题 I'm looking for a way to intercept and redirect reads to a certain registry keys. Naturally, Detours can do it. But I need it for a commercial application and MS $10K license fee is a bit too steep. Are there any alternatives ? 回答1: Madshi's madCodeHook is what you're looking for. 回答2: The EasyHook Library might be what you are looking for. It is licensed under LGPL and its description sounds quite nice. I have never actually used it myself because Detours was always enough for my private

Hooking usercall function?

橙三吉。 提交于 2019-12-13 02:39:11
问题 I have a virtual machine, which on VM_Create passes the address of a function (systemCalls) to the virtual machine. So I hook VM_Create and steal the syscalls address, put it into a backup function pointer, and the address of my modified systemCalls function pass to the original VM_Create, from which I can alter arguments, add or remove calls, and then call the backed-up syscalls function. That worked well, until a new release of the game. I believe to have found the problem: This is the

How to build Microsoft Detours Express Version 3.0?

心已入冬 提交于 2019-12-12 04:32:21
问题 I'm trying to build detours library, and I encountered some problems that I did not succeeded to solve. I ran on Windows 7 and 10 64bit, Visual Studio 2015. I tried in all possible command prompts( WOW64/ VS), ran vcvarsall.bat/vcvars32.bat. Please find attached the errors that I've got. Is there any other way to do it? or what could be the problem? Thanks. 回答1: Since the Detours Express only supports 32-bit processes, some of the files, such as disolx64.cpp and disolarm.cpp , cannot be

Detour hook send/recv winsock

孤街浪徒 提交于 2019-12-12 03:54:31
问题 Im trying to hook the send/recv functions from Ultima Online client usinf MS Detour. I've found a c++ dll/injector source out there, but it is not working. The dll is injected but the functions is not being hooked. When the injector start the client, the dll throw 3 box saying that it was injected and hooked both recv/send, but nothing happens when the client start the comminication injector.cpp #include <windows.h> #include <detours.h> #include <cstdio> #pragma comment(lib,"detours.lib") int