Search found 33 matches

by TCS
Fri Sep 23, 2016 7:55 pm
Forum: madCodeHook
Topic: Hooking a function without knowing its signature
Replies: 2
Views: 4387

Hooking a function without knowing its signature

Hey everyone, I want to make a small application for a research that hooks functions that I don't know their signature and simply trace the parameters of a predefined stack size. I was thinking of making my replaced function an ellipsis function, but than, how would I make the call to the original f...
by TCS
Wed Mar 30, 2016 8:27 pm
Forum: madCodeHook
Topic: UnHookCode causes access violation
Replies: 7
Views: 7158

Re: UnHookCode causes access violation

Also, I've use an IPC mechanism I have to try and unhook before the dll main (before uninjecting the libraries) and it still crashes.
by TCS
Wed Mar 30, 2016 3:08 pm
Forum: madCodeHook
Topic: UnHookCode causes access violation
Replies: 7
Views: 7158

Re: UnHookCode causes access violation

Sending by mail...
by TCS
Wed Mar 30, 2016 6:42 am
Forum: madCodeHook
Topic: UnHookCode causes access violation
Replies: 7
Views: 7158

Re: UnHookCode causes access violation

no...
by TCS
Tue Mar 29, 2016 10:47 am
Forum: madCodeHook
Topic: UnHookCode causes access violation
Replies: 7
Views: 7158

Re: UnHookCode causes access violation

1. I do use the latest version. btw, is there a way to verify what is the installed version?

2. I did not succeed in reproducing it on a small scale demo, and I don't have the source code. I can try and produce a dump if you like.
by TCS
Tue Mar 29, 2016 9:37 am
Forum: madCodeHook
Topic: UnHookCode causes access violation
Replies: 7
Views: 7158

UnHookCode causes access violation

Hey, This is somewhat continuation of "Unhooking on process destroy and manual uninject issues" thread. In the PROCESS_DETACH I am unhooking all the hooks using UnHookCode(). In case the hooks have been unhooked before PROCESS_DETACH the UnHookCode() function simply fails. The problem is t...
by TCS
Sat Feb 27, 2016 8:32 pm
Forum: madCodeHook
Topic: Unhooking on process destroy and manual uninject issues
Replies: 9
Views: 9773

Re: Unhooking on process destroy and manual uninject issues

1. Okay, I'll move FinalizeMadCHook to be the last thing in the DLL_PROCESS_DETACH (that means that manual unhook will actually perform the unhooking).
2. I will try to reproduce it in a small project
3. No I don't
by TCS
Wed Feb 24, 2016 12:43 pm
Forum: madCodeHook
Topic: Unhooking on process destroy and manual uninject issues
Replies: 9
Views: 9773

Re: Unhooking on process destroy and manual uninject issues

I do call it, but I am calling it after the cleanup. I'll call it first.
I will also call the unhook manually (just to be sure....)

The current workaround works fine for me.

Do you want me to help out debugging the auto-unhook? Its pretty easy for me to reproduce....
by TCS
Sun Feb 21, 2016 3:03 pm
Forum: madCodeHook
Topic: Feature req - call a function before/after un/injection
Replies: 1
Views: 3887

Feature req - call a function before/after un/injection

Hey, I have a feature request, calling an exported function in the injected DLL after successful injection (not in DLL_PROCESS_ATTACH context) another exported function before DLL_PROCESS_DETACH during the uninject process. This will make the initialization and cleanup process easier. Of course we i...
by TCS
Sun Feb 21, 2016 12:53 pm
Forum: madCodeHook
Topic: Unhooking on process destroy and manual uninject issues
Replies: 9
Views: 9773

Re: Unhooking on process destroy and manual uninject issues

An update: If I uninstall myself during DLL_PROCESS_DETACH it does work (tried 3 times, but looks okay so far). The point is that it in some applications the functions are getting cleaned-up successfully, so UnhookCode() fails with GetLastError()==0 (my last question). So my current workaround is to...
by TCS
Sun Feb 21, 2016 12:18 pm
Forum: madCodeHook
Topic: Unhooking on process destroy and manual uninject issues
Replies: 9
Views: 9773

Re: Unhooking on process destroy and manual uninject issues

Hey,
Sorry it took me a few days.

I am sure that the hooks have not been removed before DLLMain() with DLL_PROCESS_DETACH.
I am hooking CoCreateInstance(), in the DLL_PROCESS_DETACH I called CoCreateInstance() and it reached my hooked function.

So what is the next step of debugging this ?
by TCS
Thu Feb 18, 2016 2:14 pm
Forum: madCodeHook
Topic: Unhooking on process destroy and manual uninject issues
Replies: 9
Views: 9773

Re: Unhooking on process destroy and manual uninject issues

2. When I wrote I uninject manually I meant using "UninjectAllLibraries()" function. Sorry, I thought it goes through the driver. I will recheck again, but I am pretty sure. I *sometimes* get a create when CoCreateInstance() (my CoCreateInstance) is being called. I just thought that I can ...
by TCS
Thu Feb 18, 2016 11:35 am
Forum: madCodeHook
Topic: Unhooking on process destroy and manual uninject issues
Replies: 9
Views: 9773

Unhooking on process destroy and manual uninject issues

Hey, I recently learned (through a post in this forum) that when I uninject all uninjected DLLs (inject using the driver) I don't need to unhook manually because all the functions get unhooked automatically before PROCESS_DETACH. I have few questions regarding this: 1. In case the process dies (bein...
by TCS
Mon Feb 15, 2016 2:07 pm
Forum: madCodeHook
Topic: UnhookCode fails (GetLastError()==0)
Replies: 7
Views: 7330

Re: UnhookCode fails (GetLastError()==0)

Sorry took me some time to answer, I wanted to be sure that's the problem.
It seems there is a resource leak in OpenSSL and than was the problem.

Thanks again!