What makes a Windows EXE?

This is a discussion on What makes a Windows EXE? within the Windows Programming forums, part of the Platform Specific Boards category; So while the EXEs of most x86 OS:es including Windows appear very different from .COMs or OBJs they are still ...

  1. #16
    Registered User
    Join Date
    Jan 2005
    Posts
    70
    So while the EXEs of most x86 OS:es including Windows appear very different from .COMs or OBJs they are still actually x86 machinecode (despite beeing called portable in the case of windows) if you exclude header information?

    Does Windows replace any part of the EXEs contents when it's loaded into memory (such as memory addresses) with current conditions (where the app is loaded, where DLLs are loaded)?

  2. #17
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Quote Originally Posted by willkoh
    So while the EXEs of most x86 OS:es including Windows appear very different from .COMs or OBJs they are still actually x86 machinecode (despite beeing called portable in the case of windows) if you exclude header information?
    Yes.

    Does Windows replace any part of the EXEs contents when it's loaded into memory (such as memory addresses) with current conditions (where the app is loaded, where DLLs are loaded)?
    Yes the import table is filled with addresses of imported functions.

  3. #18
    Registered User
    Join Date
    Jan 2005
    Posts
    70

    Cool

    ...retrieved from the import libraries, right? But if these explain only where within the DLL-file the function entry points are, will windows replace the call-to-addresses in the ram-stored copy of our EXE with DLL_NowLoadedAtMemoryAdr + FunctionEntryPoint?

    (assuming windows has loaded the DLL)

    Am I trying to write a windows emulator?" - No, not yet at least. I just want to know things

    I'm intrested in low-level stuff such as compiler and OS-creation, so it's important to know what-is-a-result-of-what.

  4. #19
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    If it hadn't already turned into a discussion, I would have no reason not to close this thread. Wilkoh, please review the forum guidelines (found as an announcement at the top of every foum), and do not bump old threads in the future.

  5. #20
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    I am fairly sure that windows gets the address of imported functions from the dll's export table and that the lib files contain the names of the functions.
    Addresses in the dll's export table are RVAs (relative virtual addresses) an RVA + the image base of a file gives the actual address. So before loading the exe has no addresses for the imported functions after loading windows has filled in the import table of the loaded file with correct addresses.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. resizing makes child windows blink
    By robig2 in forum Windows Programming
    Replies: 15
    Last Post: 01-14-2008, 02:24 AM
  2. run windows exe
    By munna_dude in forum Linux Programming
    Replies: 3
    Last Post: 10-10-2007, 01:12 AM
  3. how to make a windows application
    By crvenkapa in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2007, 09:59 AM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 06:05 PM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM

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