feat(libSceNet): implement sceNetResolverStartNtoaMultipleRecordsEx #1838

Merged
LeandroLP23 merged 2 commits from upstream-pr/1838 into main 2026-10-09 08:02:48 +00:00
LeandroLP23 commented 2026-10-08 21:12:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-08T21:12:14Z.


What

PS5VR (PPSA99177 v1.2.0, theghostonline/PS5VR, GPL-3.0) stops at start-up on main:

FAIL: unresolved ELF import sT4nBQKUPqM from libSceNet.prx

sT4nBQKUPqM is sceNetResolverStartNtoaMultipleRecordsEx (tools/nid_names.py). It is also the first stop on main 4b6ab6bb of PPSA99505 Jelly5, PPSA99515 Emby5 and PPSA99997 Nuvio (@SleglJan's run in #1578), and of EVO-PLAYER PPSA99039 v0.11.0 (@hikazey, #1578).

  • The call fills the 384-byte resolver info: ten 32-byte records (IPv4 address at +0, family at +16), the record count at +320 and the IPv4 count at +324, the rest zeroed. The layout is SharpProspero's SceNetResolverInfoEx (Interop/Net/Socket.cs). It matches shadPS4's OrbisNetResolverInfo and the offsets the titles read (PS5VR app/tools/native-app/stubs/eng_dns.c, EVO-PLAYER tools/native-app/stubs/evo_dns.c).
  • It returns 0 on success, like sceNetResolverStartNtoa. The callers treat any non-negative return as success, and on an error they fall back to sceNetResolverStartNtoa.
  • The lookup is the one sceNetResolverStartNtoa already does (host getaddrinfo, IPv4). It is now a shared lookup_ipv4 that also drops duplicate addresses. sceNetResolverStartNtoa behaves as before and still returns the first address.
  • Errors are the same as sceNetResolverStartNtoa's: null hostname or info gives EINVAL, an unknown resolver gives EBADF, a failed lookup gives RESOLVER_ENODNS.
  • Only flags 0 is implemented, which is what these titles pass. Any other value throws with the flags in the message. shadPS4 reads 0x1 as async, 0x10000 as no numeric hosts and 0x1000000/0x2000000 as AAAA lookups, but no hardware data backs that, so it is left for a title that needs it. timeout and retry are ignored, as in sceNetResolverStartNtoa.

Overlaps: #1287 (the non-Ex sceNetResolverStartNtoaMultipleRecords) adds the same 384-byte layout next to this code, and #1502 changes the resolver id check in sceNetResolverStartNtoa. Whichever lands second needs a small rebase. #1287 could reuse lookup_ipv4.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, Release, on main 04477932:

  • PS5VR gets past this import and stops at the next one, 6kPnj51T62Y from libSceVideoOut.prx (sceVideoOutGetResolutionStatus, #1714).
  • guest_sce_net, 3/3. New checks: localhost gives 0 with one or more records, 127.x in the first record, family 2, equal counts, and zeroed unused bytes; null hostname and null info give EINVAL; a .invalid host gives RESOLVER_ENODNS; a destroyed resolver gives EBADF.
  • tools/check_conventions.py passes.

Linux and Windows: fork CI https://github.com/LeandroLP23/AnyPS5/actions/runs/37842913253, all jobs pass (on the same change based on aa277b38; the rebase onto 04477932 only brings in a shader commit).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4792850032 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1838). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-08T21:12:14Z. --- ### What PS5VR (PPSA99177 v1.2.0, [theghostonline/PS5VR](https://github.com/theghostonline/PS5VR), GPL-3.0) stops at start-up on `main`: ``` FAIL: unresolved ELF import sT4nBQKUPqM from libSceNet.prx ``` `sT4nBQKUPqM` is `sceNetResolverStartNtoaMultipleRecordsEx` (`tools/nid_names.py`). It is also the first stop on `main` 4b6ab6bb of PPSA99505 Jelly5, PPSA99515 Emby5 and PPSA99997 Nuvio (@SleglJan's run in #1578), and of EVO-PLAYER PPSA99039 v0.11.0 (@hikazey, #1578). - The call fills the 384-byte resolver info: ten 32-byte records (IPv4 address at +0, family at +16), the record count at +320 and the IPv4 count at +324, the rest zeroed. The layout is SharpProspero's `SceNetResolverInfoEx` (`Interop/Net/Socket.cs`). It matches shadPS4's `OrbisNetResolverInfo` and the offsets the titles read (PS5VR `app/tools/native-app/stubs/eng_dns.c`, EVO-PLAYER `tools/native-app/stubs/evo_dns.c`). - It returns 0 on success, like `sceNetResolverStartNtoa`. The callers treat any non-negative return as success, and on an error they fall back to `sceNetResolverStartNtoa`. - The lookup is the one `sceNetResolverStartNtoa` already does (host `getaddrinfo`, IPv4). It is now a shared `lookup_ipv4` that also drops duplicate addresses. `sceNetResolverStartNtoa` behaves as before and still returns the first address. - Errors are the same as `sceNetResolverStartNtoa`'s: null hostname or info gives EINVAL, an unknown resolver gives EBADF, a failed lookup gives `RESOLVER_ENODNS`. - Only `flags` 0 is implemented, which is what these titles pass. Any other value throws with the flags in the message. shadPS4 reads 0x1 as async, 0x10000 as no numeric hosts and 0x1000000/0x2000000 as AAAA lookups, but no hardware data backs that, so it is left for a title that needs it. `timeout` and `retry` are ignored, as in `sceNetResolverStartNtoa`. Overlaps: #1287 (the non-Ex `sceNetResolverStartNtoaMultipleRecords`) adds the same 384-byte layout next to this code, and #1502 changes the resolver id check in `sceNetResolverStartNtoa`. Whichever lands second needs a small rebase. #1287 could reuse `lookup_ipv4`. ### Tested Windows 11, MinGW-w64 GCC 15.2.0, Release, on `main` 04477932: - PS5VR gets past this import and stops at the next one, `6kPnj51T62Y` from `libSceVideoOut.prx` (`sceVideoOutGetResolutionStatus`, #1714). - `guest_sce_net`, 3/3. New checks: `localhost` gives 0 with one or more records, `127.x` in the first record, family 2, equal counts, and zeroed unused bytes; null hostname and null info give EINVAL; a `.invalid` host gives `RESOLVER_ENODNS`; a destroyed resolver gives EBADF. - `tools/check_conventions.py` passes. Linux and Windows: fork CI https://github.com/LeandroLP23/AnyPS5/actions/runs/37842913253, all jobs pass (on the same change based on `aa277b38`; the rebase onto `04477932` only brings in a shader commit). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes (Claude Code)
hikazey commented 2026-10-08 21:25:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hikazey on 2026-10-08T21:25:54Z.


Second title: EVO-PLAYER PPSA99039 v0.11.0 (release ZIP, sha256 687c0f0f…5349; eboot.bin and the bundled libc.prx unwrapped from their SELFs). This commit merged onto main 364a56b6, Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, relinked with --windows.

  • On main: FAIL: unresolved ELF import sT4nBQKUPqM from libSceNet.prx.
  • With this PR: past it, stops at FAIL: unresolved ELF import 2G6i6hMIUUY from libkernel.prx (getdents, #1634). That's the stop @SleglJan's table in #1578 lists for PPSA99039 before v0.11.0 added the Ex call.

The title's own resolver code isn't reached yet (the import resolution fails before it runs), so this shows the import binding only. EVO-PLAYER calls it with timeout, retry and flags 0, so the flags != 0 throw won't trigger for it.

build guest_sce_net
this PR 5/5 passed
info->count forced to 0, test kept 5/5 failed
full suite with this PR 481/481 passed

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069357615 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1838#issuecomment-6069357615). Originally posted by [hikazey](https://github.com/hikazey) on 2026-10-08T21:25:54Z. --- Second title: EVO-PLAYER PPSA99039 v0.11.0 (release ZIP, sha256 `687c0f0f…5349`; `eboot.bin` and the bundled `libc.prx` unwrapped from their SELFs). This commit merged onto `main` `364a56b6`, Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, relinked with `--windows`. - On `main`: `FAIL: unresolved ELF import sT4nBQKUPqM from libSceNet.prx`. - With this PR: past it, stops at `FAIL: unresolved ELF import 2G6i6hMIUUY from libkernel.prx` (`getdents`, #1634). That's the stop @SleglJan's table in #1578 lists for PPSA99039 before v0.11.0 added the `Ex` call. The title's own resolver code isn't reached yet (the import resolution fails before it runs), so this shows the import binding only. EVO-PLAYER calls it with `timeout`, `retry` and `flags` 0, so the `flags != 0` throw won't trigger for it. | build | `guest_sce_net` | | --- | --- | | this PR | 5/5 passed | | `info->count` forced to 0, test kept | 5/5 failed | | full suite with this PR | 481/481 passed | AI-assisted: yes (Claude Code).
github-actions[bot] commented 2026-10-08 21:29:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T21:29:22Z.


Progress report (ae91d97 → f054374)

➖ System libraries: 84.76% (+0.0%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceNet sceNetResolverStartNtoaMultipleRecordsEx
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069411525 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1838#issuecomment-6069411525). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T21:29:22Z. --- <!-- progress-report --> ### Progress report (ae91d97 → f054374) ➖ **System libraries**: 84.76% (+0.0%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceNet | `sceNetResolverStartNtoaMultipleRecordsEx` | </details>
MarcZX10 commented 2026-10-08 21:47:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T21:47:29Z.


Thanks for the second title’s exact import and the ablation result. The PR’s current Build and Conventions checks are green, and this Ex NID remains distinct from #1287’s non-Ex export. One contribution-rule follow-up before merge: the head is 9 commits behind current main (94b1eecb, merge base 0447793). Please rebase onto current main and rerun checks on the final head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069681160 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1838#issuecomment-6069681160). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T21:47:29Z. --- Thanks for the second title’s exact import and the ablation result. The PR’s current Build and Conventions checks are green, and this Ex NID remains distinct from #1287’s non-Ex export. One contribution-rule follow-up before merge: the head is 9 commits behind current `main` (`94b1eecb`, merge base `0447793`). Please rebase onto current `main` and rerun checks on the final head.
LeandroLP23 commented 2026-10-08 21:56:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-08T21:56:25Z.


Rebased onto main 94b1eecb; no conflicts.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069803915 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1838#issuecomment-6069803915). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-08T21:56:25Z. --- Rebased onto `main` 94b1eecb; no conflicts.
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!1838
No description provided.