The ploblem is when i use madchook in dinamic link library(from madCodeHook\Dll folder )it woking fine not have any ploblem .
But when i use static link library (from folder madCodeHook\BCB6)
bool WINAPI DllMain(HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
InitializeMadCHook();
CollectHooks ();
HookAPI("WS2_32.DLL", "send", sendCallback, (PVOID*) &sendNext);
FlushHooks ();
} else if (fdwReason == DLL_PROCESS_DETACH)
UnhookAPI( (PVOID*)&sendNext);
FinalizeMadCHook();
// delete working_buffer;
return true;
}
My bcb output show this warnning ...
[C++ Warning] Unit1.cpp(75): W8030 Temporary used for parameter 'nextHook' in call to '__stdcall HookAPI(char *,char *,void *,void * &,unsigned int)'
[C++ Warning] Unit1.cpp(81): W8030 Temporary used for parameter 'nextHook' in call to '__stdcall UnhookAPI(void * &)'
Yes it's warning all compilation successfully .
When i inject my dll into another process ,sometime hook sometime not.
And sendNext() function point to invalid memory address(i trace with debugger)
Memory access violation exception heppen.
What's the ploblem ,and how to solve this thing?