Skip to content

Commit b3f3b8c

Browse files
committed
PowerPC stageless payload
1 parent 55d69f6 commit b3f3b8c

File tree

7 files changed

+2134
-2029
lines changed

7 files changed

+2134
-2029
lines changed

data/templates/src/elf/exe/elf_ppc_template.s

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
BITS 32
2-
org 0x8000
32
ehdr: ; Elf32_Ehdr
43
db 0x7F, "ELF", 1, 2, 1, 0 ; e_ident
54
db 0, 0, 0, 0, 0, 0, 0, 0 ;
65
dw 0x0200 ; e_type = ET_EXEC for an executable
76
dw 0x1400 ; e_machine = AARCH64
87
dd 0x01000000 ; e_version
9-
dd 0x54000000 ; e_entry
8+
dd 0x54100000 ; e_entry
109
dd 0x34000000 ; e_phoff
1110
dd 0 ; e_shoff
1211
dd 0 ; e_flags
@@ -20,14 +19,15 @@ ehdr: ; Elf32_Ehdr
2019
ehdrsize equ $ - ehdr
2120

2221
phdr: ; Elf32_Phdr
23-
dd 0x01000000 ; p_type = PT_LOAD
22+
23+
dd 0x01000000 ; p_type = pt_load
2424
dd 0 ; p_offset
25-
dd 0x00800000 ; p_vaddr
26-
dd 0x00800000 ; p_paddr
27-
dd 0xdeadbeef ; p_filesz
28-
dd 0xdeadbeef ; p_memsz
25+
dd 0x00100000 ; p_vaddr
26+
dd 0x00100000 ; p_paddr
27+
dd 0xefbeadde ; p_filesz
28+
dd 0xefbeadde ; p_memsz
2929
dd 0x07000000 ; p_flags = rwx
30-
dd 0x00010000 ; p_align
30+
dd 0x00000100 ; p_align
3131

3232
phdrsize equ $ - phdr
3333

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
BITS 32
2+
ehdr: ; Elf32_Ehdr
3+
db 0x7F, "ELF", 1, 2, 1, 0 ; e_ident
4+
db 0, 0, 0, 0, 0, 0, 0, 0 ;
5+
dw 0x0200 ; e_type = ET_EXEC for an executable
6+
dw 0x1400 ; e_machine = AARCH64
7+
dd 0x01000000 ; e_version
8+
dd 0x54100000 ; e_entry
9+
dd 0x34000000 ; e_phoff
10+
dd 0 ; e_shoff
11+
dd 0 ; e_flags
12+
dw 0x3400 ; e_ehsize
13+
dw 0x2000 ; e_phentsize
14+
dw 0x0100 ; e_phnum
15+
dw 0 ; e_shentsize
16+
dw 0 ; e_shnum
17+
dw 0 ; e_shstrndx
18+
19+
ehdrsize equ $ - ehdr
20+
21+
phdr: ; Elf32_Phdr
22+
23+
dd 0x01000000 ; p_type = pt_load
24+
dd 0 ; p_offset
25+
dd 0x00100000 ; p_vaddr
26+
dd 0x00100000 ; p_paddr
27+
dd 0xefbeadde ; p_filesz
28+
dd 0xefbeadde ; p_memsz
29+
dd 0x07000000 ; p_flags = rwx
30+
dd 0x00000100 ; p_align
31+
32+
phdrsize equ $ - phdr
33+
34+
_start:
0 Bytes
Binary file not shown.
84 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)