What all dlls to be included to main application for hooking
What all dlls to be included to main application for hooking
Hello,
I have downloaded the demo application and package as well. Now I want to hook some function in my programm. Do I need to run madcodehook setup before running my application or I can include some dlls in my setup file. If dlls are enough for hooking what all dlls need to be installed on the target system. Thanks in advance.
Sanjeev
I have downloaded the demo application and package as well. Now I want to hook some function in my programm. Do I need to run madcodehook setup before running my application or I can include some dlls in my setup file. If dlls are enough for hooking what all dlls need to be installed on the target system. Thanks in advance.
Sanjeev
When using MSVC there are 2 options: You can use the dynamic lib file or the static lib file. When using the dynamic lib file you need to distribute the madCHook.dll with your application. On the target PC this dll must be copied to the system folder. When using the static lib file there's nothing at all which you need to distribute with your application. The static lib file is only available in the commercial version of madCodeHook, though.
VB can perhaps be used for your application which starts the hooking/dll injection. But the hook dll itself can not be written in VB, since VB doesn't properly support pointers and function variables (AFAIK).
VB can perhaps be used for your application which starts the hooking/dll injection. But the hook dll itself can not be written in VB, since VB doesn't properly support pointers and function variables (AFAIK).
No, I don't have any VB code. But if you know VB well, you should be able to make it work yourself. Here's the C++ code:
// (un)inject the specified dll into (from) all current and future processes
// these flags can be used for both UninjectLibrary + InjectLibrary
#define ALL_SESSIONS 0xFFFFFFED // apps of all sessions
#define CURRENT_SESSION 0xFFFFFFEC // apps of current session
#define CURRENT_USER 0xFFFFFFEB // apps of current user
// the following flags may only be used in combination with the first 3 flags
#define SYSTEM_PROCESSES 0x10 // include this flag to include system processes + services
#define CURRENT_PROCESS 0x08 // exclude this flag to exclude injection into yourself
// same as LoadLibrary, but is able to load the library in any process
madCHookApi(BOOL) InjectLibraryA(
DWORD dwProcessHandleOrSpecialFlags,
LPCSTR pLibFileName,
DWORD dwTimeOut = 7000
);
That API is exported by "madCHook.dll" under the name "InjectLibraryA". You should be able to call this from VB. However, the hook dll must be created by using Delphi or MSVC.
// (un)inject the specified dll into (from) all current and future processes
// these flags can be used for both UninjectLibrary + InjectLibrary
#define ALL_SESSIONS 0xFFFFFFED // apps of all sessions
#define CURRENT_SESSION 0xFFFFFFEC // apps of current session
#define CURRENT_USER 0xFFFFFFEB // apps of current user
// the following flags may only be used in combination with the first 3 flags
#define SYSTEM_PROCESSES 0x10 // include this flag to include system processes + services
#define CURRENT_PROCESS 0x08 // exclude this flag to exclude injection into yourself
// same as LoadLibrary, but is able to load the library in any process
madCHookApi(BOOL) InjectLibraryA(
DWORD dwProcessHandleOrSpecialFlags,
LPCSTR pLibFileName,
DWORD dwTimeOut = 7000
);
That API is exported by "madCHook.dll" under the name "InjectLibraryA". You should be able to call this from VB. However, the hook dll must be created by using Delphi or MSVC.
Thanks a lot for the information. I have one more question about licencing. I want to buy the sorce code. But before buying this we want to test this in our application. For this we will buy commercial licence before. Now can we upgrade from commercial licence to source code licence? Also for source code do you send updates/Support ? If yes then upto when.
Thanks
Sanjeev
Thanks
Sanjeev
Ok,
Thanks, I'll get in touch with you via email. One more thing I was trying to convert this code in VB. I was able to sucessfully call the function InjectLibraryW in VB but hooking is not working. In VB we need to pass integer/long value for any constant. I converted #define ALL_SESSIONS 0xFFFFFFED and the long value is -19. I passed this value. It would be great if you can tell me the long value for 0xFFFFFFED. I am using dynamic library for testing. I tried standerd dll HookProcessCreation.dll for hooking in VB but its not working. InjectLibraryW returns true.
Sanjeev
Thanks, I'll get in touch with you via email. One more thing I was trying to convert this code in VB. I was able to sucessfully call the function InjectLibraryW in VB but hooking is not working. In VB we need to pass integer/long value for any constant. I converted #define ALL_SESSIONS 0xFFFFFFED and the long value is -19. I passed this value. It would be great if you can tell me the long value for 0xFFFFFFED. I am using dynamic library for testing. I tried standerd dll HookProcessCreation.dll for hooking in VB but its not working. InjectLibraryW returns true.
Sanjeev
Help needed for win 98
Hello,
I recently bought the commercial version. I compiled the dll with static library. It is working on NT system but not working on 98. It gives runtime error and searches for madCHook.dll. If this dll file is present on 98 it workes fine if I remove the dll then it gives error. On 2k, XP it is working fine without madCHook.dll. Is there anything I did in wrong way. Or I need to do some settings in my dll project which is written in VC using the given sample code (HookProcessCreation).
Thanks
Sanjeev
I recently bought the commercial version. I compiled the dll with static library. It is working on NT system but not working on 98. It gives runtime error and searches for madCHook.dll. If this dll file is present on 98 it workes fine if I remove the dll then it gives error. On 2k, XP it is working fine without madCHook.dll. Is there anything I did in wrong way. Or I need to do some settings in my dll project which is written in VC using the given sample code (HookProcessCreation).
Thanks
Sanjeev