clean dos extender executable format (Developers)
Hello kerravon,
> And it would be good if the stub cleanly reported
> an issue if it wasn't able to find the external
> loader or some other issue. My a.out executables
> don't do that. They get treated as .com files and
> hang or whatever. So this would be a step up from
> what I am currently doing.
Well, yes — Windows and OS/2 NE, LE, LX, PE, etc. files follow a rather basic sort of "fat binary" format:
(1) There is a classical MS-DOS MZ program stub tacked on at the front;
(2) and the MZ header has an extra offset field which points to the "actual" NE or PE (etc.) payload that Windows or OS/2 (etc.) can immediately run. (This field is usually named e_lfanew.)
The general scheme is kind of described in one of Microsoft's old (~ 1999) Developer's Notes: https://jeffpar.github.io/kbarchive/kb/065/Q65122/ .
You can probably apply the same scheme, or a similar one, to whatever protected mode (?) executable format you wish to stubify. Tack a classical MS-DOS program in front of it, and add an offset pointer to point to the a.out payload, and call it a day.
Thank you!
---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"
Complete thread:
- clean dos extender executable format - kerravon, 07.01.2023, 03:56 (Developers)
- clean dos extender executable format - kerravon, 07.01.2023, 04:18
- clean dos extender executable format - DosWorld, 08.01.2023, 15:51
- clean dos extender executable format - kerravon, 08.01.2023, 18:15
- clean dos extender executable format - DosWorld, 08.01.2023, 19:09
- clean dos extender executable format - tkchia, 08.01.2023, 19:11
- clean dos extender executable format - kerravon, 08.01.2023, 19:36
- clean dos extender executable format - tom, 09.01.2023, 18:49
- clean dos extender executable format - kerravon, 09.01.2023, 19:51
- clean dos extender executable format - tom, 09.01.2023, 18:49
- clean dos extender executable format - DosWorld, 09.01.2023, 00:24
- clean dos extender executable format - kerravon, 09.01.2023, 02:32
- clean dos extender executable format - DosWorld, 09.01.2023, 03:22
- clean dos extender executable format - kerravon, 09.01.2023, 03:43
- clean dos extender executable format - DosWorld, 09.01.2023, 03:22
- clean dos extender executable format - kerravon, 09.01.2023, 02:32
- clean dos extender executable format - kerravon, 08.01.2023, 19:36
- clean dos extender executable format - kerravon, 08.01.2023, 19:31
- clean dos extender executable format - tkchia, 08.01.2023, 19:11
- clean dos extender executable format - DosWorld, 08.01.2023, 19:09
- clean dos extender executable format - kerravon, 08.01.2023, 18:15
- clean dos extender executable format - tkchia, 08.01.2023, 18:10
- clean dos extender executable format - kerravon, 08.01.2023, 18:37
- clean dos extender executable format - tkchia, 08.01.2023, 19:05
- clean dos extender executable format - kerravon, 08.01.2023, 19:50
- clean dos extender executable format - tom, 08.01.2023, 20:35
- clean dos extender executable format - kerravon, 08.01.2023, 20:46
- clean dos extender executable format - kerravon, 08.01.2023, 22:51
- clean dos extender executable format - kerravon, 08.01.2023, 20:46
- clean dos extender executable format - tkchia, 09.01.2023, 00:59
- clean dos extender executable format - DosWorld, 09.01.2023, 03:13
- clean dos extender executable format - tkchia, 09.01.2023, 10:49
- clean dos extender executable format - DosWorld, 09.01.2023, 03:13
- clean dos extender executable format - tkchia, 09.01.2023, 11:11
- clean dos extender executable format - tom, 08.01.2023, 20:35
- clean dos extender executable format - kerravon, 08.01.2023, 19:50
- clean dos extender executable format - glennmcc, 08.01.2023, 19:10
- clean dos extender executable format - tkchia, 08.01.2023, 19:05
- clean dos extender executable format - kerravon, 08.01.2023, 18:37
- clean dos extender executable format - kerravon, 08.01.2023, 19:26
- clean dos extender executable format - CandyMan, 09.01.2023, 19:23