Commit Graph
55 Commits
Author SHA1 Message Date
Dean 2a7e4a8fc6 Merge pull request #14318 from MarcZX10/fix/np-strncpy-read-past-maxlength
fix(libSceNpCommon): copy at most the length limit in sceNpStrncpyToBuf
2026-11-03 08:48:11 +13:00
Dean 8bc49558d2 Merge pull request #12919 from hypermoist/feat/np-title-secret
feat(libSceNpCommon): implement sce::np::NpTitleSecret
2026-11-03 06:25:36 +13:00
Dean 4662fbc62a Merge pull request #12839 from hypermoist/feat/np-allocator-ex
feat(libSceNpCommon): implement the _sceNpAllocatorEx helpers
2026-11-03 05:14:22 +13:00
Dean d0dcbc30a4 Merge pull request #12818 from hypermoist/feat/np-util-xml-escape
feat(libSceNpCommon): implement sceNpUtilXmlEscape and sceNpUtilXmlUnescape
2026-11-03 05:13:35 +13:00
Dean cd673bd828 Merge pull request #11601 from x-labb/fix-11567-callout-self-term
fix(libSceNpCommon): refuse to terminate a callout context from its own callout
2026-11-03 01:25:59 +13:00
hypermoist 8a39ee6955 Merge remote-tracking branch 'upstream/main' into feat/np-util-xml-escape
# Conflicts:
#	core/libs/prx/libSceNpCommon/PendingExportsRound7.cpp
#	core/libs/prx/libSceNpCommon/include/Api.hpp
#	docs/dev/debt/libSceNpCommon.md
2026-11-02 01:20:05 +13:00
Dean 4317481a47 Merge pull request #12825 from hypermoist/feat/np-util-jid
feat(libSceNpCommon): implement sceNpUtilParseJid and sceNpUtilJidToNpId
2026-11-02 00:22:13 +13:00
MarcZX10 6739179eed test(libSceNpCommon): cut an unterminated sceNpStrncpyToBuf source at the length limit
TestHexAndCopies now copies a source whose first terminator comes after the length limit, and expects exactly the first four characters. On the previous copy helper the new check aborts; with the fix guest_np_common_runtime passes. Both results come from the archive build described in the PR body.
2026-11-01 08:43:21 +00:00
Dean a98f9b6282 Merge pull request #13272 from wrocketdev/test/npcommon
test(libSceNpCommon): cover event flag clear and cancel and condition wakeups
2026-11-01 10:23:05 +13:00
AdriàandClaude Sonnet 5.5 3a8e811a96 fix(libSceNpCommon): cast the remaining const virtual table slots without casting away const
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 10:59:12 +01:00
Emanuele a73dbff3e8 fix(libSceNpCommon): cast the const virtual table slots without casting away const 2026-10-31 10:59:08 +01:00
hypermoist cbb5a530e2 Merge remote-tracking branch 'upstream/main' into feat/np-title-secret
# Conflicts:
#	core/libs/prx/libSceNpCommon/PendingExportsRound7.cpp
#	core/libs/prx/libSceNpCommon/Runtime.cpp
#	core/libs/prx/libSceNpCommon/include/Api.hpp
#	core/libs/tests/GuestNpCommonRuntime.cpp
#	docs/dev/debt/libSceNpCommon.md
2026-10-31 19:16:42 +13:00
hypermoist 49b912222e Merge remote-tracking branch 'upstream/main' into feat/np-allocator-ex
# Conflicts:
#	core/libs/tests/GuestNpCommonRuntime.cpp
2026-10-31 19:16:23 +13:00
hypermoist c5094d4235 Merge remote-tracking branch 'upstream/main' into feat/np-util-jid
# Conflicts:
#	core/libs/prx/libSceNpCommon/include/Api.hpp
#	docs/dev/debt/libSceNpCommon.md
2026-10-31 19:15:45 +13:00
hypermoist ad1b7612f6 Merge remote-tracking branch 'upstream/main' into feat/np-util-xml-escape
# Conflicts:
#	core/libs/tests/GuestNpCommonRuntime.cpp
2026-10-31 19:15:44 +13:00
x-labb 22d478c78d fix(libSceNpCommon): refuse to terminate a callout context from its own callout
sceNpCalloutTermCtx called from a callout of the same context could not join the worker thread, destroyed the context's mutex and condition anyway, and returned. The worker then locked the destroyed mutex and the host crashed. The call now throws, and the gap is recorded in the library's technical debt.
2026-10-31 00:58:20 +01:00
hypermoistandClaude Opus 5.5 79624b828c feat(libSceNpCommon): implement sce::np::NpCommId and sceNpUtilParseTitleId
The constructors, destructors, Clear, IsEmpty, Equals, Parse, Build and the
comparison operators of sce::np::NpCommId, and the C export
sceNpUtilParseTitleId they use, follow libSceNpCommon.sprx of firmware
13.60, checked against 26,501 firmware results.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 23:08:07 +01:00
Adrià c84f79ed3b Merge pull request #13451 from BunnyFl/feat/libscenpcommon-json-parser
feat(libSceNpCommon): implement the JSON parser family
2026-10-30 22:56:24 +01:00
hypermoistandClaude Opus 5.5 c9e6fe5d17 feat(libSceNpCommon): implement sce::np::RefObject
The constructors, destructors, AddRef and Release of sce::np::RefObject
follow libSceNpCommon.sprx of firmware 13.60, checked against 7,200
firmware results.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 21:41:08 +01:00
hypermoistandClaude Opus 5.5 e8a765b48d feat(libSceNpCommon): implement the sce::np::StreamReader and StreamWriter helpers
Read, ReadAll, ReadData, SkipAll and SkipData on StreamReader, and Write,
WriteData and WriteFilledData on StreamWriter, with and without a StreamCtx,
follow libSceNpCommon.sprx of firmware 13.60, checked against 20,426
firmware results.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:27:47 +01:00
BunnyFlandClaude Opus 5.5 2cf3e71b13 test(libSceNpCommon): attribute the 16th-level close to firmware 13.42, not the console
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:06:20 +01:00
BunnyFlandClaude Opus 5.5 82e8fa7539 test(libSceNpCommon): pin the firmware's lost close inside a 16th-level object
Firmware 13.42 keeps the type of the 16th nested container in the context
slot that also holds the saved parser state, so a call that ends inside a
16th-level object leaves the outermost object open. The parser here does
the same; the test pins it, and the debt file records it together with
where the parser's behaviour comes from.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 17:52:47 +01:00
BunnyFlandClaude Opus 5.5 2087b15d4d feat(libscenpcommon): implement the JSON parser family
sceNpJsonParse, sceNpJsonParseBuf and sceNpJsonParseEx with their
Init calls, and the sceNpServerErrorJson exports, follow firmware
13.42: a resumable byte-by-byte parser that walks a rule table level
by level (member keys compared without case, array elements, keyless
wildcard entries until the first unmatched container, a descend flag)
and calls the caller's handler for each matched container, key and
value. The Buf form uses caller key and value buffers, and the Ex form
also reports the stream offset of each event, delivers long strings
and numbers in pieces and reports everything when no rules are given.
The server error calls read error.code (or a top-level code for the
Multi form) and fall back to the HTTP status.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 15:55:02 +01:00
hypermoist 724c31161b Merge remote-tracking branch 'upstream/main' into feat/np-allocator-ex
# Conflicts:
#	core/libs/tests/GuestNpCommonRuntime.cpp
2026-10-31 01:53:25 +13:00
hypermoist 93fbebef0a Merge remote-tracking branch 'upstream/main' into feat/np-memory-stream
# Conflicts:
#	core/libs/prx/libSceNpCommon/Runtime.cpp
#	core/libs/prx/libSceNpCommon/include/Api.hpp
#	core/libs/tests/GuestNpCommonRuntime.cpp
#	docs/dev/debt/libSceNpCommon.md
2026-10-31 01:27:48 +13:00
hypermoistandClaude Opus 5.5 38bd414bee feat(libSceNpCommon): implement sce::np::MemoryStreamReader and MemoryStreamWriter
Constructors, destructors, Read and Write follow libSceNpCommon.sprx of
firmware 13.60, checked against 13,400 firmware results.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 00:33:51 +13:00
ThomasandClaude Opus 5.5 7dc229b9ab test(libSceNpCommon): cover event flag clear and cancel and condition wakeups
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 11:27:11 +01:00
hypermoist c776cd1d66 Merge branch 'feat/np-title-id-object' into feat/np-title-secret 2026-10-30 23:12:25 +13:00
hypermoist b7098523d0 Merge remote-tracking branch 'upstream/main' into feat/np-title-id-object 2026-10-30 23:12:19 +13:00
hypermoist f1410344c1 Merge remote-tracking branch 'upstream/main' into feat/np-allocator-ex 2026-10-30 23:12:17 +13:00
hypermoist 4d91330aac Merge remote-tracking branch 'upstream/main' into feat/np-util-jid
# Conflicts:
#	core/libs/prx/libSceNpCommon/PendingExportsRound7.cpp
#	core/libs/prx/libSceNpCommon/include/Api.hpp
#	docs/dev/debt/libSceNpCommon.md
2026-10-30 22:56:38 +13:00
Dean 66d362c782 Merge pull request #12836 from hypermoist/feat/np-object-operators
feat(libSceNpCommon): implement the sce::np::Object new and delete operators
2026-10-30 22:49:46 +13:00
hypermoist ce3bf24090 Merge branch 'feat/np-title-id-object' into feat/np-title-secret 2026-10-30 16:10:42 +13:00
hypermoist d6ce925c50 Merge branch 'feat/np-object-operators' into feat/np-title-id-object 2026-10-30 16:10:41 +13:00
hypermoist 2bb0c23ed0 Merge branch 'feat/np-object-operators' into feat/np-allocator-ex 2026-10-30 16:10:41 +13:00
hypermoistandClaude Opus 5.5 228adbf903 test(libSceNpCommon): run the Object size-wrap row with a succeeding allocator
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 16:10:39 +13:00
hypermoistandClaude Opus 5.5 006fa3aea5 refactor(libSceNpCommon): leave NpTitleSecret::Clear to #12823
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 03:20:05 +13:00
hypermoistandClaude Opus 5.5 bd6a912ba6 test(libSceNpCommon): cover sce::np::NpTitleSecret
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 03:17:35 +13:00
hypermoistandClaude Opus 5.5 67bab6bdfe fix(libSceNpCommon): store the high hex digit before checking the low one in sceNpStrParseHex
sceNpStrParseHex and sceNpStrnParseHex in firmware 13.60 write the high
nibble of each byte before they read the low digit, so a refused low digit
leaves that byte as the high nibble shifted left by four.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 03:10:33 +13:00
hypermoistandClaude Opus 5.5 949680de9a feat(libSceNpCommon): implement sce::np::NpTitleId
Implements the sce::np::NpTitleId constructors, destructors, assignment,
Clear, IsEmpty, Parse, ConstructFromTitleId, Build and comparisons from
libSceNpCommon.sprx of firmware 13.60. operator==(SceNpTitleId, NpTitleId)
stays a stub; #12866 implements it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 02:51:27 +13:00
hypermoistandClaude Opus 5.5 1088b5575a test(libSceNpCommon): resolve the merge in the runtime test and pin the _sceNpAllocatorEx allocator calls
The previous merge commit kept conflict markers in GuestNpCommonRuntime.cpp;
this keeps both sides and adds the recorded-allocator rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 01:31:11 +13:00
hypermoistandClaude Opus 5.5 1a6579414a test(libSceNpCommon): pin the allocator calls of the _sceNpAllocatorEx helpers
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 01:28:10 +13:00
hypermoistandClaude Opus 5.5 2d12b228ab test(libSceNpCommon): pin the stored allocator, header tail and size wrap of the Object operators
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 01:25:53 +13:00
hypermoistandClaude Opus 5.5 36cf6fb45f test(libSceNpCommon): pin the JID byte classes, dot trimming, space skipping and suffix
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 01:19:51 +13:00
hypermoistandClaude Opus 5.5 01a22cc28b test(libSceNpCommon): pin the XML escape bounds, entity matching and lead bytes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 01:18:05 +13:00
hypermoistandClaude Opus 5.5 4dc74fc967 feat(libSceNpCommon): implement the _sceNpAllocatorEx helpers
Malloc, Realloc and Free call the allocator's own functions with its
context, Strdup and Strndup copy a string into memory from it, and
ConvertAllocator returns the allocator inside the extended one, as
libSceNpCommon.sprx of firmware 13.60 does (read from disassembly, not
measured on a console). Realloc and Free were NotImplemented stubs; the
other four were not exported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 01:06:12 +13:00
hypermoistandClaude Opus 5.5 72cde05a64 feat(libSceNpCommon): implement the sce::np::Object new and delete operators
The ten operators allocate an object behind a 16-byte header that keeps its
allocator and free it through that allocator, as libSceNpCommon.sprx of
firmware 13.60 does (read from disassembly, not measured on a console). Five
were NotImplemented stubs; the other five were not exported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 00:58:39 +13:00
hypermoistandClaude Opus 5.5 9b48ab5214 feat(libSceNpCommon): implement sceNpUtilParseJid and sceNpUtilJidToNpId
Read from libSceNpCommon.sprx of firmware 13.60 (disassembly, not measured
on a console).

- sceNpUtilParseJid(jid, text, buffer, bufferSize, required) skips leading
  spaces, splits user@domain/resource into terminated copies in the
  buffer and points the jid at them, or only measures without a jid or a
  buffer. It skips exactly one character after the trimmed domain, as the
  module does, and clears the jid when the buffer is too small.
- sceNpUtilJidToNpId(npId, jid) accepts XX.YY.<label>.playstation.net
  domains, users of 1 to 16 bytes and resources of up to 4, and builds the
  npid from the user, the four domain characters and the resource.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 00:39:40 +13:00
hypermoistandClaude Opus 5.5 4b94c6905c feat(libSceNpCommon): implement sceNpUtilXmlEscape and sceNpUtilXmlUnescape
Both take (dst, dstSize, src, srcLength, required), as in libSceNpCommon.sprx
of firmware 13.60 (read from disassembly, not measured on a console).

- Escaping writes the five predefined entities for " & ' < >, copies tab,
  LF, CR, other printable ASCII and UTF-8 sequences, and refuses other
  control characters, DEL and malformed UTF-8 with 0x80550608.
- Unescaping turns the five entities back and copies every other byte.
- Both write a terminator, report the length with it, measure without a
  destination, and return 0x80550601 for a missing source, a zero length
  or neither a destination nor a length, and 0x80550602 when the
  destination is too small.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 00:10:21 +13:00
MarcZX10 e6083ad5c5 test(libSceNpCommon): escape into a filled buffer, size a null-destination query, split a surrogate pair
sceNpUtilJsonEscape has to stay inside a partly filled 16 byte buffer and refuse
one without a terminator, sceNpUtilJsonUnescape has to report the length of a
query with a null destination and size 0, and sceNpUtilJsonGetOneChar has to
reject a high surrogate that is not followed by a second unicode escape.
2026-10-28 04:25:02 +00:00