diff options
| author | LLLL Colonq <llll@colonq> | 2026-04-26 22:55:20 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-04-26 22:55:20 -0400 |
| commit | 63051c6f1cf59e468cb4175deea83c82888d18c2 (patch) | |
| tree | 8b43f64dd8a1932aa886283a63d49688b149b5a6 /test.pit | |
| parent | e38591e34fb46b433485e8decbe0ea3ec964fdbe (diff) | |
Diffstat (limited to 'test.pit')
| -rw-r--r-- | test.pit | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test.pit b/test.pit new file mode 100644 index 0000000..c67246f --- /dev/null +++ b/test.pit @@ -0,0 +1,30 @@ +(let ( (elf (elf/new!)) + (entrypoint 0x696000) + (toff 0x1000) + (phdroff 0x2000) + ) + (elf/write-bytes! elf toff + '( 0x48 0xc7 0xc0 0x3c 0x00 0x00 0x00 + 0x48 0xc7 0xc7 0x2a 0x00 0x00 0x00 + 0x0f 0x05 )) + (elf/write-program-header! elf (+ phdroff elf/64_PROGRAM_HEADER_SIZE) + :type elf/PROGRAM_HEADER_TYPE_LOAD + :offset toff + :virtual-addr entrypoint + :file-size 0x100 + :mem-size 0x100 + :flags (bitwise/or elf/PROGRAM_HEADER_FLAG_R elf/PROGRAM_HEADER_FLAG_X) + ) + (elf/write-header! elf + :type elf/TYPE_EXEC + :machine elf/MACHINE_AMD64 + :program-header-offset phdroff + :program-header-entry-size elf/64_PROGRAM_HEADER_SIZE + :program-header-entries 2 + :section-header-offset 0 + :section-header-entry-size elf/64_SECTION_HEADER_SIZE + :section-header-entries 0 + :entry entrypoint + ) + (elf/spit! "test.elf" elf) + ) |
