Search found 381 matches

by dcsoft
Fri Feb 08, 2008 5:54 pm
Forum: madCodeHook
Topic: TreeView control question
Replies: 15
Views: 16196

If RegisterDragDrop() is called, then the notification of end drag is sent to the registered IDropTarget, not to the tree or parent window. I would hook RegisterDragDrop() and see if it is called when the drag/drop is started.

-- David
by dcsoft
Fri Feb 08, 2008 12:16 am
Forum: madCodeHook
Topic: TreeView control question
Replies: 15
Views: 16196

Kaarigar, You've already done the hard part: getting your DLL injected into the target process and subclassing the windows. I think now you need to learn how drag and drop works. Otherwise you won't know which stuff you have to hook. So I would start a temporary project with a tree control in it, an...
by dcsoft
Sun Oct 07, 2007 2:27 pm
Forum: madCodeHook
Topic: System wide hooks not hooking "user" processes
Replies: 13
Views: 13873

Another thing is to make sure you test all the parameters in your callback function before using them. For example, what if lpFilename is NULL? Does the string get constructed successfully? The injected app might have an exception handler that throws away the thrown exception when your hook does som...
by dcsoft
Sun Oct 07, 2007 3:49 am
Forum: madCodeHook
Topic: System wide hooks not hooking "user" processes
Replies: 13
Views: 13873

I'm not sure why Detours works and MCH does not, but the issue I see is: in the CreateFileACallback() you are calling file.open(), which probably does a CreateFile() call and thus makes this recursive. If i intercept file hooks, I use SendMessage(WM_COPYDATA, ...) to a logger application which avoid...
by dcsoft
Fri Sep 14, 2007 4:13 pm
Forum: madCodeHook
Topic: Api hooks really system wide?
Replies: 6
Views: 7181

What is confusing is that the functions in kernel32.dll are really "user mode" functions, so you can hook all of those using MadCodeHook. The functions like NtCreateProcessEx() are not in kernel32.dll, they are in NtDll.dll. These also are user mode functions, so you can hook all of these ...
by dcsoft
Thu Aug 30, 2007 5:34 am
Forum: madCodeHook
Topic: Shared memory
Replies: 6
Views: 7575

That's what I meant, sorry I did not understand you were already using it! :wink:
by dcsoft
Fri Aug 24, 2007 12:31 am
Forum: madCodeHook
Topic: Shared memory
Replies: 6
Views: 7575

Why don't you guys just use MCH instead of re-inventing the wheel? :?
by dcsoft
Fri Aug 24, 2007 12:26 am
Forum: madCodeHook
Topic: Static, dynamic, implicit and explicit linking
Replies: 1
Views: 3306

The terms are for whether the MCH code is statically linked into your hook dll or if you must distribute the MCH DLL.

This usage is the same as discussing whther to use the static or dynamic version of MFC, for example, It's quite a standard thing.

-- David
by dcsoft
Tue Jul 31, 2007 2:53 am
Forum: madCodeHook
Topic: Detecting "paste from clipboard"
Replies: 5
Views: 5869

Hook GetClipboardData()?

-- David
by dcsoft
Thu Jul 19, 2007 11:54 pm
Forum: madCodeHook
Topic: blocking file execution and movement with NtCreate/Openfile
Replies: 11
Views: 13404

Couldn't you hook NtWriteFile and set a flag that says the file was written to, and back it up when NtClose was called? Too late. In the moment when you let NtWriteFile pass, the original file data is already destroyed. I thought the idea was to back up the file *after* it has been changed. -- David
by dcsoft
Thu Jul 19, 2007 1:45 pm
Forum: madCodeHook
Topic: How madchook detect process execution?
Replies: 12
Views: 10209

The driver is used when you hook more than a specific process, so yes.

-- David
by dcsoft
Thu Jul 19, 2007 1:44 pm
Forum: madCodeHook
Topic: blocking file execution and movement with NtCreate/Openfile
Replies: 11
Views: 13404

Couldn't you hook NtWriteFile and set a flag that says the file was written to, and back it up when NtClose was called?
by dcsoft
Mon Jul 16, 2007 12:54 pm
Forum: madCodeHook
Topic: restricting an application / processes life span
Replies: 4
Views: 4594

Perhaps instead of closing the app when the timeout happened, you could start nagging them (like expired shareware) to close it themselves. In general, make it impossible to do much more useful work but still make it possible to click File | Save or whatever.

-- David
by dcsoft
Sun Jul 15, 2007 5:14 pm
Forum: madCodeHook
Topic: restricting an application / processes life span
Replies: 4
Views: 4594

Regarding the timer, I've never used CreateWaitableTimer() either, but it seems maybe this is what you really need. For simplicity, you could just open a handle on the current process and then do a WaitForSingleObject() with a timeout value of the desired timeout. When the thread is woken up, check ...
by dcsoft
Sun Jul 15, 2007 5:06 pm
Forum: madCodeHook
Topic: hooking gdi
Replies: 12
Views: 10657

Sweet! Thanks for the clarification. :D

-- David