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
2 answers

Problem trying to detour function with assembly

Just for the fun of it, I am trying to make a simple detouring library that will detour member functions by modifying the vtable of the class to create a detour. I am getting some odd behaviour. Here is the entire program (I am using MSVC++…
James Way
  • 15
  • 1
  • 4
0
votes
1 answer

How to properly use DetourRemove?

I'm trying to hook the recv() function and that works perfectly. It's not shown here, but the hooked function prints what it recieves into the console. Now, I'm trying to unhook the function on a keypress, but it obviously doesn't work since new…
SoLux
  • 162
  • 1
  • 9
0
votes
1 answer

exported library hook with QWidget::find() doesn't working

I have a QT hook.dll library which injected in 3rd party application with detours.dll. And if i adding QWidget::find() method to hook.cpp, then i getting DllNotFoundException in process of installing this hook. Else if i don't add QWidget::find()…
0
votes
1 answer

How to Compile Detours Express 3.0

Whenever I try to compile Detours Express 3.0 I always get the error code 0x2. I referred to this thread How to build Microsoft Detours Express Version 3.0?. But my problem is still occurring. Not exactly sure what's causing the problem I'm assuming…
Maelstorm
  • 49
  • 2
  • 11
0
votes
2 answers

How do function detour packages circumvent security

I am looking at some code that uses a function detour package called DetourXS. My application is targeted for Microsoft Server operating systems. Microsoft Research also has a Detours package and they have an article on how it works. They patch the…
LotusPetal
  • 111
  • 2
  • 5
0
votes
1 answer

Trying to do DetourAttach but cannot convert my lua function's datatype to LPVOID

So this is how my function actually looks like DetourAttach(&(LPVOID&)lua_tolstring, (PBYTE)tostring); lua_tolstring is const char* and LPVOID gives me this error. typedef void* LPVOID invalid type conversion How can i make this work?
0
votes
2 answers

Using Microsoft Detours - bunch of undefined's

I tried searching the compiler errors on google, but it didn't even return a search result. So, i'm a little lost here. I just downloaded microsoft detours, built it and got the detours.h, detours.lib, detoured.lib, and detoured.dll files from it.…
Gogeta70
  • 881
  • 1
  • 9
  • 23
0
votes
1 answer

How to build Microsoft Detours Express Version 3.0?

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…
Vera
  • 171
  • 2
  • 12
0
votes
2 answers

C++ Reading values of LPCVOID pointer

I have a hook on kernel32.dll's Writefile command. The hook is being triggered, however, I am not able to read the buffer contents. Goal: Msgbox shows the contents of the buffer being sent to the com port. Issue: The msgbox is printing a…
user1698144
  • 754
  • 4
  • 13
  • 36
0
votes
0 answers

Detour functions for third party software

I am interested in having a multiplatform solution to hook/detour functions (internal and external symbols) for third party software on a multiplatform environment (Windows, Linux, AIX, Solaris and HPUX). I already have the solution implemented for…
Eytan Naim
  • 159
  • 14
0
votes
0 answers

Detours 3.0: Hook all exports in a dll

I'm currently having issues figuring out what calls an application is making, and was thinking of implementing a way to hook all of the exports inside of a dll, for example user32.dll, instead of having to hook them one by one in hopes of hooking…
Bcmonks
  • 21
  • 9
0
votes
1 answer

Why is the process crashing when attempting to detour a winapi?

I'm trying to use MS detours, and I don't know if I am doing something wrong; I cannot seem to find an answer to my issue. I have tried detouring several functions in a process using my injected DLL, but each attempt causes the process to crash. One…
MikeO
  • 391
  • 4
  • 17
0
votes
1 answer

Recovering Detoured Library Functions

The question is fairly straight forward, what I'm trying to do is restore my process' detoured functions. When I say detoured I mean the usual jmp instruction to an unknown location. For example, when the ntdll.dll export NtOpenProcess() is not…
Srdja Nikolic
  • 53
  • 1
  • 8
0
votes
0 answers

'Expression must be a modifiable lvalue' when using DetourFunction()

I am learning about detouring functions using Detours 1.5. I have made a target executable which contains this function float myFunction(int a) { cout << "The function argument value is " << a << std::endl; return…
user6247414
0
votes
1 answer

Detours crashes with wglMakeCurrent

I am using Detours on my project in order to save the GL Context of a Window. So I have followed the code sample that comes with Detours 3.0 Express Edition: static BOOL (WINAPI * trueWglMakeCurrent)(HDC, HGLRC) = wglMakeCurrent; BOOL WINAPI…
gibertoni
  • 1,368
  • 12
  • 21