Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7962339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:18:32+00:00 2026-06-04T05:18:32+00:00

I tried to replace Delphi build-in function with my own version on-the-fly. function ShortCutToTextOverride(ShortCut:

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:18:34+00:00Added an answer on June 4, 2026 at 5:18 am

    I’m afraid not: the first bytes are overwritten by a jump to the new function.

    You can use KOLDetours.pas: it returns the pointer to the trampoline (original first few bytes that are overwritten by the detour).
    http://code.google.com/p/asmprofiler/source/browse/trunk/SRC/KOLDetours.pas

    For example:

    type
      TNowFunction = function:TDatetime;
    var
      OrgNow: TNowFunction;
    function NowExact: TDatetime;
    begin
      //exact time using QueryPerformanceCounter
    end; 
    
    initialization
      OrgNow := KOLDetours.InterceptCreate(@Now, @NowExact);
      Now()     -> executes NowExact() 
      OrgNow()  -> executes original Now() before the hook 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried converting the double value into a string and using the Replace() method
I tried to replace   elements in a string using .NET regex - with
Tue,Sep,21,15:48:1,CEST,2010 I would replace the , with a space. I have tried: string=string.replace(/,/g, );
I have a string, $str = abc#$and@def I tried to replace '$' with it's
Based on this thread. I've tried to replace the set the current version of
I tried to replace my Flash video with a jQuery cycle. The cycle works,
I have tried to replace the submit button of a form with an ajax
How can I replace all line-endings in big file (>100MB)? I have tried to
I want to replace a token using ANTLR. I tried with TokenRewriteStream and replace,
Tried following the instructions here: How to use Google app engine with my own

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.