How to override a function in binary from outside?

This is a discussion on How to override a function in binary from outside? within the C++ Programming forums, part of the General Programming Boards category; Hi all, I am working on a problem that goes as follows: GIVEN: I have the executable file ready with ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    6

    Question How to override a function in binary from outside?

    Hi all,

    I am working on a problem that goes as follows:

    GIVEN:
    I have the executable file ready with me. I know the source code has a function named f(). I know the entire signature of the function. However, I do not have the source code available with me. I donot have any other header file etc with me either.

    PROBLEM:
    Now, I need to override this function f() with my own function f(). How can I achieve that?

    Also, main function exists in the existing executable. So, I do not intend to use this executable as a library and then call all the functions in the new code.

    Any pointers on this would be welcome.

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,834
    No idea - this one's closed.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 04:06 PM
  2. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 07:54 PM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. I need help with passing pointers in function calls
    By vien_mti in forum C Programming
    Replies: 3
    Last Post: 04-24-2002, 11:00 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21