A dummy question: where is madCHook.h?

c++ / delphi package - dll injection and api hooking
Post Reply
Laten
Posts: 1
Joined: Mon Jul 19, 2004 2:24 pm

A dummy question: where is madCHook.h?

Post by Laten »

I've installed madCollection but I can't compile any demos (in BCB6) :confused: I get the "Unable to open include file 'madCHook.h' " error. Where is the madCHook.h header file? I've tried to use 'madCHook - static.h' but it's not working too (a lot of errors) :(
Please, help a dummy!
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Hmmmm... The C++ demos were originally meant for MSVC. That's why "madCHook.h" is used there. But as a BCB user you have better choices: You can use the native precompiled units. So please replace "madCHook.h" with "madCodeHook.hpp". Sorry, I should really add this to the C++ demos.
icy
Posts: 6
Joined: Thu Aug 12, 2004 11:21 pm

Post by icy »

hi

I am using Dev-Cpp and MSVC but I get this errors too (because there is no file madCHook.h).

So I can't manage to compile the demos :(

Any help is appreciated
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

You need to decide whether you want to use the dynamic or the static madCHook lib. The static lib is only contained in the commercial edition. So if you don't have a commercial license, you have to use the dynamic lib. In that case please rename "madCHook - dynamic.h" to "madCHook.h", then you have your "madCHook.h" file.
icy
Posts: 6
Joined: Thu Aug 12, 2004 11:21 pm

Post by icy »

Thanks for your reply.
Anyway I found it out myself :) (you also have to copy the madCHook.lib)

But now I have another problem:

I tried to modify the HookNextFindFile dll so the name of the dll is not "hardcoded" anymore but it gets its own filename whenever the function is called.
I tried it with the function GetModuleFileName() and then split the filename from the path. But I don't know how to get this value in the CHideFileA and CHideFileW (ansi and wide?) variables.

Thanks again :)

ps: Your collection of code/functions etc is amazing and it's really cool that you share so much information with us. 8)
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

What is your aim? What do you want to do?
icy
Posts: 6
Joined: Thu Aug 12, 2004 11:21 pm

Post by icy »

I don't wont to have the "HookFindNextFile.dll" string in there.
I want to be able to rename the dll to whatever I want and it still hides itself.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Well, who shall decide which file to hide? The application? Then you need to put the file name into a file map (see CreateGlobalFileMapping).

P.S: Hopefully your software will be legal?
icy
Posts: 6
Joined: Thu Aug 12, 2004 11:21 pm

Post by icy »

Well, who shall decide which file to hide? The application?
I want to rename the dll for example to "myDLL.dll" and then hook it systemwide with the loader in the Demo directory and it should hide itself.
Just like the original demo but with dynamic filename.
P.S: Hopefully your software will be legal?
It's not really a software. I am just "learing by doing". It will just be another demo and not used for anything.
I would never dare to use your code for any illegal purpose because I respect your hard work!
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

icy wrote:I want to rename the dll for example to "myDLL.dll" and then hook it systemwide with the loader in the Demo directory and it should hide itself.
Just like the original demo but with dynamic filename.
Yeah, then you need to use a file mapping.
I would never dare to use your code for any illegal purpose because I respect your hard work!
Thank you! :D
icy
Posts: 6
Joined: Thu Aug 12, 2004 11:21 pm

Post by icy »

I you are not too busy, could you provide some example code?
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I'm really sorry, but I *am* to busy. Heavily working on madExcept...
icy
Posts: 6
Joined: Thu Aug 12, 2004 11:21 pm

Post by icy »

That's no problem.
You are working an madExcept for us all and I will find the sollution on my own, it's just a matter of time :)

Good luck 8)
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

icy wrote:You are working an madExcept for us all
Well, I wish you MSVC guys could use it too, but madExcept works for Borland only (Delphi + Borland C++ Builder), unfortunately.
Post Reply