Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/data/templates/src/elf/exe/elf_aarch64_template.s
32698 views
1
; build with:
2
; nasm elf_aarch64_template.s -f bin -o template_aarch64_linux.bin
3
4
BITS 64
5
org 0x400000
6
ehdr: ; Elf32_Ehdr
7
db 0x7F, "ELF", 2, 1, 1, 0 ; e_ident
8
db 0, 0, 0, 0, 0, 0, 0, 0 ;
9
dw 2 ; e_type = ET_EXEC for an executable
10
dw 0xB7 ; e_machine = AARCH64
11
dd 1 ; e_version
12
dq _start ; e_entry
13
dq phdr - $$ ; e_phoff
14
dq 0 ; e_shoff
15
dd 0 ; e_flags
16
dw ehdrsize ; e_ehsize
17
dw phdrsize ; e_phentsize
18
dw 1 ; e_phnum
19
dw 0 ; e_shentsize
20
dw 0 ; e_shnum
21
dw 0 ; e_shstrndx
22
23
ehdrsize equ $ - ehdr
24
25
phdr: ; Elf32_Phdr
26
dd 1 ; p_type = PT_LOAD
27
dd 7 ; p_flags = rwx
28
dq 0 ; p_offset
29
dq $$ ; p_vaddr
30
dq $$ ; p_paddr
31
dq 0xDEADBEEF ; p_filesz
32
dq 0xDEADBEEF ; p_memsz
33
dq 0x1000 ; p_align
34
35
phdrsize equ $ - phdr
36
37
global _start
38
39
_start:
40
41
42