Skip to content

Commit

Permalink
Add some syscalls for Apollo compatibility
Browse files Browse the repository at this point in the history
Huge thanks to everyone involved with ps4debug, and special appreciation to @BestPig for figuring this out!
https://github.com/BestPig/ps4-hen-vtx
  • Loading branch information
EchoStretch authored Jul 7, 2024
1 parent a913c0d commit b1dbd13
Show file tree
Hide file tree
Showing 46 changed files with 999 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# PS4HEN v2.1.4
# PS4HEN v2.1.5

## Features
- Current Supports 7.55 - 11.00
- Current Supports 7.00 - 11.00
- Homebrew Enabler
- Jailbreak
- Sandbox Escape
Expand Down
2 changes: 1 addition & 1 deletion installer/include/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __DEFINES_H__
#pragma once

#define VERSION "2.1.4"
#define VERSION "2.1.5"

//#define DEBUG_SOCKET

Expand Down
12 changes: 11 additions & 1 deletion installer/include/offsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
#error FW not set
#endif

#if FW==755
#if FW==700
#include "offsets/700-702.h"
#elif FW==701
#include "offsets/700-702.h"
#elif FW==702
#include "offsets/700-702.h"
#elif FW==750
#include "offsets/750-751.h"
#elif FW==751
#include "offsets/750-751.h"
#elif FW==755
#include "offsets/755.h"
#elif FW==800
#include "offsets/800-801.h"
Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/1000.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define sys_dynlib_dlsym_patch1 0x0019025F
#define sys_dynlib_dlsym_patch2 0x001BEA40

// disable some check for mmap
#define vm_map_protect_check 0x0039207B

// enable debug log
#define enable_debug_log_patch 0x000C51D7

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/1001.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
#define sys_dynlib_dlsym_patch1 0x0019025F
#define sys_dynlib_dlsym_patch2 0x001BEA40

// disable some check for mmap
#define vm_map_protect_check 0x0039207B

// enable debug log
#define enable_debug_log_patch 0x000C51D7

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/1050.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define sys_dynlib_dlsym_patch1 0x00213088
#define sys_dynlib_dlsym_patch2 0x002DAB60

// disable some check for mmap
#define vm_map_protect_check 0x0047B2EC

// enable debug log
#define enable_debug_log_patch 0x00450F67

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/1070-1071.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define sys_dynlib_dlsym_patch1 0x00213088
#define sys_dynlib_dlsym_patch2 0x002DAB60

// disable some check for mmap
#define vm_map_protect_check 0x0047B2EC

// enable debug log
#define enable_debug_log_patch 0x00450F67

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/1100.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
#define enable_debug_rifs_patch1 0x0064BFD0
#define enable_debug_rifs_patch2 0x0064C000

// disable some check for mmap
#define vm_map_protect_check 0x0035C8EC

// enable debug log
#define enable_debug_log_patch 0x002FCCB7

Expand Down
43 changes: 43 additions & 0 deletions installer/include/offsets/700-702.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#ifndef __OFFSETS_H__
#define __OFFSETS_H__
#pragma once

// 7.00-7.02
#define XFAST_SYSCALL_addr 0x000001C0

// Names - Data
#define PRISON0_addr 0x00113E398
#define ROOTVNODE_addr 0x0022C5750
#define PMAP_STORE_addr 0x0022C5268
#define DT_HASH_SEGMENT_addr 0x000D09F78

// Functions
#define pmap_protect_addr 0x0003E18A0
#define pmap_protect_p_addr 0x0003E18E7

// Patches
// debug menu error
#define debug_menu_error_patch1 0x005016FA
#define debug_menu_error_patch2 0x0050296C

// disable signature check
#define disable_signature_check_patch 0x006BE880

// enable debug RIFs
#define enable_debug_rifs_patch1 0x00668270
#define enable_debug_rifs_patch2 0x006682A0

// allow sys_dynlib_dlsym in all processes
#define sys_dynlib_dlsym_patch1 0x0009547B
#define sys_dynlib_dlsym_patch2 0x002F2C20

// disable some check for mmap
#define vm_map_protect_check 0x00264C08

// enable debug log
#define enable_debug_log_patch 0x000BC817

// enable uart output
#define enable_uart_patch 0x01A6EAA0

#endif
43 changes: 43 additions & 0 deletions installer/include/offsets/750-751.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#ifndef __OFFSETS_H__
#define __OFFSETS_H__
#pragma once

// 7.50-7.51
#define XFAST_SYSCALL_addr 0x000001C0

// Names - Data
#define PRISON0_addr 0x0113B728
#define ROOTVNODE_addr 0x01B463E0
#define PMAP_STORE_addr 0x0215EA40
#define DT_HASH_SEGMENT_addr 0x00C05068

// Functions
#define pmap_protect_addr 0x001A9800
#define pmap_protect_p_addr 0x001A9847

// Patches
// debug menu error
#define debug_menu_error_patch1 0x004FF322
#define debug_menu_error_patch2 0x0050059C

// disable signature check
#define disable_signature_check_patch 0x006DD9A0

// enable debug RIFs
#define enable_debug_rifs_patch1 0x00668140
#define enable_debug_rifs_patch2 0x00668170

// allow sys_dynlib_dlsym in all processes
#define sys_dynlib_dlsym_patch1 0x004523C4
#define sys_dynlib_dlsym_patch2 0x00029A30

// disable some check for mmap
#define vm_map_protect_check 0x003014C8

// enable debug log
#define enable_debug_log_patch 0x0026F827

// enable uart output
#define enable_uart_patch 0x01564910

#endif
3 changes: 3 additions & 0 deletions installer/include/offsets/755.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define sys_dynlib_dlsym_patch1 0x004523C4
#define sys_dynlib_dlsym_patch2 0x00029A30

// disable some check for mmap
#define vm_map_protect_check 0x003014C8

// enable debug log
#define enable_debug_log_patch 0x0026F827

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/800-801.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define sys_dynlib_dlsym_patch1 0x0031953F
#define sys_dynlib_dlsym_patch2 0x000951C0

// disable some check for mmap
#define vm_map_protect_check 0x003EC68B

// enable debug log
#define enable_debug_log_patch 0x00430BC7

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/803.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define sys_dynlib_dlsym_patch1 0x0031953F
#define sys_dynlib_dlsym_patch2 0x000951C0

// disable some check for mmap
#define vm_map_protect_check 0x003EC68B

// enable debug log
#define enable_debug_log_patch 0x00430BC7

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/850.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define sys_dynlib_dlsym_patch1 0x00017C2F
#define sys_dynlib_dlsym_patch2 0x003AD040

// disable some check for mmap
#define vm_map_protect_check 0x0014D6DB

// enable debug log
#define enable_debug_log_patch 0x0015D657

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/852.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define sys_dynlib_dlsym_patch1 0x00017C2F
#define sys_dynlib_dlsym_patch2 0x003AD040

// disable some check for mmap
#define vm_map_protect_check 0x0014D6DB

// enable debug log
#define enable_debug_log_patch 0x0015D657

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/900.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
#define sys_dynlib_dlsym_patch1 0x0023B67F
#define sys_dynlib_dlsym_patch2 0x00221B40

// disable some check for mmap
#define vm_map_protect_check 0x00080B8B

// enable debug log
#define enable_debug_log_patch 0x000B7B17

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/903.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define enable_debug_rifs_patch1 0X0064E3F0
#define enable_debug_rifs_patch2 0X0064E420

// disable some check for mmap
#define vm_map_protect_check 0x00080B8B

// enable debug log
#define enable_debug_log_patch 0X000B7AC7

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/904.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define enable_debug_rifs_patch1 0X0064E3F0
#define enable_debug_rifs_patch2 0X0064E420

// disable some check for mmap
#define vm_map_protect_check 0x00080B8B

// enable debug log
#define enable_debug_log_patch 0X000B7AC7

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/950.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define enable_debug_rifs_patch1 0x00643EA0
#define enable_debug_rifs_patch2 0x00643ED0

// disable some check for mmap
#define vm_map_protect_check 0x00196D3B

// enable debug log
#define enable_debug_log_patch 0x00205557

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/951.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define enable_debug_rifs_patch1 0x00643EA0
#define enable_debug_rifs_patch2 0x00643ED0

// disable some check for mmap
#define vm_map_protect_check 0x00196D3B

// enable debug log
#define enable_debug_log_patch 0x00205557

Expand Down
3 changes: 3 additions & 0 deletions installer/include/offsets/960.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#define enable_debug_rifs_patch1 0x00643EA0
#define enable_debug_rifs_patch2 0x00643ED0

// disable some check for mmap
#define vm_map_protect_check 0x00196D3B

// enable debug log
#define enable_debug_log_patch 0x00205557

Expand Down
3 changes: 3 additions & 0 deletions installer/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ int install_payload(struct thread *td, struct install_payload_args* args)
kmem[2] = 0x00;
kmem[3] = 0x00;

// patch vm_map_protect check
memcpy((void *)(kernel_base + vm_map_protect_check), "\x90\x90\x90\x90\x90\x90", 6);

// install kpayload
memset(payload_buffer, 0, PAGE_SIZE);
memcpy(payload_buffer, payload_data, payload_size);
Expand Down
11 changes: 6 additions & 5 deletions kpayload/include/freebsd_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ struct proc_vm_map_entry {
vm_offset_t end;
vm_offset_t offset;
uint16_t prot;
};
} __attribute__((packed));

TYPE_BEGIN(struct uio, 0x30);
TYPE_FIELD(uint64_t uio_iov, 0);
Expand All @@ -150,10 +150,11 @@ TYPE_BEGIN(struct proc, 0x800); // XXX: random, don't use directly without fixin
TYPE_FIELD(struct filedesc *p_fd, 0x48);
TYPE_FIELD(int pid, 0xB0);
TYPE_FIELD(struct vmspace *p_vmspace, 0x168);
//TYPE_FIELD(char p_comm[32], 0x44C); // 5.0x
//TYPE_FIELD(char p_comm[32], 0x450); // 6.00-6.20
TYPE_FIELD(char p_comm[32], 0x454); // 5.5x, 6.5x, and 6.72
TYPE_FIELD(char p_comm[32], 0x454);
TYPE_FIELD(char titleid[16], 0x390);
TYPE_FIELD(char contentid[64], 0x3D4);
TYPE_FIELD(char path[64], 0x474);

TYPE_END();

#endif
#endif
Loading

0 comments on commit b1dbd13

Please sign in to comment.