summaryrefslogtreecommitdiffhomepage
path: root/dev/LibCompiler/PEF.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-06-18 10:27:31 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-06-18 10:27:31 +0200
commitfbbcfd27436fe61799c79aec14f9c2c3fdf73497 (patch)
treed8be437f572605462637007f6bd371b6b4a650cb /dev/LibCompiler/PEF.h
parent2a1e217019f66b1913034b6bd760052f3b37cea4 (diff)
feat: PEF format update `5.0` and codebase refactors.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/PEF.h')
-rw-r--r--dev/LibCompiler/PEF.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/dev/LibCompiler/PEF.h b/dev/LibCompiler/PEF.h
index 3f5a2b1..08ace3c 100644
--- a/dev/LibCompiler/PEF.h
+++ b/dev/LibCompiler/PEF.h
@@ -8,11 +8,11 @@
#include <LibCompiler/Defines.h>
-// @file PEF.hpp
+// @file PEF.h
// @brief Preferred Executable Format
-#define kPefMagic "Joy!"
-#define kPefMagicFat "yoJ!"
+#define kPefMagic "Open"
+#define kPefMagicFat "nepO"
#define kPefExt ".exec"
#define kPefDylibExt ".dylib"
@@ -31,7 +31,7 @@
#define kPefMagicLen (5)
-#define kPefVersion (4)
+#define kPefVersion (0x0500)
#define kPefNameLen (255)
#define kPefBaseOrigin (0x40000000)
@@ -53,10 +53,10 @@ enum {
};
enum {
+ kPefSubArchGeneric,
kPefSubArchAMD = 200,
kPefSubArchIntel,
kPefSubArchARM,
- kPefSubArchGeneric,
kPefSubArchIBM,
};
@@ -71,7 +71,7 @@ enum {
/* PEF container */
typedef struct PEFContainer final {
- Char Magic[kPefMagicLen];
+ Char Magic[kPefMagicLen];
UInt32 Linker; /* Linker used to link executable */
UInt32 Version;
UInt32 Kind;
@@ -90,23 +90,23 @@ typedef struct PEFContainer final {
/* PEF executable section and commands. */
typedef struct PEFCommandHeader final {
- Char Name[kPefNameLen]; /* container name */
+ Char Name[kPefNameLen]; /* container name */
UInt32 Cpu; /* container cpu */
UInt32 SubCpu; /* container sub-cpu */
UInt32 Flags; /* container flags */
UInt16 Kind; /* container kind */
- UIntPtr Offset; /* file offset */
- UIntPtr VMAddress; /* VM offset */
- SizeType Size; /* file size */
+ UIntPtr Offset; /* File offset */
+ UIntPtr VMAddress; /* Virtual Address */
+ SizeType Size; /* Virtual Size */
} PACKED PEFCommandHeader, *PEFCommandHeaderPtr;
enum {
+ kPefInvalid = 0x0,
kPefCode = 0xC,
kPefData = 0xD,
kPefZero = 0xE,
kPefLinkerID = 0x1,
kPefCount = 4,
- kPefInvalid = 0xFF,
};
} // namespace LibCompiler