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

DetourCreateProcessWithDllEx replacement

I am trying to hook detours dll into my application it works but my application launches another exe. I can't attach to that exe because it says launch previous application and closes. What I am trying to ask is, is there something in detours API…
Kachinsky
  • 573
  • 1
  • 7
  • 20
0
votes
0 answers

Detour hook send/recv winsock

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…
Feeh
  • 33
  • 1
  • 5
0
votes
1 answer

Hooking kernel32.dll function stops my program from working

Do you know why I can't run the program when hooking one of kernel32 functions? I'm writing anti cheat and want to optimize it more because currently it's in thread, but something is wrong... There's written OpenProcess because I've tried before to…
deepspace
  • 771
  • 3
  • 11
  • 25
0
votes
0 answers

PBYTE to PVOID error

I'm currently programming in Detours Express 3.0. I've first had some problems finding out how to use Detours, for example, I didn't know, that DetourFunction() was replaced with DetourAttach(). So, now I found it out, but somehow it still doesn't…
0
votes
2 answers

c++ Injected DLL vars getting corrupted

I'm currently trying to add some functionality to a basic server application by injecting a DLL and detouring several functions and I'm having a problem with a stored IP address getting corrupted in-between 2 calls. First I detour 'accept' and parse…
Twisted89
  • 406
  • 5
  • 14
0
votes
2 answers

Detoured function not being called

I'm using visual studio 2003 with CDetour. This time I cannot give a SSCE so this is what I've done: LPDIRECT3D9 d3d; LPDIRECT3DDEVICE9 d3ddev; CDetour CreateDevice_Det; IDirect3D9* Direct3DCreate9_Hook( UINT SDKVersion ) { MessageBox(…
Vinícius
  • 15,498
  • 3
  • 29
  • 53
0
votes
1 answer

Why does API hooking ExtTextOut and DrawText in C++ only output rubbish?

I am trying to make an API hook using Detour to extract the text output from a third party program. However, I only get rubbish, alot of numbers and no text output. Exactly when are these functions called? Are they called to draw other stuff than…
Euklides
  • 564
  • 1
  • 10
  • 35
0
votes
1 answer

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

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…
Euklides
  • 564
  • 1
  • 10
  • 35
0
votes
2 answers

Detours 3.0 hook GetProcAddresss()

I'm using: MS VS 10 Detours v3.0 Express The complete source code DLL: #include #include ofstream prclist ; #pragma comment(lib,"detours.lib") FARPROC (WINAPI * pGetProcAddress)(HMODULE hModule,LPCSTR lpProcName) =…
NORM_4EL
  • 145
  • 1
  • 1
  • 13
0
votes
1 answer

Converting integer memory address to static member function pointer

Im trying to detour a member function in a binary executable. I only know the function signature and the VA of the method. With the help of the 'method' sample, included in Detours Express 3.0, I came up with this: class Detour { public: void…
grasshopper
  • 31
  • 1
  • 2
0
votes
1 answer

Hooking Api with Detours crashes on Detach

iam trying to hook NtQueryVolumeInformationFile with detours by injecting a .dll into the explorer.exe. It works fine until i try to eject the dll. After ejecting the .dll, the explorer.exe crashes. OS: Windows 7 32bit Compiler: Visual Studio 2012…
Mike Hawk
  • 1
  • 1
0
votes
2 answers

C++ - Pointer to a class method

I have to set up a pointer to a library function (IHTMLDocument2::write) which is a method of the class IHTMLDocument2. (for the curious: i have to hook that function with Detours) I can't do this directly, because of type mismatch, neither can I…
zakk
  • 375
  • 1
  • 4
  • 14
0
votes
1 answer

Reading data from within a function with detours DLL hook

I was wondering if it is possible to read data from with in the function. I know I can use detours to hook functions and change the parameters freely. But that's all I understand with using detours. For example: //cryptkeys typedef int (WINAPI…
zikdaljin
  • 95
  • 2
  • 5
  • 14
0
votes
3 answers

Prevent winsock injection with MS detours

I have read a code somewhere that promises it can protect an applications Winsock functions from packet editors. I run a game server and this is really good news for me. But is this really possible? Like adding an DLL with the use of detours to my…
madziikoy
  • 1,447
  • 7
  • 22
  • 32
0
votes
0 answers

CopyFile2 not getting detoured

I am stuck. For some reason, I need to block Copy feature of the file system on Windows 8. Till Windows 7, ShFileOperation & CopyFile used to do trick. However, with Windows 8, as I could scan through API monitor, a new API: CopyFile2, has been used…
VarunPandey
  • 327
  • 1
  • 12