pestub + large stub = invalid executable for WinXP (DOSX)
> 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:
- pestub + large stub = invalid executable for WinXP - grompe, 28.04.2008, 11:44
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- pestub + large stub = invalid executable for WinXP - Japheth, 28.04.2008, 11:55
- The -s option doesn't help with large stub - grompe, 28.04.2008, 12:02
- pestub + large stub = invalid executable for WinXP - DOS386, 01.05.2008, 05:19
- Thanks, but there's no need to search for another solution - grompe, 01.05.2008, 17:48
- Thanks, but there's no need to search for another solution - DOS386, 02.05.2008, 21:43
- Thanks, but there's no need to search for another solution - grompe, 01.05.2008, 17:48
- pestub + large stub = invalid executable for WinXP - Japheth, 28.04.2008, 12:29
- DOS data is just a stub without MZ header - grompe, 28.04.2008, 12:37
- Method 1 verified and works! Solution - grompe, 30.04.2008, 12:41
- pestub + large stub = invalid executable for WinXP - Rugxulo, 01.05.2008, 05:48
- Sigh... Still not fixed - grompe, 28.01.2009, 20:51
- Sigh... Still not fixed - Japheth, 30.01.2009, 17:28
- Sigh... Still not fixed - ecm, 30.01.2009, 17:56
- Miscounted, don't take it seriously. - grompe, 30.01.2009, 22:42
- Sigh... Still not fixed - Japheth, 30.01.2009, 17:28
- pestub + large stub = invalid executable for WinXP - Japheth, 28.04.2008, 11:55
Mix view