Hi , i developed a unit named GenericCodeHook , it will do a generic code hook by replacing the code location to be patched by a jump to the new location .
i have 2 functions :
CreateGenericCHook and RemoveGenericCHook .
library GenCHook;
uses
windows,
GenericCodeHook;
procedure Main( Reason : Integer ) ;
begin
case reason of
DLL_PROCESS_DETACH:
begin
Detache;
{
Detache:
will call the RemoveGenericCHook function
}
end;
DLL_PROCESS_ATTACH:
begin
Attach;
{
Attach:
will call the CreateGenericCHook function
}
end;
end;
end;
{ *******************
*** Entry Point ***
******************* }
begin
DllProc := @Main;
DllProc(DLL_PROCESS_ATTACH) ;
end.
But the problem is how could i inject it into the whole system using MadCodeHook library ?