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

Hooking with MS Detours crash when hook function is called C++

I wrote a simple program that does 3 things: It calls MessageBoxA (MBA) with the text "NOT HOOKED" Then it loads a dll file that I've created that hooks the MBA function and recalls MBA with the text "HOOKED". After that, it calls MBA again with the…
Elyasaf755
  • 2,239
  • 18
  • 24
0
votes
0 answers

Hooking Direct Input

INTRODUCTION There's this old fullscreen 800x600 or windowed mode online game binary I would like to make a new GUI for, using C++. I haven't got its source code. Same interface yet scaled to occupy most of the screen as fullscreen while avoiding…
0
votes
2 answers

Microsoft Detours: missing macro

I need help for a project that uses Microsoft Detours. Premise: I am trying to use a class I found in a project on CodeProject that uses the Detours library. I downloaded the latest version of Detuors from Github and recompiled it, but I can't find…
pallagommosa
  • 558
  • 7
  • 15
0
votes
0 answers

How to replace (hook) a Windows function with a custom one using MS Detours?

I'm a student and just learned about hooking with MS Detours. DESCRIPTION: I wanted to replace some Windows functions for writing and changing text inside windows, titles etc. like a TextOutW() function The TextOut() function writes a character…
user11551902
0
votes
1 answer

Can you use Detours in an exe?

I want to replace the LoadLibrary functions to prevent the loading of blacklisted dlls that might be injected. I copied the sample code from _win32.cpp for the LoadLibrary functions I will need. I used LoadLibraryW, LoadLibraryExW, LoadLibraryA and…
0
votes
0 answers

How to rewrite executable's assembly thread safe?

My intent is to make it possible to rewrite function start assembly (.text) in a thread safe manner. The problem is that I cannot be sure other threads are not in the very beginning of the function while it is being rewritten. I write about 5 first…
NuPagadi
  • 1,410
  • 1
  • 11
  • 31
0
votes
1 answer

Hooking non windows api function with detours

I want to hook a non windows api function in an executable (one time - not permanent), I found the function address (0x2bf2ca5) using a debugger , I'm using the following code: #define _CRT_SECURE_NO_WARNINGS #include #include…
0
votes
1 answer

MS Detours - DetourAttach fails

Feeling stupid here but why is this code giving me a syntax error in Visual Studio when trying to compile it? DetourAttach(&(PVOID&)true_create_file, create_file); The compiler complains with (underlining the & after PVOID) Error (active) …
user3700562
  • 693
  • 11
  • 23
0
votes
1 answer

C++ and Detouring

So I started learning c++ the last few days as I wanted to get into a bit of game hacking and reverse engineering. I tried my luck with the basic detour method by just inserting a jmp to my function in my target programs memory which worked fine.…
Malte
  • 111
  • 10
0
votes
1 answer

C++ hooking Member function and original function returns garbage value.

I want hook class member function(using dll injection). for now, hooking is success. but in hooking function, I coded that calling original function with return. as result, original function return garbage value. what wrong with my…
임근영
  • 193
  • 1
  • 3
  • 14
0
votes
0 answers

Detoured function crashes

thank you for taking your time to read this. I am trying to read an udp bitstream from a program, just for fun and for gaining knowledge which may be usefull for others later on. I found…
0
votes
0 answers

Global hooking of registry using Delphi detours in C++ Builder

I am trying to use Detours to hook registry calls using global hooks i use this code but it keeps on giving me exception when i run other C++ Builder apps. I don't know what exactly should I pass to SetWindowsHookEx as hook type. The idea here is…
0
votes
1 answer

Hooking/Detouring d3d9 (Present/EndScene) - Seems to call my function then crashes

As the title says, i'm trying to hook DirectX 9 V-Table and show some information on screen, I've been studying detours and hooking for a couple days now and i thought i understood it to a fair extent, but now i'm not too sure how to debug this…
Michael Strobel
  • 367
  • 5
  • 16
0
votes
0 answers

Detours Hook FindNextFileW Hang

When hooking FindNextFileW with Detours I can not modify the returned entry without the process hanging. I am attempting to create a shim that exposes an archive as a folder on the filesystem. The same thing happens when I set…
gudenau
  • 500
  • 5
  • 19
0
votes
2 answers

Why does Gplmpgdec (GPL MPEG-1/2 DirectShow Decoder Filter) override / detour IsDebuggerPresent?

In Mpeg2DecFilter.cpp the following code is present: #include "detours.h" DETOUR_TRAMPOLINE(BOOL WINAPI Real_IsDebuggerPresent(), IsDebuggerPresent); BOOL WINAPI Mine_IsDebuggerPresent() { TRACE(_T("Oops, somebody was trying to be naughty!…