Skip to content

Commit

Permalink
Eliminated old files and utilizes the SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoStretch authored Jul 11, 2024
1 parent 3592da2 commit acbd43a
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 42 deletions.
14 changes: 9 additions & 5 deletions installer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,26 @@ OBJCOPY := objcopy
ODIR := build
SDIR := source
IDIRS := -I$(LIBPS4)/include -Iinclude
MAPFILE := $(shell basename $(CURDIR)).map
CFLAGS := $(IDIRS) -Os -std=gnu11 -ffunction-sections -fdata-sections -fno-builtin -nostartfiles -nostdlib -Wall -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=small -fpie
LFLAGS := -Xlinker -T $(LIBPS4)/linker.x -Xlinker -Map=$(MAPFILE) -Wl,--build-id=none -Wl,--gc-sections
LDIRS := -L$(LIBPS4)
MAPFILE := $(shell basename "$(CURDIR)").map
CFLAGS := $(IDIRS) -Os -std=c11 -ffunction-sections -fdata-sections -fno-builtin -nostartfiles -nostdlib -Wall -Wextra -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=small -fpie -fPIC
LFLAGS := $(LDIRS) -Xlinker -T $(LIBPS4)/linker.x -Xlinker -Map="$(MAPFILE)" -Wl,--build-id=none -Wl,--gc-sections
CFILES := $(wildcard $(SDIR)/*.c)
SFILES := $(wildcard $(SDIR)/*.s)
OBJS := $(patsubst $(SDIR)/%.c, $(ODIR)/%.o, $(CFILES)) $(patsubst $(SDIR)/%.s, $(ODIR)/%.o, $(SFILES))


LIBS := -lPS4

TARGET = $(shell basename $(CURDIR)).bin

# Default value for FW if not set
FW ?= 0
CFLAGS += -DFW=$(FW)

$(TARGET): $(ODIR) $(OBJS)
$(CC) $(LIBPS4)/crt0.s $(LIBPS4)/source/syscall.s $(ODIR)/*.o -o temp.t $(CFLAGS) $(LFLAGS)
$(OBJCOPY) -O binary temp.t $(TARGET)
$(CC) $(LIBPS4)/crt0.s $(ODIR)/*.o -o temp.t $(CFLAGS) $(LFLAGS) $(LIBS)
$(OBJCOPY) -O binary temp.t "$(TARGET)"
rm -f temp.t

$(ODIR)/%.o: $(SDIR)/%.c
Expand Down
5 changes: 2 additions & 3 deletions installer/include/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
#define VERSION "2.1.5"

//#define DEBUG_SOCKET

#define LOG_IP "192.168.1.3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
#define LOG_PORT 9023
#define DEBUG_IP "192.168.2.2"
#define DEBUG_PORT 9023

struct payload_info {
uint8_t* buffer;
Expand Down
2 changes: 1 addition & 1 deletion installer/include/offsets/755.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define PRISON0_addr 0x0113B728
#define ROOTVNODE_addr 0x01B463E0
#define PMAP_STORE_addr 0x0215EA40
#define DT_HASH_SEGMENT_addr 0x00C05068
#define DT_HASH_SEGMENT_addr 0x00D068D0

// Functions
#define pmap_protect_addr 0x001A9800
Expand Down
2 changes: 1 addition & 1 deletion installer/include/offsets/900.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
#define enable_debug_log_patch 0x000B7B17

// enable uart output
#define enable_uart_patch 0x0152BF5D
#define enable_uart_patch 0x0152BF60

#endif
25 changes: 14 additions & 11 deletions installer/source/main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <ps4.h>
#include "ps4.h"

#include "defines.h"
#include "ddebug.h"
#include "offsets.h"

#define PS4_UPDATE_FULL_PATH "/update/PS4UPDATE.PUP"
Expand Down Expand Up @@ -117,19 +116,19 @@ static inline void patch_update(void)
mkdir(PS4_UPDATE_TEMP_PATH, 0777);
}

int _main(struct thread *td)
{
int _main(struct thread *td)
{
int result;

initKernel();
initLibc();

#ifdef DEBUG_SOCKET
initNetwork();
initDebugSocket();
initNetwork();
DEBUG_SOCK = SckConnect(DEBUG_IP, DEBUG_PORT);
#endif

printfsocket("Starting...\n");
printf_debug("Starting...\n");

struct payload_info payload_info;
payload_info.buffer = (uint8_t *)kpayload;
Expand All @@ -139,17 +138,21 @@ int _main(struct thread *td)

result = kexec(&install_payload, &payload_info);
result = !result ? 0 : errno;
printfsocket("install_payload: %d\n", result);
printf_debug("install_payload: %d\n", result);

patch_update();

initSysUtil();
notify("Welcome to PS4HEN v"VERSION);

printfsocket("Done.\n");
char fw_version[6] = {0};
get_firmware_string(fw_version);
printf_notification("Welcome to PS4HEN v"VERSION"\nPS4 Firmware %s", fw_version);

printf_debug("Done.\n");

#ifdef DEBUG_SOCKET
closeDebugSocket();
printf_debug("Closing socket...\n");
SckClose(DEBUG_SOCK);
#endif

return result;
Expand Down
20 changes: 10 additions & 10 deletions kpayload/include/offsets/700-702.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@
#define mountpfs__sceSblPfsSetKeys_hook1 0x006B534B
#define mountpfs__sceSblPfsSetKeys_hook2 0x006B557C

// SceShellCore patches - bypass firmware checks
#define check_disc_root_param_patch 0x0013CE3D
#define app_installer_patch 0x0013CF20
#define check_system_version 0x003B3B38
#define check_title_system_update_patch 0x003B6270

// libkernel_sys.sprx patches - debug patches
#define sceSblRcMgrIsAllowDebugMenuForSettings_patch 0x0001D240
#define sceSblRcMgrIsStoreMode_patch 0x0001D5A0
Expand All @@ -102,15 +96,21 @@

// SceShellCore patches - call nidf_libSceDipsw
#define nidf_libSceDipsw_patch1 0x0017428A
#define nidf_libSceDipsw_patch2 0x0023A6FC
#define nidf_libSceDipsw_patch2 0x00318FF1
#define nidf_libSceDipsw_patch3 0x007F5D2A
#define nidf_libSceDipsw_patch4 0x009CE12A

// SceShellCore patches - bypass firmware checks
#define check_disc_root_param_patch 0x0013CE3D
#define app_installer_patch 0x0013CF20
#define check_system_version 0x003B3B38
#define check_title_system_update_patch 0x003B6270

// SceShellCore patches - enable remote pkg installer
#define enable_data_mount_patch 0x00318FE1

// SceShellCore patches - enable VR without spoof
#define enable_psvr_patch 0x00D629A0
#define enable_psvr_patch 0x00D07C5F

// SceShellCore patches - enable fpkg
#define enable_fpkg_patch 0x003C5900
Expand All @@ -123,9 +123,9 @@
#define ext_hdd_patch 0x005C6AAD

// SceShellCore patches - enable debug trophies
#define debug_trophies_patch 0x006E44D6
#define debug_trophies_patch 0x006E44D9

// SceShellCore patches - disable screenshot block
#define disable_screenshot_patch 0x003826D2
#define disable_screenshot_patch 0x000D61F6

#endif
10 changes: 2 additions & 8 deletions kpayload/include/offsets/750-751.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@
#define mountpfs__sceSblPfsSetKeys_hook1 0x006D9757
#define mountpfs__sceSblPfsSetKeys_hook2 0x006D9988

// SceShellCore patches - bypass firmware checks
#define check_disc_root_param_patch 0x00132F9D
#define app_installer_patch 0x00133080
#define check_system_version 0x003B0B47
#define check_title_system_update_patch 0x003B3200

//libkernel_sys.sprx patches - debug patches
#define sceSblRcMgrIsAllowDebugMenuForSettings_patch 0x0001D140
#define sceSblRcMgrIsStoreMode_patch 0x0001D4A0
Expand Down Expand Up @@ -129,9 +123,9 @@
#define ext_hdd_patch 0x005BCF2D

// SceShellCore patches - enable debug trophies
#define debug_trophies_patch 0x0071759B
#define debug_trophies_patch 0x006E3C19

// SceShellCore patches - disable screenshot block
#define disable_screenshot_patch 0x0038C8B6
#define disable_screenshot_patch 0x000CD6B6

#endif
4 changes: 2 additions & 2 deletions kpayload/include/offsets/755.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@
#define ext_hdd_patch 0x005BCF2D

// SceShellCore patches - enable debug trophies
#define debug_trophies_patch 0x006E3C16
#define debug_trophies_patch 0x006E3C19

// SceShellCore patches - disable screenshot block
#define disable_screenshot_patch 0x0037E6CF
#define disable_screenshot_patch 0x000CD6B6

#endif
2 changes: 1 addition & 1 deletion kpayload/source/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ PAYLOAD_CODE void install_syscall_hooks()
writeCr0(cr0 & ~X86_CR0_WP);
flags = intr_disable();

// proc
// proc
install_syscall(107, sys_proc_list);
install_syscall(108, sys_proc_rw);
install_syscall(109, sys_proc_cmd);
Expand Down

0 comments on commit acbd43a

Please sign in to comment.