Patch routine call in delphi
I want to patch a routine call to be able to handle it myself with some modifications. I am writing a resource loader. I want to patch the Delphi's LoadResourceModule and InitInheritedComponent routines with that of mine. I have checked PatchAPI call in MadExcept.pas unit, but couldn't figure it out if i can use that for my project. I want something like my exe at runtime calls -> LoadResourceModule -> jump to -> MyCustomResourceModule... Any pointers on this would be very helpful. I use the following code: procedure PatchCode(Address: Pointer; const NewCode; Size: Integer); var OldProtect: