Port PKAlloc from jxrlib JXRGlue.c at f7521879: allocate cb zeroed bytes with the guest calloc(1, cb), the heap PKFree already frees to, store the pointer through ppv, NULL included, and return WMP_errSuccess or WMP_errOutOfMemory (-101). A null ppv, which upstream dereferences, throws. Allocation.cpp starts with JXRGlue.c's Microsoft notice. Upstream stores it in Windows-1252; it is converted to UTF-8 (the copyright sign and the two bullets), with the text unchanged, because the repository accepts UTF-8 only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
4.6 KiB
libSceJxr technical debt
GUID exports
- GUID data exports use 84 values from the pinned JXR header. Their NIDs and bytes match version-labelled images; the labels are not authenticated. Runtime behavior on a console and complete consumer coverage are unverified. Four additional 4-byte interface identifiers have names and values matching the pinned upstream JXR implementation and both version-labelled images; their relative placement in a guest image and use by consumers are unverified. One older 8-byte writable object has a relocation and no matching later-image data export; its identity, lifetime and initialization remain unknown and it is not implemented.
Functional
-
PKAlloc: console behavior and ABI remain unverified. The implementation follows pinned jxrlib JXRGlue.c, using guest
calloc(1, cb)so allocations match the guest heap released byPKFree. It stores the allocation, including null on failure, and returnsWMP_errSuccess(0) orWMP_errOutOfMemory(-101) as a 64-bitERR. A nullppvthrows instead of the upstream null dereference; zero size follows guestcalloc. -
PixelFormatLookup uses pinned public jxrlib through a C bridge and a 56-byte LP64 guest record. BunnyFl reports firmware 13.42 native-PC comparisons: the 68 table entries match public jxrlib, and return values/record fields match across 802 cases repeated three times, except that the module clears padding bytes 28..31 on all 309 successes. This bridge now clears that four-byte range explicitly on success; it does not copy indeterminate C++ padding. This is attributed single-firmware evidence, not an author-run console measurement or proof of the complete Sony ABI/configuration. Module/library versions, other firmware and valid-mode null arguments remain unverified. Modes 0/1 perform forward GUID/reverse TIFF lookup; other modes and misses leave the entire record unchanged. Valid-mode null records and forward null GUIDs remain explicitly unsupported. Success borrows a read-only static GUID while the module is loaded; callers must not free it. Closes when: remaining Sony ABI, version/configuration and invalid-argument behavior are verified by attributable measurements or disassembly
-
PKFree (libSceJxr) follows Microsoft's jxrlib JXRGlue.c, whose four exported names the module shares: a non-null
ppvhas*ppvreleased with the guestfreeand set to null, and the result is alwaysWMP_errSuccess(0) as a 64-bitERR(long). That the console's module is built from jxrlib, and that itsPKFreereleases through libc'sfree, is inferred from the export names and not checked against the console's code. Closes when: the console'sPKFreeis disassembled or measured on a PS5 -
readIS and writeIS use the non-ARM, LP64
BitIOInfoandWMPStreamABI and packet algorithm from Microsoft's JPEG XR reference implementation. Console structure layouts and execution remain unverified. Profiling callbacks are omitted as in the reference Unix build withDISABLE_PERF_MEASUREMENT; the codec argument is unused. Where the reference uses an invalid pointer,std::invalid_argumentis thrown instead: a null bit state, stream or callback, a read-only read packet, and a null packet when a read copies its shadow or a successful write offsets it; a null packet still reaches the callback first. No codec is instantiated by these helpers; callers must supply the reference ring buffer and guest-ABI stream callbacks. -
The 131 additional exports in Export.cpp are present in the pinned firmware 13.60
libSceJxrexport inventory. Their parameter lists, return types and behavior are unverified. Parameterlessintdeclarations are import-resolution placeholders, not verified ABI prototypes; every entry throws throughNotImplemented_nid_no_patch. The_nid_postfixaliases keep the guest bindings distinct from private native helpers. No runtime functionality is implemented.