feat(libSceNKWebKit): validate UUIDs and default URL ports #13766

Merged
hyvvs merged 5 commits from upstream-pr/13766 into main 2026-11-04 08:32:00 +00:00
hyvvs commented 2026-10-31 05:05:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hyvvs on 2026-10-31T05:05:42Z.


What

Implement two previously throwing libSceNKWebKit exports using Sony's public PS5 WebKit 11.x source:

  • WTF::isVersion4UUID(WTF::StringView) — parse the 36-byte hex UUID and check version 4 and RFC 4122 variant.
  • WTF::isDefaultPortForProtocol(uint16_t, WTF::StringView) — classify the five lowercase source-default schemes ftp, http, https, ws, wss.

Restore the verified 16-byte release WTF::StringView by-value guest ABI (pointer at +0, 32-bit length at +8, 8-bit flag at +12), add a focused guest test, and update technical debt. This source-guided implementation is not PS5-hardware-measured, and it does not implement the separate testing-only port override registration exports.

Primary references: WTF UUID.cpp, WTF URL.cpp, URLParser.cpp, and StringView.h.

Scanner: 7,229/27,404 to 7,231/27,404 (+2).

Tested

  • Windows MinGW direct guest-ABI linked executable, C++20 Release, -Wall -Wextra -Werror: PASS.
  • Ubuntu WSL isolated guest test with GCC AddressSanitizer + UndefinedBehaviorSanitizer + leak detection: PASS.
  • python -m unittest discover -s tools/tests -p 'test_progress*.py' -q: 96 tests OK (2 skipped).
  • python tools/tests/test_progress.py: 56 tests OK (independent run).
  • python core/libs/tests/test_public_headers.py --audit-only: 393 libraries, 24,536 exports validated.
  • python tools/check_conventions.py --base upstream/main: passed.
  • Standalone Export.cpp C++20 object compile: passed.
  • Full CMake test target not run: isolated worktree's third-party git submodules are not populated; SDL2 and ffmpeg-core CMake sources missing. No console or title test.

Checklist

  • Based on current main; no other open PR implements these exact functions.
  • One topic per PR; follow-ups in separate PR.
  • No code comments except technical debt.
  • Unimplemented paths keep throwing; functional caveats documented.
  • No investigation documents or images added to repository.
  • No new third-party dependencies.
  • Generic source-guided behavior, not title-specific.
  • Depends on: none.
  • Fixes: none.
  • Unblocks: none claimed.
  • GPUs tested: n/a.
  • AI-assisted: yes.

Open #13500 changes shared NKWebKit inventory files and CMake: an exploratory git merge-tree reports merge conflicts (without an overlapping export implementation). Reconcile on whichever lands later.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5094748539 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13766). Originally posted by [hyvvs](https://github.com/hyvvs) on 2026-10-31T05:05:42Z. --- ### What Implement two previously throwing `libSceNKWebKit` exports using Sony's public PS5 WebKit 11.x source: - `WTF::isVersion4UUID(WTF::StringView)` — parse the 36-byte hex UUID and check version 4 and RFC 4122 variant. - `WTF::isDefaultPortForProtocol(uint16_t, WTF::StringView)` — classify the five lowercase source-default schemes `ftp`, `http`, `https`, `ws`, `wss`. Restore the verified 16-byte release `WTF::StringView` by-value guest ABI (pointer at +0, 32-bit length at +8, 8-bit flag at +12), add a focused guest test, and update technical debt. This source-guided implementation is not PS5-hardware-measured, and it does not implement the separate testing-only port override registration exports. Primary references: [WTF UUID.cpp](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/UUID.cpp), [WTF URL.cpp](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/URL.cpp), [URLParser.cpp](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/URLParser.cpp), and [StringView.h](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/text/StringView.h). Scanner: 7,229/27,404 to 7,231/27,404 (+2). ### Tested - Windows MinGW direct guest-ABI linked executable, C++20 Release, -Wall -Wextra -Werror: PASS. - Ubuntu WSL isolated guest test with GCC AddressSanitizer + UndefinedBehaviorSanitizer + leak detection: PASS. - `python -m unittest discover -s tools/tests -p 'test_progress*.py' -q`: 96 tests OK (2 skipped). - `python tools/tests/test_progress.py`: 56 tests OK (independent run). - `python core/libs/tests/test_public_headers.py --audit-only`: 393 libraries, 24,536 exports validated. - `python tools/check_conventions.py --base upstream/main`: passed. - Standalone `Export.cpp` C++20 object compile: passed. - Full CMake test target not run: isolated worktree's third-party git submodules are not populated; SDL2 and ffmpeg-core CMake sources missing. No console or title test. ### Checklist - [x] Based on current main; no other open PR implements these exact functions. - [x] One topic per PR; follow-ups in separate PR. - [x] No code comments except technical debt. - [x] Unimplemented paths keep throwing; functional caveats documented. - [x] No investigation documents or images added to repository. - [x] No new third-party dependencies. - [x] Generic source-guided behavior, not title-specific. - [x] Depends on: none. - [x] Fixes: none. - [x] Unblocks: none claimed. - [x] GPUs tested: n/a. - [x] AI-assisted: yes. Open #13500 changes shared NKWebKit inventory files and CMake: an exploratory `git merge-tree` reports merge conflicts (without an overlapping export implementation). Reconcile on whichever lands later.
jotitadev commented 2026-10-31 06:23:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-31T06:23:52Z.

Review: COMMENTED


Linux run of head f196994bb5, merged (--no-commit) onto main 6a691f69ee. Ubuntu 26.04 (kernel 7.0), GCC 15.2.0, CMake 4.2.3, Ninja, Release, BUILD_TESTING=ON, i7-8700. The description only lists a standalone MinGW executable, so this is the first CMake/CTest run on Linux.

  • guest_nkwebkit_urls: passes 3/3.
  • Full build ok. Related subset nkwebkit: 3/3.
  • public_headers: 65/65.
  • Red: throwing at the top of isVersion4UUID and isDefaultPortForProtocol (a stand-in for the main stubs) makes guest_nkwebkit_urls abort 3/3.
  • With #13772 also merged, the tree merges cleanly and guest_nkwebkit_urls and guest_nkwebkit_url_protocols pass 3/3.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5721622611 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13766#pullrequestreview-5721622611). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-31T06:23:52Z. **Review:** COMMENTED --- Linux run of head `f196994bb5`, merged (`--no-commit`) onto `main` `6a691f69ee`. Ubuntu 26.04 (kernel 7.0), GCC 15.2.0, CMake 4.2.3, Ninja, Release, `BUILD_TESTING=ON`, i7-8700. The description only lists a standalone MinGW executable, so this is the first CMake/CTest run on Linux. - `guest_nkwebkit_urls`: passes 3/3. - Full build ok. Related subset `nkwebkit`: 3/3. - `public_headers`: 65/65. - Red: throwing at the top of `isVersion4UUID` and `isDefaultPortForProtocol` (a stand-in for the `main` stubs) makes `guest_nkwebkit_urls` abort 3/3. - With #13772 also merged, the tree merges cleanly and `guest_nkwebkit_urls` and `guest_nkwebkit_url_protocols` pass 3/3. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!13766
No description provided.