Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/data/templates/src/elf/exe/elf_zarch_template.s
28810 views
1
; build with:
2
; nasm elf_zarch_template.s -f bin -o template_zarch_linux.bin
3
4
BITS 64
5
6
7
ehdr: ; Elf32_Ehdr
8
db 0x7F, "ELF", 2, 2, 1, 0 ; e_ident
9
db 0, 0, 0, 0, 0, 0, 0, 0 ;
10
dw 0x0200 ; e_type = ET_EXEC for an executable
11
dw 0x1600 ; e_machine = ZARCH
12
dd 0x01000000 ; e_version
13
dq 0x7810000000000000 ; e_entry
14
dq 0x4000000000000000 ; e_phoff
15
dq 0 ; e_shoff
16
dd 0 ; e_flags
17
dw 0x4000 ; e_ehsize
18
dw 0x3800 ; e_phentsize
19
dw 0x0100 ; e_phnum
20
dw 0 ; e_shentsize
21
dw 0 ; e_shnum
22
dw 0 ; e_shstrndx
23
24
phdr: ; Elf32_Phdr
25
dd 0x01000000 ; p_type = PT_LOAD
26
dd 0x07000000 ; p_flags = rwx
27
dq 0 ; p_offset
28
dq 0x0010000000000000 ; p_vaddr
29
dq 0x0010000000000000 ; p_paddr
30
dq 0xDEADBEEF ; p_filesz
31
dq 0xDEADBEEF ; p_memsz
32
dq 0x0000100000000000 ; p_align
33
34
_start:
35
36