Page 1 of 1

didn't hook apis in specified application

PostPosted: Thu Jul 19, 2018 4:25 am
by orseL
Hi madshi,

before i ask, i'm sure that i'm totally beginner in madchook and also english. :wink:

i'm testing api hook now with madchook 3.1.18

and i want to catch some apis such as "CreateFile, ReadFile and SHGetFileInfo" in (Desktop-search engine)explorer application that named "Everything"

i've successed to attach my test dll on this application. but it didn't hook apis at all and i couldn't find out any problem.

i attach some screen-shot, log and my source-code that modified from Print monitor Demo.

please check it and i would appriciate when you answer.

thanks! best regard

Re: didn't hook apis in specified application

PostPosted: Mon Jul 23, 2018 9:09 pm
by madshi
I'm confused, your source code doesn't even seem to use madCodeHook at all. Or am I missing something?

Re: didn't hook apis in specified application

PostPosted: Tue Jul 24, 2018 12:19 am
by orseL
I'm really sorry that i uploaded wrong file. Here is new uploads. thanks to reply :)

Re: didn't hook apis in specified application

PostPosted: Tue Jul 24, 2018 6:52 am
by madshi
You are calling FinalizeMadCHook() for DLL_THREAD_ATTACH and DLL_THREAD_DETACH events, which is totally wrong.

You said that you modified the PrintMonitor demo, which would have been smart. But you did not. Your dllmain.cpp file has exactly zero things in common with the PrintMonitor demo. If you actually did use the PrintMonitor demo as a starting point, you would not have run into this problem... :wink:

Re: didn't hook apis in specified application

PostPosted: Wed Jul 25, 2018 1:27 am
by orseL
Now it works super :D Thanks madshi!