Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 68 lines (55 sloc) 1.68 kB
692ffd3 @kakaroto Adding a payload to trace all sc calls (syscalls and hypercalls). Use…
authored
1 /*
2 * payload_dump_syscalls.S -- PS3 Jailbreak payload - hook syscall handler and
3 * dump the syscall arguments over ethernet
4 *
5 * Copyright (C) Youness Alaoui (KaKaRoTo)
6 * Copyright (C) Aaron Lindsay (Aaron')
7 * Copyright (C) (subdub)
8 *
9 * This software is distributed under the terms of the GNU General Public
10 * License ("GPL") version 3, as published by the Free Software Foundation.
11 *
12 * This payload is a modified version of the original PSJailbreak's payload.
13 * The people behing PSJailbrak are the original authors and copyright holders
14 * of the code they wrote.
15 */
16
17
53d96ca @kakaroto Port all payloads to the new pl3.h.S framework
authored
18 #include "pl3.h.S"
692ffd3 @kakaroto Adding a payload to trace all sc calls (syscalls and hypercalls). Use…
authored
19
53d96ca @kakaroto Port all payloads to the new pl3.h.S framework
authored
20 #include "send_eth.h.S"
21 #include "memory_patching.h.S"
2276ccf @kakaroto Factor out the code to hook the hvsc instructions into its own file
authored
22 #include "hook_hvsc.h.S"
692ffd3 @kakaroto Adding a payload to trace all sc calls (syscalls and hypercalls). Use…
authored
23
53d96ca @kakaroto Port all payloads to the new pl3.h.S framework
authored
24 RESIDENT_AREA_START()
824d8d8 @kakaroto Add peek&poke to the tracer payloads since they are developer payload…
authored
25 #include "dev_syscalls.h.S"
53d96ca @kakaroto Port all payloads to the new pl3.h.S framework
authored
26 #include "memory_patching_res.h.S"
27 #include "hvsc_handler.h.S"
28 #include "syscall_handler.h.S"
29 #include "send_eth_res.h.S"
30 RESIDENT_AREA_END()
31
32 #include "patch_table.h.S"
33
34 payload_main:
ad982d8 @kakaroto fix the stupid prolog/epilog mixup
authored
35 // prolog
692ffd3 @kakaroto Adding a payload to trace all sc calls (syscalls and hypercalls). Use…
authored
36 mflr %r0
37 stdu %r1, -0xa0(%r1)
38 std %r30, 0x90(%r1)
39 std %r31, 0x98(%r1)
40 std %r0, 0xb0(%r1)
41
42 GET_CURRENT_PAGE(%r3, %r31)
43 MEM_BASE (%r30) // Load 0x8000000000000000 in %r30
44
53d96ca @kakaroto Port all payloads to the new pl3.h.S framework
authored
45 COPY_RESIDENT_AREA(%r30, %r31)
692ffd3 @kakaroto Adding a payload to trace all sc calls (syscalls and hypercalls). Use…
authored
46
53d96ca @kakaroto Port all payloads to the new pl3.h.S framework
authored
47 LOAD_FUNC_PTR(memory_patching)
48 LOAD_FUNC_PTR(send_eth)
49 INIT_SEND_ETH(%r30)
692ffd3 @kakaroto Adding a payload to trace all sc calls (syscalls and hypercalls). Use…
authored
50
824d8d8 @kakaroto Add peek&poke to the tracer payloads since they are developer payload…
authored
51 ADD_SYSCALL (%r30, syscall_peek_desc, 6)
52 ADD_SYSCALL (%r30, syscall_poke_desc, 7)
53
53d96ca @kakaroto Port all payloads to the new pl3.h.S framework
authored
54 APPLY_PATCHES(%r30, %r31)
692ffd3 @kakaroto Adding a payload to trace all sc calls (syscalls and hypercalls). Use…
authored
55 // Replace hvsc after we copy our handler to the resident area
56 // because another thread might be running at the same time
57 // and if it calls hvsc and we're not yet ready, then we're
58 // screwed
2276ccf @kakaroto Factor out the code to hook the hvsc instructions into its own file
authored
59 bl hook_hvsc
692ffd3 @kakaroto Adding a payload to trace all sc calls (syscalls and hypercalls). Use…
authored
60
ad982d8 @kakaroto fix the stupid prolog/epilog mixup
authored
61 // epilog
692ffd3 @kakaroto Adding a payload to trace all sc calls (syscalls and hypercalls). Use…
authored
62 ld %r30, 0x90(%r1)
63 ld %r31, 0x98(%r1)
64 ld %r0, 0xb0(%r1)
65 addi %r1, %r1, 0xa0
66 mtlr %r0
67 blr
Something went wrong with that request. Please try again.