mirror of
https://github.com/Pharaoh2k/ps5debug-NG.git
synced 2026-10-21 19:33:05 -05:00
PS5 debugger payload, inspired by Ctn's ps5debug 1.0b5 and wire-compatible with it. Runs the wire-protocol server inside SceShellCore via an umtx-loaded installer that injects the embedded debugger ELF. Features: process scan/RPC/ELF-inject, on-console scan, full debugger (breakpoints, watchpoints, single-step, regs/FP/DR access), kernel R/W, server-side Zydis disassembly, on-console Keystone assembler (0xBDAA0024), foreground-app metadata (0xBDDD0006), server-side RBP stack walk (CMD_PROC_READ_STACK), klog forwarder (TCP 3232), rest-mode survival and a lot more. Supports FW families 3.x / 4.0 / 4.x (incl. 4.51) / 5.x / 6.x / 7.x / 7.5x / 8.x via the kpatch routine in installer/source/main.c. GPL-3.0-only.
51 lines
1.5 KiB
Makefile
51 lines
1.5 KiB
Makefile
# SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
SDK := ../ps5-payload-sdk/install
|
|
|
|
ifeq (,$(wildcard $(SDK)/toolchain/prospero.mk))
|
|
$(error SDK not built - run ../build.sh from the project root)
|
|
endif
|
|
|
|
include $(SDK)/toolchain/prospero.mk
|
|
|
|
ELF := build/debugger.elf
|
|
BUILD_DIR := build
|
|
|
|
ZYDIR := third_party/zydis
|
|
ZYDIS_OBJ := $(BUILD_DIR)/Zydis.o
|
|
|
|
KSDIR := third_party/keystone
|
|
CXXRT := third_party/cxxrt
|
|
|
|
CFLAGS := -Wall -O2 -I../common/include -Iinclude -I$(ZYDIR) -I$(KSDIR)/include
|
|
LDFLAGS := -Wl,--wrap=__patch_init
|
|
LDLIBS := -lSceLibcInternal -lkernel_sys -lSceNet -lSceNetCtl -lSceSysCore
|
|
|
|
ZYDIS_CFLAGS := -O3 -DNDEBUG -DZYAN_NO_LIBC -w -I../common/include -Iinclude -I$(ZYDIR)
|
|
|
|
CXXFILES := $(wildcard source/*.cpp)
|
|
CXX_OBJS := $(patsubst source/%.cpp,$(BUILD_DIR)/%.o,$(CXXFILES))
|
|
CXXFLAGS := -O2 -I../common/include -Iinclude -I$(KSDIR)/include
|
|
CXX_LDLIBS := -Wl,--start-group -L$(KSDIR)/lib -L$(CXXRT)/lib -lkeystone -lc++ -lc++abi -lunwind -Wl,--end-group
|
|
|
|
CFILES := $(wildcard ../common/source/*.c) $(wildcard source/*.c)
|
|
|
|
all: $(ELF)
|
|
|
|
$(BUILD_DIR):
|
|
mkdir -p $(BUILD_DIR)
|
|
|
|
$(ZYDIS_OBJ): $(ZYDIR)/Zydis.c $(ZYDIR)/Zydis.h | $(BUILD_DIR)
|
|
$(CC) -c -o $@ $< $(ZYDIS_CFLAGS)
|
|
|
|
$(BUILD_DIR)/%.o: source/%.cpp | $(BUILD_DIR)
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
$(ELF): $(CFILES) $(CXX_OBJS) $(ZYDIS_OBJ) | $(BUILD_DIR)
|
|
$(CC) $(CFLAGS) -o $@ $(CFILES) $(CXX_OBJS) $(ZYDIS_OBJ) $(LDFLAGS) $(LDLIBS) $(CXX_LDLIBS)
|
|
|
|
clean:
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
.PHONY: all clean
|