From 7b3b4a2ec591268ca5216a5f84c7d122fcee03d1 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 4 Nov 2022 15:31:59 -0700 Subject: [PATCH] Add LE/LX imported module name table --- .../LinearExecutable/Executable.cs | 7 +++- .../ImportModuleNameTableEntry.cs | 41 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 BurnOutSharp.Models/LinearExecutable/ImportModuleNameTableEntry.cs diff --git a/BurnOutSharp.Models/LinearExecutable/Executable.cs b/BurnOutSharp.Models/LinearExecutable/Executable.cs index 8b62c9ed..9d2a5b2b 100644 --- a/BurnOutSharp.Models/LinearExecutable/Executable.cs +++ b/BurnOutSharp.Models/LinearExecutable/Executable.cs @@ -58,7 +58,12 @@ namespace BurnOutSharp.Models.LinearExecutable // TODO: Fix-up page table // TODO: Fix-up record table - // TODO: Imported modules name table + + /// + /// Imported module name table + /// + public ImportModuleNameTableEntry[] ImportModuleNameTable { get; set; } + // TODO: Imported procedures name table // TODO: Preload Pages diff --git a/BurnOutSharp.Models/LinearExecutable/ImportModuleNameTableEntry.cs b/BurnOutSharp.Models/LinearExecutable/ImportModuleNameTableEntry.cs new file mode 100644 index 00000000..6cc5b4e3 --- /dev/null +++ b/BurnOutSharp.Models/LinearExecutable/ImportModuleNameTableEntry.cs @@ -0,0 +1,41 @@ +using System.Runtime.InteropServices; + +namespace BurnOutSharp.Models.LinearExecutable +{ + /// + /// The import module name table defines the module name strings imported through + /// dynamic link references. These strings are referenced through the imported + /// relocation fixups. + /// + /// To determine the length of the import module name table subtract the import + /// module name table offset from the import procedure name table offset. These + /// values are located in the linear EXE header. The end of the import module + /// name table is not terminated by a special character, it is followed directly + /// by the import procedure name table. + /// + /// The strings are CASE SENSITIVE and NOT NULL TERMINATED. + /// + /// + /// + [StructLayout(LayoutKind.Sequential)] + public class ImportModuleNameTableEntry + { + /// + /// String Length. + /// + /// + /// This defines the length of the string in bytes. The length of each + /// ascii name string is limited to 127 characters. + /// + public byte Length; + + /// + /// ASCII String. + /// + /// + /// This is a variable length string with it's length defined in bytes by + /// the LEN field. The string is case sensitive and is not null terminated. + /// + public byte[] Name; + } +}