mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-27 00:28:14 +00:00
sceCesRefersUcsProfileCp858 threw. It now returns a single-byte profile accepted by sceCesSbcToUtf8, sceCesUtf8ToSbc and the MBCS context conversions. Code page 858 is code page 850 with byte 0xD5 mapped to the euro sign (U+20AC) instead of U+0131; that is the whole high half of ICU's ibm-858_P100-1997.ucm. Bytes 0x00-0x7F stay unchanged, as in the other single-byte profiles. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FzhWRMauD3ouc8kSxT2NnT
15 KiB
15 KiB
libSceCesCs technical debt
Silent stubs
- sceCesMbcsUcsContextInit (libSceCesCs) stores the profile pointer in the first 8 bytes of the caller's context; the console's context layout is not known. It returns the invalid-parameter error for a null context and, as a payload process on a PS5 (firmware 13.60) did, for a null profile. The signature
int sceCesMbcsUcsContextInit(union* context, const union* mbcsUcsPrf)follows the Orbital IDA type database.sceCesRefersUcsProfileCp1251returns a profile accepted bysceCesSbcToUtf8,sceCesUtf8ToSbcand the MBCS context conversions, with the Windows-1251 table of Microsoft's bestfit1251.txt, except byte 0x98, which is unassigned - EUC-JP (CP51932) conversions (libSceCesCs):
sceCesUcsProfileInitEucJpCp51932marks the caller's sheet with an 8-byte tag and returns it as the profile. Decoding follows the console (see thesceCesEucJpToUtf8entry), with the Microsoft code page 932 table read through the JIS row/cell arithmetic (JisX0208.hpp); the console does not decode or encode JIS X 0212 either way (U+02D8 answered0x805C0020). Encoding takes the lowest cell of a character. Signatures follow orbital - Shift-JIS (CP932) conversions (libSceCesCs): decoding matches a payload process on a PS5 (firmware 13.60) for every two-byte input through
sceCesMbcsStrToUcs2Str, in result, lengths and output.sceCesUcsProfileInitSJis1997Cp932tags the caller's sheet and returns it as the profile. The string conversions decode ASCII, half-width katakana (0xA1-0xDF) and two-byte sequences (0x81-0x9Fand0xE0-0xFClead,0x40-0x7Eand0x80-0xFCtrail) through the CP932 table (JisX0208.hpp), including the IBM extensions0xFA40-0xFC4B. The user-defined area0xF040-0xF9FCand unassigned cells answerUNASSIGNED_CODE, an invalid lead or trailINVALID_ENCODE, a cut sequenceSRC_BUFFER_END. Signatures follow orbital
Unknown function info
- Unicode scalar conversions (libSceCesCs) - console error precedence, optional length pointers and length units are unverified. Signatures follow the Orbital type database; names are in the aerolib table pinned by
tools/nid_names.py. Encoding follows Unicode section 3.9. Each call converts one scalar, including zero and U+FEFF, without a terminator or byte-order detection; lengths count bytes for UTF-8 and 16-bit units for UTF-16. Native forms use host byte order (supported hosts are little-endian). Errors follow the existing CES converters, not console measurements, and failure leaves outputs unchanged. No console or title comparison has been run - sceCesEucJpToUtf8 and sceCesEucJpToUcs2 (libSceCesCs) with the CP51932 profile follow a payload process on a PS5 (firmware 13.60): every two-byte input and every
0x8Fthree-byte input gives the console's result, length and output (the test pins a hash of both sweeps). Bytes below 0xA0 other than 0x0E, 0x8E and 0x8F convert to themselves; JIS X 0212 is not decoded, so0x8Fforms return0x805C0020in rows X 0212 leaves empty and0x805C0014elsewhere; a null profile returns0x805C0004, and the lengths are cleared first and then set as the console sets them. Their signatures follow the Orbital type database linked above. The console reads any other profile pointer as a sheet, where these return the invalid-parameter error. - Shift-JIS and EUC-JP scalar conversions (libSceCesCs) - errors, their precedence and the optional length pointers of
sceCesSJisTo*,sceCesEucJpTo{Utf16,Utf32}*andsceCes{Ucs2,Utf8,Utf16,Utf32}*To{SJis,EucJp}are unverified against the console. Signatures follow the Orbital type database linked above; the CP932 and CP51932 table and profile assumptions above apply. A profile of another encoding answersINVALID_PARAMETER, a surrogate or a value above U+10FFFFINVALID_ENCODE, a code point outside the BMPUNASSIGNED_CODE. UTF-8 input is decoded assceCesUtf8ToSbcdecodes it, so overlong forms answer0x805C0015.sceCesSJisCodeToJisX0208andsceCesJisX0208ToSJisCodedo not check that the cell is assigned; theirINVALID_ENCODEfor rows or cells outside 1-94 andINVALID_DST_BUFFERfor a null output are not console measurements - Strict JIS X 0208 profiles (libSceCesCs) - the tables were measured on a PS5 (
sceCesMbcToUtf32andsceCesUtf32ToMbcover every one- and two-byte sequence and every scalar); the errors follow the other JIS profiles, a missing SS2 or SS3 answeringINVALID_ENCODE. The table is CP932's without rows 13 and 89-92 and with seven cells changed (0x213DU+2014 and the six of JIS0208.TXT). Cell0x2140is U+005C insceCesUcsProfileInitSJis1997X0208, whose bytes0x5Cand0x7Eare U+00A5 and U+203E, and U+FF3C in the EUC-JP profiles, which keep ASCII and also encode U+00A5 and U+203E as0xA1EFand0xA1B1. Per SharpProspero,X0208Ss2adds SS2 katakana andX0208Ss2Ss3SS3 JIS X 0212 - UTF-16 and UTF-32 forms of the single-byte and MBCS string conversions (libSceCesCs) - errors, their precedence and the optional length pointers of
sceCesSbcTo{Ucs2,Utf16,Utf32}*,sceCes{Ucs2,Utf16,Utf32}*ToSbc,sceCesMbcsStr{To,Get}{Utf16,Utf32}*andsceCes{Utf16,Utf32}Str{To,Get}Mbcs*are unverified against the console. Signatures follow the Orbital type database linked above. They followsceCesSbcToUtf8,sceCesUtf8ToSbcand the UTF-8 MBCS string forms with the profiles and tables listed above. A surrogate or a value above U+10FFFF answersINVALID_ENCODE, a valid code point no profile mapsUNASSIGNED_CODE. The string forms stop at a zero code unit, write no terminator and count code units - GBK (CP936) and EUC-CN conversions (libSceCesCs) -
sceCesUcsProfileInitGbkCp936andsceCesUcsProfileInitEucCnGb2312mark the caller's sheet with an 8-byte tag; the console's profile layout is not known. Both use one table (Cp936.hpp) read from Microsoft's CP936.TXT; the EUC-CN profile accepts only its0xA1-0xFElead and trail bytes, so it includes the GBK cells inside that range and the CP936 forms of0xA1A4(U+00B7) and0xA1AA(U+2014) instead of GB 2312's. That the console's GB 2312 and CP936 tables equal it is not measured. User-defined areas andsceCesGbUcsProfileSet*are not handled. Errors, their precedence and the length pointers follow the Shift-JIS forms above and are unverified - GB 18030 profiles (libSceCesCs) - the console's tables are not measured, and the sources disagree on 26 sequences. The 2000 profile follows ICU's
gb-18030-2000.ucmat icu-data d9d3a6ed (before ICU-8427), which matches Python's codec:0xA8BCis U+E7C7 and0x8135F437U+1E3F. The 2005 profile followsgb-18030-2005.ucm(91850aec), which swaps those two and maps 24 PUA cells to U+FE10-U+FE19, U+9FB4-U+9FBB and six supplementary ideographs, keeping the PUA code points as encode fallbacks. Two-byte cells are CP936 plus Gb18030.hpp; four-byte runs include ICU'sgb18030Ranges. The inits tag the sheet like GBK's; thesceCesGb*,sceCesMbc*and MBCS string forms accept them. The full mapping is assumed as the default ofsceCesGbUcsProfileSetUdaMappingandSet4ByteCharRange, which throw. Supplementary characters to UCS-2 answerUNASSIGNED_CODE; other errors follow the GBK forms - sceCesRefersUcsProfileCp1250 (libSceCesCs) - returns a profile accepted by
sceCesSbcToUtf8,sceCesUtf8ToSbcand the MBCS context conversions, with the Windows-1250 table of Microsoft's bestfit1250.txt, except bytes 0x81, 0x83, 0x88, 0x90 and 0x98, which are unassigned. PPSA34501 fails to start without this export (qYu6y1E0Qbg) - sceCesSbcToUtf8 and sceCesUtf8ToSbc (libSceCesCs) follow a payload process on a PS5 (firmware 13.60): the three tables match the console byte for byte, with Cp1252 bytes 0x81, 0x8D, 0x8F, 0x90 and 0x9D unassigned; a null profile returns
0x805C0004; and the length and output are cleared first, as the console does.sceCesUtf8ToSbcdecodes leads up to 0xFD (5- and 6-byte forms), returns0x805C0015for overlong forms and surrogates and reports the measured lengths. The console reads any other profile pointer as a table, where these return the invalid-parameter error; which of a null profile and a scalar above U+10FFFF it reports first is not measured - MBCS string conversions (libSceCesCs) -
sceCesUtf8StrToMbcsStr,sceCesUcs2StrToMbcsStr,sceCesMbcsStrToUtf8Str,sceCesMbcsStrToUcs2Strand theirGet*Lenforms follow a payload process on a PS5 (firmware 13.60) with the Cp1252 and EUC-JP profiles: the lengths are cleared and a terminator is written first, then the context, the source and the output are checked in that order; a source limit of 0 reads up to the terminating zero; the output keeps room for a terminator; and on an error the characters before it stay converted, terminated and counted. They decode UTF-8 assceCesUtf8ToSbcdoes, and a UTF-16 surrogate answers0x805C0015. The UCS-2 forms and the other profiles were not measured beyond these cases. A zero-filled context converted nothing and returned 0 on the console, where this returns the invalid-parameter error - EUC-JP and Shift-JIS encoding (libSceCesCs) with the CP51932 and CP932 profiles gives the result, lengths and bytes a payload process read on a PS5 (firmware 13.60) for every UCS-2 value through
sceCesUcs2StrToMbcsStr(the test pins a hash of both sweeps): the JIS forms U+00A2, U+00A3, U+00A5, U+00AC, U+2014, U+2016, U+203E, U+2212 and U+301C encode to the cells of their Microsoft forms, U+FEFF is consumed and writes nothing, EUC-JP writes U+0080-U+009F other than U+008E and U+008F as single bytes and answersUNASSIGNED_CODEfor U+000E, and Shift-JIS answers0x805C0024for U+0080-U+009F. Decoding those bytes back is unchanged - Generic MBCS character and Shift-JIS code helpers (libSceCesCs) - UTF-8/UTF-16 buffer errors and size pointers are unverified. Measured on a PS5: the single-character encoders (
sceCesUtf32ToMbcover U+0000-U+110001 per profile, surrogates, a one-byte target) give 0x805C0015 for a surrogate, 0x805C0014 past U+10FFFF, the needed length withDST_BUFFER_ENDand 0 otherwise; a rejected decoded character (sceCesMbcTo*and each encoding'sTo{Ucs2,Utf8,Utf16,Utf32}, notsceCesEucJpToUcs2/ToUtf8) stores its length (the bytes before a NUL after the lead, the needed length when truncated, 1 for a bad lead, the sequence for a bad or unassigned trail), a zero UCS-2/UTF-32 character and no UTF-8/UTF-16 units.sceCesMbcTo*andsceCes*ToMbctake any profile the MBCS context accepts.sceCesSJisGetCode/PutCodeare unchecked;sceCesSJisCodeToJisX0213and back use JIS X 0213 annex 1. Signatures follow Orbital - Single-byte profiles (libSceCesCs) - the console's tables for these 27 profiles are not verified. Each returns a profile accepted by
sceCesSbcToUtf8,sceCesUtf8ToSbcand the MBCS context conversions, with bytes 0x00-0x7F unchanged and the high half of a public table: ISO 8859-1, -2, -4, -5, -9, -10, -13, -14, -15 and -16 from unicode.org, code pages 437, 737, 775, 850, 852, 855, 860-863, 865 and 866 from Microsoft's PC tables, KOI8-R and KOI8-U from unicode.org, and 1254, 1256 and 1258 from Microsoft's best-fit tables, whose unassigned bytes map to C1 controls as in Cp1250. Profiles whose public table leaves bytes undefined or maps them to private use still throw - sceCesRefersUcsProfileCp858 (libSceCesCs) - the console's table is not verified. The profile is the Cp850 one with byte 0xD5 mapped to U+20AC instead of U+0131, which is the whole high half of ICU's ibm-858_P100-1997.ucm; bytes 0x00-0x7F stay unchanged as in the other single-byte profiles, not swapped as in IBM's control mapping
- libSceCesCs firmware 3.20 pending exports - 61 symbol names are present in the PS5 3.20 libSceCesCs export list. Their signatures and console behaviour are unverified. The declarations use the existing no-parameter unknown-signature convention solely to resolve imports, and every call throws through
NotImplemented_nid_no_patch. - EUC-KR, UHC and Big5 conversions (libSceCesCs) - the errors are assumed; the decode tables and the Big5 duplicate choices were measured on a PS5 (
sceCesMbcToUtf32and eachToUtf8over every one- and two-byte sequence): UHC and Big5 match, EUC-KR apart from its single bytes. The tables are Microsoft's CP949.TXT, plus0xA2E8U+327E from KS X 1001:2002, and CP950.TXT; EUC-KR is CP949 limited to bytes0xA1-0xFE, below0x80ASCII; the KS X 1003 profile is not implemented. User-defined areas answerUNASSIGNED_CODE. Big5 encoding takes the lower of two cells except for U+5341 and U+5345, as a PS5'ssceCesUtf32ToMbcdoes for every scalar (CP950 takes the higher cell of U+2550, U+255E, U+2561 and U+256A; the console does not). The profiles tag the caller's sheet like the EUC-JP profile