Questions tagged [detours]

This tag is about the Microsoft Detours library for intercepting arbitrary Win32 binary functions on x86, x64, and ARM machines.

Detours is a library for intercepting arbitrary Win32 binary functions on x86, x64, and ARM machines.

245 questions
0
votes
1 answer

Is there a way to detour a c++ constructor?

Funny thing is, I answered a question not too long ago about getting the address of a C++ constructor saying that it can't be done so use perfect forwarding instead. However, in terms of detouring using Microsoft's Detour library, this isn't an…
Adrian
  • 10,246
  • 4
  • 44
  • 110
0
votes
1 answer

DetourAttach success but no functions hooked :(

Good morning ! I have recently read articles quite interesting about hooking functions, I have followed one or two tutorials but it never seems to work, I am using Detoured and here is the full code which seems to me perfectly normal :( #include…
coldZou
  • 1
  • 1
0
votes
0 answers

C++ Simple Detours Crashes Target

I have this function type from IDA that I am trying to detour: int CTeamInfo__GetNumConnectedClients() so I have the following code into a C++ DLL: The Original Function: int(__stdcall * CTeamInfo__GetNumConnectedClients)() =…
CheekyLewb
  • 13
  • 4
0
votes
1 answer

C/C++ Detours Library - where to find?

I came to a piece of code that includes "HookEngine/CDetours.hpp", search for a bit of info and came ot that is Microsoft Project, but i cant find what i'm looking for. I downloaded the Express Edition but this ediotion doesn't contain the…
Anonymous
  • 63
  • 1
  • 4
0
votes
0 answers

Read and change global std::map in executable through injected dll

I have dll injected into executable with a few function hooks installed. Executable has global std::map variable, declared as std::map g_lenMap; I know it's address from the disassembly. I need to insert key/value pair into this map (or…
splattru
  • 608
  • 1
  • 9
  • 19
0
votes
2 answers

WSARecv hook: prevent packet from being recieved by the executable

I am working on dll which hooks winsock2 functions, using C++ and detours. My goal is to modify TCP traffic that goes from and to the original executable. At some point, I need to stop certain packet delivery (so that original executable has no idea…
splattru
  • 608
  • 1
  • 9
  • 19
0
votes
1 answer

How can I change text that is read via ReadFile function

How can I change text that is read via ReadFile function? I'm using detour to hook ReadFile functions calls. It works ok (I think so because of debug message boxes), but I can't change text that is read from the file. static BOOL(WINAPI *…
FrozenHeart
  • 19,844
  • 33
  • 126
  • 242
0
votes
0 answers

Hook to extract text from Windows Explorer

I am trying to hook in to draw text API of Windows (DrawTextW,ExtTextOutW) to get the text but I can't get the text location correctly in address bar of Windows Explorer Seems it has specific way in drawing. Anyone knows how it draws? Please…
duongkha
  • 71
  • 6
0
votes
1 answer

Hook functions with no target DLL

I am writing an analysis tool for an exe. I have the source code of this exe so I know which functions it uses. I need to hook a couple of specific functions so that I can inspect the passed parameters. The functions I am interested are not part of…
N3d
  • 1
0
votes
1 answer

detours hooked CreateFile function triggers stack overflow

When I was trying to use Detours in order to hook CreateFile, when my hooked function is called I get a stack overflow error. I am trying to write the filename to a file and then call the original, but it fails on the fopen call with a stack…
0
votes
1 answer

Detours 3.0 Hook Crashes MessageBoxA

I'm trying to hook the MessageBoxA function with MS Detours 3.0 but when I try it my program crashes. I'm not sure what is causing the program to crash. When i run the test program and hit shift the message box appears, but when I inject the dll…
0
votes
1 answer

Blocking packets in detoured WSASend

So I have WSASend detoured, and of course can call it to have everything work normally, but some packets (after I analyze them) I want to prevent from being sent, so I can't call the original function. The calling code seems to know something's gone…
LemoniscooL
  • 95
  • 1
  • 6
0
votes
0 answers

Unable to check dll injection and debug-MS detours

I had written a file monitor using ms detours.i have to hook file related calls like creatfile,readfile in any targetexecutable and collect stats from those calls. I have an injector void CFileStat::MonitorProcess() { int…
0
votes
0 answers

Hooking with DLL/ASI

Good afternoon all, I have a slight problem. I'm using Microsoft Detours 3.0 to hook a game, call my function and change some data. Now, When I load the game, it's like my ASI file doesn't even exist. Now, I'm wondering weather this is because I'm…
0
votes
2 answers

Require specific event completion before application launch

I'm working on an application (DLL) that logs specific WIN32 calls using Detours. It is injected into a target application that passes the filter. It has to absolutely log every call that the application makes, starting from the first instruction in…
Bart Pelle
  • 747
  • 1
  • 5
  • 18