Convert sfo.py and pkg.py to pure C#162
Merged
Merged
Conversation
Fix raw2h tool
Clean up
* Add SYSUTIL_LANG_* values to sysutil.h (ps3dev#130) * Update sysutil.h Add language return values for SYSUTIL_SYSTEMPARAM_ID_LANG * Fix sysAtomicSwap and sysAtomic64Swap macros Co-authored-by: OsirizX <osirisx99@gmail.com>
* Fix collect_dir double-slash bug, buf.size print-after-free, and remove dead code * Fix typos in sha1.h and version strings in sfo.c/pkg.c * Update sfo.c * Update pkg.c * move files --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Damián Parrino <bucanero@users.noreply.github.com>
Author
|
Tested and both tools provide the same output as the original python scripts.
pkg.py --contentid=UP0001-NP0APOLLO_00-0000000000000000 testapp/ out.pkgoutput from pkg --contentid=UP0001-NP0APOLLO_00-0000000000000000 testapp/ out.pkg |
TheMrIron2
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the Python
sfo.pyandpkg.pyPS3 toolchain utilities with standalone C implementations that produce identical output and accept the same CLI parameters. Eliminates the Python runtime dependency for SDK builds.New files
tools/ps3py/sfo.c— SFO create/inspect/XML-roundtrip (--fromxml,--toxml,-l,--title,--appid,-d,-p)tools/ps3py/pkg.c— PKG pack/list/extract (-c,-l,-x,-d); implements big-endian PKG format, SHA1 QA digest, stream-cipher encryption, and NPDRM SELF header injectiontools/ps3py/sha1.c/sha1.h— SHA1 implementation carried over from thefselftoolModified files
tools/ps3py/Makefile— addssfoandpkgbuild targets;installdeploys C binaries instead of Python scriptsppu_rules—SFO := sfo.py→SFO := sfo,PKG := pkg.py→PKG := pkgBugs fixed vs. the Python originals
collect_dir):snprintf("%s/%s", folder, name)with a trailing-slash folder (asppu_rulespasses) producedfolder//name, giving all filenames a leading/. This brokeUSRDIR/EBOOT.BINNPDRM SELF detection and caused incorrect 32-byte name alignment for that entry instead of 16.pack_pkg): Package Size and Data Size in stdout output always printed0becausebuf.sizewas read afterdynbuf_free().