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
2
votes
1 answer

mftrace: CMFStreamSinkDetours::GetEvent seems not not work

I have weird problem when tracing my Media Foundation application using mftrace: when running in mftrace, the application crashes with an access violation. It is running from the Visual Studio debugger, but I need to get mftrace running to…
Christoph
  • 1,964
  • 2
  • 27
  • 44
2
votes
2 answers

Building 32-bit Detours library

I'm using Detours library from microsoft, and I was using the 32bit version (which is free). I'm now on a 64-bit installation of windows 7 and I can't seem to compile Detours with nmake. Here is the error: Microsoft (R) Program Maintenance Utility…
David Menard
  • 2,261
  • 3
  • 43
  • 67
2
votes
0 answers

detours hook memcpy dont work program stop working

when i inject this dll to program, the program crash when meet function memcpy. I want to hook function memcpy with detours. Please Help. #include #include #include "detours\detours.h" #pragma comment( lib, "msvcrt.lib"…
lukas kiss
  • 381
  • 2
  • 15
2
votes
2 answers

Why does using a function pointer to call a function bypass the hook?

Using the Microsoft Detours library, I've written the following simple code: #include #include #include void RealFunc(int num) { printf("RealFunc %d\n", num); } void(*RealFuncPtr)(int) = &RealFunc; void…
2
votes
1 answer

Why is Detours lib not working on virtual methods?

I'm trying to intercept the construction/destruction of every object on my system. For this I'm using Detours Lib to create the runtime patch. It seem to work the some way as FastCode approach does. And I think it should have the same limitation…
Rodrigo Farias Rezino
  • 2,687
  • 3
  • 33
  • 60
2
votes
1 answer

Detours - jmp 00000000

This is the code I'm using: #include #include #include #include #include #define real_sendto 0x152942C6 void(__cdecl* originalFunction)(); void tompa_sendto() { printf("Hellooo"); …
Tompina
  • 726
  • 1
  • 9
  • 25
2
votes
3 answers

What does DetourAttach(&(PVOID &)BindKeyT, BindKeyD); mean? Attaching a detour to a memory address

This is just a simple question. I've been reading the source of something which attaches to a memory address of a subroutine using DetourAttach(&(PVOID &)BindKeyT, BindKeyD); where BindKeyT is the address to a subroutine in memory. I'm curious, what…
Gbps
  • 857
  • 2
  • 14
  • 29
2
votes
1 answer

Why does the DirectX Device Present hook not work in detours?

I am creating a hook which will allow to hook the Present method from the Direct X 9 device, I do this as follow: #include #include #include #include #pragma comment( lib, "d3d9.lib" ) typedef…
Gizmo
  • 1,990
  • 1
  • 24
  • 50
2
votes
1 answer

Is it possible to override a Java implementation of the Random class?

Using Windows Detours in C++, I've seen that it is possible to trampoline function calls so that you may intercept windows base functionality and return custom resultsets, without modifying the original function call. I was wondering if there is…
George Johnston
  • 31,652
  • 27
  • 127
  • 172
2
votes
2 answers

Error 0xc000007b When trying to inject a DLL with detours

I'm trying to inject a DLL to a new process using the latests 32 bit Detours library. http://research.microsoft.com/en-us/projects/detours/ It worked for me in the past but after a change in the DLL, it stopped working for all processes. When I…
shoosh
  • 76,898
  • 55
  • 205
  • 325
2
votes
2 answers

Can malloc cause a crash when detouring a function in C++ to copy a data string from ExtTextOut in a target process?

I am trying to make a detour using MSDN Detours 3.0 to register text drawn by ExtTextOut() from a third party software. I have created a DLL which I inject in the target software. When I detour ExtTextOut I try to copy the string sent to the method…
Euklides
  • 564
  • 1
  • 10
  • 35
2
votes
1 answer

C++ Detours 3.0 express on MVS 2012 error "identifier not found"

My compiler: Microsoft Visual Studio 2012. My code is functional on detours 2.1 but I can't compile it with my compiler anymore (module unsafe for SAFESEH image.). I need to use an older compiler like MVS2005 but I'd rather not. So I need to…
madziikoy
  • 1,447
  • 7
  • 22
  • 32
2
votes
3 answers

Detouring DrawText

I've downloaded and compiled the Microsoft detouring library. Inside my project I've included the header file and added the .lib file as a dependency. Everything compiles without errors. Now I've been trying to detour DrawText, but for some reason…
Kasper Holdum
  • 12,993
  • 6
  • 45
  • 74
2
votes
1 answer

Simple packet logger with Detours 3.0 Express

My system: Microsoft Windows XP Professional 32-bit IDE/Compiler: Microsoft Visual C++ 2010 Express Edition Library: Detours 3.0 Express Target: Write simple packet logger. My code: mydll.cpp #include #include #include…
David
  • 417
  • 1
  • 9
  • 18
2
votes
2 answers

Questions regarding detouring by modifying the virtual table

I've been practicing detours using the same approach as Microsoft Detours (replace the first five bytes with a jmp and an address). More recently I've been reading about detouring by modifying the virtual table. I would appreciate if someone could…
Elliott Darfink
  • 1,153
  • 14
  • 34