detours

My trampoline won't bounce (detouring, C++, GCC)

六眼飞鱼酱① 提交于 2019-12-06 06:51:59
It feels like I'm abusing Stackoverflow with all my questions, but it's a Q&A forum after all :) Anyhow, I have been using detours for a while now, but I have yet to implement one of my own (I've used wrappers earlier). Since I want to have complete control over my code (who doesn't?) I have decided to implement a fully functional detour'er on my own, so I can understand every single byte of my code. The code (below) is as simple as possible, the problem though, is not. I have successfully implemented the detour (i.e a hook to my own function) but I haven't been able to implement the

Having trouble with microsoft detours

只愿长相守 提交于 2019-12-04 20:24:25
I'm trying to do some basic hooking with microsoft detours and I can't get it to work. I've used essentially the code that was posted in this thread: How can I hook Windows functions in C/C++? but no dice. I updated the send/receive functions in the DLL code to simply log the data to a file, and I tried having the main program hook into the "internet checkers" program, but a log file never gets created, so it appears that the dll wasn't injected. I'm running Windows 7 64-bit, Visual Studio 10.0, Detours 3.0 (my environment appears to be set up correctly, no issues building or anything). I

Detouring a member-function via an injected DLL

a 夏天 提交于 2019-11-30 23:06:46
Original Post: I'm trying to detour a member-function from within my injected DLL. I've got the address of the function I'm trying to hook, but cannot figure out the proper syntax or way about hooking it via detours library. I've commented the line that's giving me the error with the error message. I've read the source for the detours example of member-function hooking and that's what this code is based upon, but for some reason it's not working. Any help would be much appreciated, thanks! #include <windows.h> #include <detours.h> class CDetour { public: bool My_MemFn(unsigned int unk1);

How to hook __usercall, __userpurge (__spoils) functions?

ぐ巨炮叔叔 提交于 2019-11-30 19:04:43
问题 Know anybody something about hooking __usercall type of functions? I hooking successfully __thiscall , __stdcall and __cdecl calls but this is enough for me. Know anybody hooking library for __usercall 's or how to hook this type of functions using translation to __stdcall or __cdecl ? Function what i must hook at first is: int __usercall func<eax>(int a<eax>, int b<ecx>, int c, unsigned int d, signed int e); 回答1: Use a wrapper which will convert it to __stdcall . int __stdcall func_hook

Detouring a member-function via an injected DLL

我是研究僧i 提交于 2019-11-30 18:29:04
问题 Original Post: I'm trying to detour a member-function from within my injected DLL. I've got the address of the function I'm trying to hook, but cannot figure out the proper syntax or way about hooking it via detours library. I've commented the line that's giving me the error with the error message. I've read the source for the detours example of member-function hooking and that's what this code is based upon, but for some reason it's not working. Any help would be much appreciated, thanks!

Detours alternative for Registry interception

荒凉一梦 提交于 2019-11-30 07:31:07
I'm looking for a way to intercept and redirect reads to a certain registry keys. Naturally, Detours can do it. But I need it for a commercial application and MS $10K license fee is a bit too steep. Are there any alternatives ? Madshi's madCodeHook is what you're looking for. The EasyHook Library might be what you are looking for. It is licensed under LGPL and its description sounds quite nice. I have never actually used it myself because Detours was always enough for my private projects. There is also an article about it on CodeProject but that is rather old and shows only .NET examples. You

How does Microsoft Detours work and how do I use it to get a stack trace?

好久不见. 提交于 2019-11-28 03:12:52
I am new to Microsoft Detours. I have installed it to trace the system calls a process makes. I run the following commands which I got from the web syelogd.exe /q C:\Users\xxx\Desktop\log.txt withdll.exe /d:traceapi.dll C:\Program Files\Google\Google Talk\googletalk.exe I get the log file. The problem is I don't fully understand what is happening here. How does detours work? How does it trace the system calls? Also I don't know how to read the output in log.txt. Here is one line in log.txt 20101221060413329 2912 50.60: traceapi: 001 GetCurrentThreadId() Finally I want to get the stack trace of

How does Microsoft Detours work and how do I use it to get a stack trace?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 05:05:20
问题 I am new to Microsoft Detours. I have installed it to trace the system calls a process makes. I run the following commands which I got from the web syelogd.exe /q C:\Users\xxx\Desktop\log.txt withdll.exe /d:traceapi.dll C:\Program Files\Google\Google Talk\googletalk.exe I get the log file. The problem is I don't fully understand what is happening here. How does detours work? How does it trace the system calls? Also I don't know how to read the output in log.txt. Here is one line in log.txt