diff --git a/programs/aarch64/return-42/00_elf_header.txt b/programs/aarch64/return-42/00_elf_header.txt index d0f1b9e..4645d02 100644 --- a/programs/aarch64/return-42/00_elf_header.txt +++ b/programs/aarch64/return-42/00_elf_header.txt @@ -33,8 +33,8 @@ # File Type - e_type - Executable binary 02 00 -# Architecture - e_machine - AMD 64 Architecture -3e 00 +# Architecture - e_machine - Aarch 64 Architecture +b7 00 # Version Spec - e_version - Version 1 01 00 00 00 @@ -48,8 +48,8 @@ 40 00 00 00 00 00 00 00 # Section Header Table Offset - e_shoff -# 64 + 56 + 16 + 16 -98 00 00 00 00 00 00 00 +# 64 + 56 + 12 + 16 +94 00 00 00 00 00 00 00 # Processor Flags - e_flags - No flags set 00 00 00 00 diff --git a/programs/aarch64/return-42/01_program_header.txt b/programs/aarch64/return-42/01_program_header.txt index 5aa194b..b53225e 100644 --- a/programs/aarch64/return-42/01_program_header.txt +++ b/programs/aarch64/return-42/01_program_header.txt @@ -24,12 +24,12 @@ # p_filesz - size of the file to load # This is to the end of the .text section, which for us is just # the program size, ELF header, and program header -# so 64 + 56 + 16 = 136 = 0x88 -88 00 00 00 00 00 00 00 +# so 64 + 56 + 12 = 132 = 0x84 +84 00 00 00 00 00 00 00 # p_memsz - size of the file once loaded into memory # For us this is the same as above for now -88 00 00 00 00 00 00 00 +84 00 00 00 00 00 00 00 # p_align - something to do with alignment, p_offset and p_vaddr # need more reading on that diff --git a/programs/aarch64/return-42/02_program_code.txt b/programs/aarch64/return-42/02_program_code.txt index 06e96ef..70a1824 100644 --- a/programs/aarch64/return-42/02_program_code.txt +++ b/programs/aarch64/return-42/02_program_code.txt @@ -1,12 +1,14 @@ -# Program Code +# Program Code - 12 bytes # ============ -# mov $60, %rax -48 c7 c0 3c 00 00 00 +# mov w8 #93 +# d2 80 0b a8 +a8 0b 80 d2 -# mov $42, %rdi -48 c7 c7 2a 00 00 00 - -# syscall -0f 05 +# mov x0 #42 +# d2 80 05 40 +40 05 80 d2 +# svc #0 +# d4 00 00 01 +01 00 00 d4 diff --git a/programs/aarch64/return-42/05_section_header_program.txt b/programs/aarch64/return-42/05_section_header_program.txt index 028fb23..3a8ce20 100644 --- a/programs/aarch64/return-42/05_section_header_program.txt +++ b/programs/aarch64/return-42/05_section_header_program.txt @@ -16,7 +16,7 @@ 78 00 00 00 00 00 00 00 # size of this section in the file: 16 bytes -10 00 00 00 00 00 00 00 +0c 00 00 00 00 00 00 00 # sh_link -- not used for this section 00 00 00 00 00 00 00 00