I tried to replace Delphi build-in function with my own version on-the-fly.
function ShortCutToTextOverride(ShortCut: TShortCut): string;
begin
if SomeCondition then
Result := Menus.ShortCutToText // after patching the pointer equals ShortCutToTextOverride
else
begin
// My own code goes here
end;
end;
FastcodeAddressPatch(@Menus.ShortCutToText, @ShortCutToTextOverride);
After patching, the original function is no longer accessible. It is possible access it anyway?