Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

pestub + large stub = invalid executable for WinXP (DOSX)

posted by Japheth Homepage, Germany (South), 28.04.2008, 12:29

> It's not because of "stupid Windows XP" that I read somewhere (I don't
> remember where, can't find it again), but because it's logical that PE
> sections must not overlap, and PE header itself is considered a section.
> Of course, PE header must be mapped into address space.

the WinXP possibly isn't "stupid", but it also isn't smart. Because it could easily check if the header overlaps with the first section and if yes, skip the DOS part of the header.

> 1. Use the following scheme:
>
> [ MZ header ][ PE header ][ DOS data ][ Windows data ]

I don't understand what's the "DOS data" is supposed to be.

> 2. Relocate an executable to fit DOS stub.
>
> If relocations are present, we can relocate the sections so first section
> start at bigger virtual address and fit whole DOS stub.

Ok, but the problem is that almost all applications are without relocs.

> 3. Reduce executable's image base to fit DOS stub.
>
> If there are no relocations, we can reduce image base by needed space
> size and fit DOS stub again.

A funny idea, but it might indeed work for many cases. However, it will change the module's base address, so it isn't fully transparent for the Win32 code.

---
MS-DOS forever!

 

Complete thread:

Back to the forum
Board view  Mix view
22755 Postings in 2121 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum