mirror of
https://github.com/itsPLK/PS5-Lapy-JB-Daemon.git
synced 2026-10-21 08:14:36 -05:00
Standalone homebrew daemon for PS5 that mimics etaHEN's jailbreak-on-demand API. Apps that write /download0/etahen_jailbreak from inside their sandbox get their ucred bumped (caps + authid + uid + sceAttr + sandbox escape via fd_rdir/jdir) the same way etaHEN does it. NO etaHEN required. Multi-fw via ps5-payload-sdk's runtime KERNEL_ADDRESS_* externs : the SDK auto-resolves kernel symbols per-fw at boot, so the binary works on every fw covered by the SDK + kstuff (3.00 -> 12.00) with no fw-specific code. Build : export PS5_PAYLOAD_SDK=<sdk-root> && make Install : copy lapy_jb_daemon.elf + homebrew.js to /data/homebrew/lapy_jb/ Credits : libhijacker (illusion + LightingMod), ps5-payload-sdk (John Tornblom), offsets_v940 multi-fw module (Team PHU / Arksama).
38 lines
1.6 KiB
C++
38 lines
1.6 KiB
C++
// Multi-fw libhijacker offsets override.
|
|
//
|
|
// libhijacker's vanilla offsets.cpp hardcodes fw 9.40 kernel-symbol offsets.
|
|
// This file replaces it with a multi-fw resolution path : ps5-payload-sdk
|
|
// already exposes the absolute kernel virtual addresses at runtime via the
|
|
// KERNEL_ADDRESS_* extern globals (auto-populated per-fw from kern.sdk_version,
|
|
// see ps5/kernel.h), so the only job here is converting absolute VA -> offset
|
|
// from kdata_base — which is what libhijacker's offsets:: namespace expects.
|
|
//
|
|
// Compile this .o BEFORE -lhijacker on the link line so the linker resolves
|
|
// the offsets:: symbols from here and skips the vanilla offsets.cpp.o that
|
|
// would otherwise be pulled from libhijacker.a.
|
|
//
|
|
// Covers every fw the SDK knows about (3.00 -> 12.00 via kstuff). On an
|
|
// unknown fw the SDK returns 0 and libhijacker fails cleanly with NULL
|
|
// attach — same graceful failure as the old 9.40-hardcoded path on wrong fw.
|
|
|
|
extern "C" {
|
|
#include <stddef.h>
|
|
#include <ps5/kernel.h>
|
|
}
|
|
|
|
namespace offsets {
|
|
|
|
// Convert absolute kernel VA to offset from kernel_base. Signed-int
|
|
// subtraction so the high-half canonical addresses cancel cleanly.
|
|
static inline size_t rel(intptr_t absolute_va) {
|
|
return (size_t)(absolute_va - KERNEL_ADDRESS_DATA_BASE);
|
|
}
|
|
|
|
size_t allproc() { return rel(KERNEL_ADDRESS_ALLPROC); }
|
|
size_t security_flags() { return rel(KERNEL_ADDRESS_SECURITY_FLAGS); }
|
|
size_t qa_flags() { return rel(KERNEL_ADDRESS_QA_FLAGS); }
|
|
size_t utoken_flags() { return rel(KERNEL_ADDRESS_UTOKEN_FLAGS); }
|
|
size_t root_vnode() { return rel(KERNEL_ADDRESS_ROOTVNODE); }
|
|
|
|
}
|