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 8899183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:47:53+00:00 2026-06-15T00:47:53+00:00

Problem: I am injecting into a program and patching calls but I was wondering

  • 0

Problem:

I am injecting into a program and patching calls but I was wondering if there is any way to walk through the application line by line and find specific calls. _IE: Lets say the program ‘Foo.exe’ has a call to MessageBox at some location in memory.

If I did the following code: ( just a rough idea )

a = GetModuleHandle ( "<dll>" ); 
b = GetProcAddress ( a , "<name>" );
swap ( b , (DWORD)*fake_function );

— Everything works out fine, until you start calling the actual function – which creates a huge loop that goes on forever (ouch).

Now I am not sure about this and I may be wrong but … does the above code replace the ‘Foo.exe’ calls in memory, or does it replace the dll’s function with ‘fake_function’?

I am interested in a few things …

A ) How can I find all the memory locations in ‘Foo,exe’ that call MessageBox and replace the memory locations with a call to ‘fake_function’?

B ) How does detours solve this problem?

  • 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-15T00:47:54+00:00Added an answer on June 15, 2026 at 12:47 am

    You don’t need to locate all the instances where MessageBox gets called, instead you can hook the function. It seems like you have the general idea down, but what you want to do is walk the PE import table for the module in question. When you’re walking it, you look for the function you want to hook and then you do the swap. From then on whenever the module calls the MessageBox function it will look for a reference to the function in the import table and find the address to your function where it previously would have found the address to Microsoft’s implementation of MessageBox. In your function you can do whatever you want and you can even call the original address of the MessageBox function that you would have had to save upon swap.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get an error when trying to insert into TABLE_EVENTS but no problem inserting/querying
Right now I'm having a problem injecting a entityFactoryManager into my jpadaosupport extended class.
I am injecting a dll into firefox (browser) and hooking WSARecv. The problem is,
The problem is with inserting json strings into MySQL database. In my python program
I run into the following problem.I load my shaders from files.The shader program ,when
I have a problem with injecting a bean into a helper class. It works
I have some problem with the injecting of my cookie into login.php page. This
I'm experiencing a problem inserting values into a SQLite database. The data I download
I'm running into a problem inserting rows from a file with 13,000 rows into
i have a problem in inserting the listbox value into mysql database in vb

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.