WIP: Add minimal C++ self-elevation example #2
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-blackbearreloaded/ps5-native-app-boilerplate!2
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/self-elevation-example"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose
This PR is the minimal native-application companion to blackbearreloaded/kstuff-lite#1. It shows the ordinary application-side flow for requesting one caller-only capability profile without exposing the protocol internals.
Example
The PR adds only examples/README.md and examples/self-elevation/src/main.cpp. The C++ example calls kstuff_probe(), requests KSTUFF_PROFILE_DATA_ACCESS, writes /data/hello-from-sandbox.txt, closes and reopens it, and verifies the content. The process then remains alive for normal shell-mediated closure.
Constants
The example contains no raw syscall IDs, kstuff operation numbers, ABI magic values, authority IDs, credential offsets, or firmware offsets. Those details are owned and encapsulated by the public kstuff.h header. O_WRONLY, O_CREAT, O_TRUNC, and O_RDONLY are standard file-open flags supplied by fcntl.h. The value 0666 is the conventional file permission mode and is unrelated to kstuff.
The earlier process-memory, ptrace, mount, raw-socket, privileged-device, receipt, and staging code belonged to the hardware-validation harness. It obscured the normal use case and has been removed from this developer-facing PR.
Validation
The repository formatting check, lint suite, three GoogleTests, and five host integration tests pass on WSL. The simplified source also compiles successfully as a PS5 x86-64 target object with the proposed kstuff header. The underlying data-access request and /data write/read flow were previously validated on firmware 6.02 and 12.70; this presentation-only simplification has not been rerun on hardware.
The PR acceptance build passed and produced a downloadable image:
self-elevation-example-116f7656ef13514f5e4fbb59ce69180a458fcbebPPSA99791.ffpfscSHA-256:440de12833b73f10110f06c95fdab16a82b4fe344e68480065db4a0164186313eboot.binSHA-256:cbf152a7c2dff5c16d7506cf0179719c26036001061ab1be217f722d0a171c777b0f490f723d949e25ce537ded29b2082dd5c4f73be4e38170d32e8aa8516fffThe outer FFPFSC byte hash differs from the locally hardware-tested package
because the package includes build-time metadata. The embedded executable hash
and logical manifest exactly match the firmware 6.02 validation build.
Pull request closed