Way to replace DOS part of an EXE?
Posted: Tue Mar 23, 2010 8:06 pm
I was wondering if there existed a way to replace the DOS part of a PE EXE, so I wouldn't have to write a potentially buggy utility to do that. I'm using VC++08EE to write the PE part, in case there's some hidden thing in there.
I'm working on my bootloader, which at this point will load and try to run the MZ exe. The problem is that the default stub does not do what I need it to in any way, shape or form, and depends on DOS (big surprise there), which my stage1 is not. I want to write a new stub that will set up the environment for, as well as parse and set up, the PE part of the EXE, so that hopefully the second stage can be run by both my stage1 and eventually an EFI setup (though I don't have a clue how I'm going to test that without any EFI emulator, unless someone can suggest one of those too).
I'm working on my bootloader, which at this point will load and try to run the MZ exe. The problem is that the default stub does not do what I need it to in any way, shape or form, and depends on DOS (big surprise there), which my stage1 is not. I want to write a new stub that will set up the environment for, as well as parse and set up, the PE part of the EXE, so that hopefully the second stage can be run by both my stage1 and eventually an EFI setup (though I don't have a clue how I'm going to test that without any EFI emulator, unless someone can suggest one of those too).