From ab60f82c439cb8aeb0d643ffb683e51ee8fe60d6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 13 Jun 2018 01:00:12 -0400 Subject: [PATCH] lx_dump: report OS/2 EXE flags for NE modules. --- lib2ine.h | 3 ++- lx_dump.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib2ine.h b/lib2ine.h index 6f0957b..65efa2b 100644 --- a/lib2ine.h +++ b/lib2ine.h @@ -167,7 +167,8 @@ typedef struct NeHeader uint16 sector_alignment_shift_count; uint16 num_resource_entries; uint8 exe_type; - uint8 reserved[9]; + uint8 os2_exe_flags; + uint8 reserved[8]; } NeHeader; typedef struct NeSegmentTableEntry diff --git a/lx_dump.c b/lx_dump.c index 7f61b06..9d1f7f6 100644 --- a/lx_dump.c +++ b/lx_dump.c @@ -575,6 +575,17 @@ static int parseNeExe(const uint8 *origexe, const uint8 *exe) printf("Sector alignment shift count: %u\n", (uint) ne->sector_alignment_shift_count); printf("Number of resource entries: %u\n", (uint) ne->num_resource_entries); printf("Executable type: %u\n", (uint) ne->exe_type); + + printf("OS/2 flags:"); + if (ne->os2_exe_flags == 0) { + printf(" (none)"); + } else { + if (ne->os2_exe_flags & (1 << 0)) printf(" LONGFILENAMES"); + if (ne->os2_exe_flags & (1 << 1)) printf(" PROTECTEDMODE"); + if (ne->os2_exe_flags & (1 << 2)) printf(" PROPORTIONALFONTS"); + if (ne->os2_exe_flags & (1 << 3)) printf(" GANGLOADAREA"); + } + printf("\n"); printf("\n"); const uint32 sector_shift = ne->sector_alignment_shift_count;