CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    Australia
    Posts
    7

    EXE /COB file / function pointer / pointer offsets

    Hey, I'm looking at after compile time editing my executables,
    I was wondering if anyone could tell me the format of a windows Executable, and if possible the process of adding a function pointer to a simple main function and adding the function body that is already compiled

    so ->

    int main()
    {
    return 0;
    }

    compile to test.exe

    int blah();

    int main()
    {
    blah();
    }

    int blah()
    {
    ::MessageBox(NULL, "blah", "erhh", 0);
    }

    compile to data.exe

    what I want to do is merge the blah function to be called from test.exe.

    thanks

    the pixel monkey
    errhrhhhhrhhrhrhrhrh

  2. #2
    Join Date
    Oct 2000
    Location
    India
    Posts
    4,620

    Hi

    Hi,

    The structure can be obtained here --> Click Here , but isnt what you are trying to do called a VIRUS ???
    All luck and have a great day.

    Regards,
    V.Girish

    Visit www.geocities.com/contactgirish for Source code, Tutorials, FAQs and Downloads.

  3. #3
    Join Date
    Jan 2001
    Location
    Toronto
    Posts
    118

    check MSDN articles

    search in MSDN and you will find with "PE Format" you can find 2 Technical Article:
    1. Peering Inside the PE: A Tour of the Win32 Portable Executable File Format by Matt Pietrek March 1994
    2. YAHU, or Yet Another Header Utility by Ruediger R. Asche
    Microsoft Developer Network Technology Group, January 10, 1995
    you can also visit http://www.magma.ca/~wjr/ for a PEview Tool to peek into the Portable Executable File inside deeply.

    So, at far as I know, you can intercept the import table to "replace", say, a Kernel32.dll function, BUT, I don't think you can replace a function for there is no information about.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured