WIP: Add minimal C++ self-elevation example #2

Closed
blackbearreloaded wants to merge 11 commits from feature/self-elevation-example into main
blackbearreloaded commented 2026-08-30 14:08:43 -05:00 (Migrated from github.com)

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.

## 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.
blackbearreloaded commented 2026-08-30 14:13:27 -05:00 (Migrated from github.com)

The PR acceptance build passed and produced a downloadable image:

The 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.

The PR acceptance build passed and produced a downloadable image: - [Download `self-elevation-example-116f7656ef13514f5e4fbb59ce69180a458fcbeb`](https://github.com/blackbearreloaded/ps5-native-app-boilerplate/actions/runs/33330104256/artifacts/9737408829) - CI `PPSA99791.ffpfsc` SHA-256: `440de12833b73f10110f06c95fdab16a82b4fe344e68480065db4a0164186313` - Embedded `eboot.bin` SHA-256: `cbf152a7c2dff5c16d7506cf0179719c26036001061ab1be217f722d0a171c77` - Logical FFPFSC manifest SHA-256: `7b0f490f723d949e25ce537ded29b2082dd5c4f73be4e38170d32e8aa8516fff` The 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.
archiver-bot closed this pull request 2026-10-11 01:48:21 -05:00

Pull request closed

Sign in to join this conversation.
No description provided.