Skip to content

feat(libSceHttp): declare 34 exports with known signatures - #2265

Closed
brycebrower2008 wants to merge 1 commit into
boykopovar:mainfrom
brycebrower2008:feat/libscehttp-declare-exports
Closed

brycebrower2008 wants to merge 1 commit into
boykopovar:mainfrom
brycebrower2008:feat/libscehttp-declare-exports

Conversation

@brycebrower2008

Copy link
Copy Markdown

What

Declares 34 libSceHttp exports that the PS5 module has and no library defined, as throwing stubs: cookies and cookie jar limits (sceHttpAddCookie, sceHttpGetCookie, sceHttpCookieExport/Import/Flush, sceHttpSetCookieMax*, sceHttpSetCookieSendCallback, ...), proxy, GZIP and HTTP/0.9 switches, the nonblocking, auth and redirect getters, sceHttpGetEpoll, memory pool and cookie statistics, private SSL options and CA lists. Adds HttpCookieSendCallback next to HttpCookieRecvCallback in SceTypes.hpp.

Signatures follow shadPS4's http.h (PS4); TechnicalDebt records that they are not confirmed for the PS5.

How the functions were chosen: each one is in the PS5 module's export list in ps5-payload-dev/sdk sce_stubs (generated from firmware .sprx exports), its name hashes to the NID shadPS4 registers, no library in main defines that NID, and none of the open pull requests adds it (checked against the APS5_VABI definitions in the head of every open PR). Only functions with a published signature are included; exports whose signature nobody has published are left out rather than declared without parameters.

Tested

Linux (Ubuntu 24.04, GCC 13.3), full build with BUILD_TESTING=ON, with this branch merged together with the other three declaration PRs. ninja libs builds and NID-patches every library; patched_libraries, guest_http, guest_http_response_header, guest_http2, progress_report, nid_patcher_dynamic_strings, nid_patcher_symbol_versions and strict_nid_filter pass. readelf --dyn-syms on the patched .prx files shows each new function exported under its NID. guest_sce_net aborts in the test container on unmodified main too, because the container has no IPv6 (socket(AF_INET6) fails with EAFNOSUPPORT). tools/check_conventions.py --base origin/main passes. No title or homebrew run: these are throwing stubs, so they only change which imports bind at startup.

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

The PS5 libSceHttp exports these functions, but no library defined them,
so a title importing any of them failed to bind. They are added as
throwing stubs: cookies, cookie jar limits, proxy, GZIP, nonblocking
getters, epoll lookup, private SSL options and CA lists.

Signatures follow shadPS4's reverse-engineered PS4 libSceHttp; the PS5
export list is the one in ps5-payload-dev/sdk sce_stubs/libSceHttp.c.
TechnicalDebt records that the signatures are not confirmed for the PS5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpG7ipD1K8Dzbwq8U9jyvX

@Dextroid17 Dextroid17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Linux.

  • base d70b8998 (upstream/main) + head 6660a137.
  • Artifact control on the built module: unpatched/libSceHttp.prx carries 34 of the 34 declared functions with this PR, and 0 of them without it (main's module). Pre-existing neighbours (sceHttpCreateTemplate, sceHttpCreateRequestWithURL, sceHttpCreateRequest2, sceHttpCreateEpoll) present in both arms.
  • Citations checked against the source: shadPS4/src/core/libraries/network/http.h (fetched, 16,096 bytes). sceHttpAuthCacheFlush(int libhttpCtxId) matches exactly; sceHttpAddCookie and sceHttpCookieExport agree parameter for parameter (u64 -> uint64_t). No duplicates of any of the 34 names on main, and the TechnicalDebt.md bullet is present.
  • One thing to flag for whoever merges: this PR also touches the shared core/libs/SceTypes.hpp (the HttpCookieSendCallback addition). A header both the modules and the test binaries include is the shape that produces a false failure when only libs is rebuilt — that cost a bogus SEGFAULT report on an earlier PR in this repo. I verified the modules build and the 34 exports land; I did not rebuild the full test tree, so I am not vouching for the test binaries here.

The bar, and what I can and cannot supply for it. A declaration batch lands when it names the title that imports those functions. I can check one title against a full import registry — PPSA26344 (Ghost of Yotei) — and it imports none of these (0 of the 683 imports I can resolve; 19 of its 702 stayed unresolved, so I am not claiming "none" absolutely). That is a negative, not a substitute for your positive: naming the title that needs these is the part that decides whether this merges.

What I could not verify: that a title calls any of them (an import is not a call), and no runtime beyond the module build.

Written with AI assistance.

@popcoder565

Copy link
Copy Markdown
Contributor

Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head 6660a137, merged onto main d70b899 in one build with 38 other PRs that had no Windows run.

No title was run.

🤖 Addressed by Claude Code

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: these are declarations taken from the firmware export list, and no title is shown importing any of them on main. Please reopen with the title ID and the log line where it stops on an unresolved import if one turns up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants