Skip to content

feat(libc): export the std::__sce_v2 clog, wclog and standard stream pointers - #16083

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Danigamer05:feat/libc-sce-v2-clog-ptr-20261105
Nov 6, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Danigamer05:feat/libc-sce-v2-clog-ptr-20261105

Conversation

@Danigamer05

Copy link
Copy Markdown
Contributor

What

Export the versioned std::__sce_v2 clog and wclog and the eight standard stream pointers from libc.

Export NID Original address
_ZNSt8__sce_v28_Ptr_cinE 0JbUOAJmBDA 0x197840
_ZNSt8__sce_v29_Ptr_coutE aHPbwpOzg7A 0x197848
_ZNSt8__sce_v29_Ptr_cerrE YpXm9hJ+Kxk 0x197850
_ZNSt8__sce_v29_Ptr_clogE 6JHYSZ5l0K4 0x197858
_ZNSt8__sce_v29_Ptr_wcinE 4vGo180IRx8 0x197860
_ZNSt8__sce_v210_Ptr_wcoutE sK-ozcyfXlA 0x197868
_ZNSt8__sce_v210_Ptr_wcerrE 70AJso+2Yks 0x197870
_ZNSt8__sce_v210_Ptr_wclogE VLb2-jScg6o 0x197878
_ZNSt8__sce_v24clogE tIpEi4OinAI 0x198880
_ZNSt8__sce_v25wclogE QtsIfGDk6wY 0x198CE0

The behavior comes from the libc.prx bundled with PPSA03671 v01.001.005 (J03848509, SHA-256 483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6).

In the module clog and wclog are 0x68-byte streams beside the other six, and each _Ptr_* is an 8-byte pointer that the stream's static constructor sets to the stream's address when the module loads. The same constructors tie cin, cerr, wcin and wcerr to their output stream and set unitbuf on cerr and wcerr.

Main already exports the other six versioned streams as zeroed 0x400 storage, which nothing constructs. clog and wclog are added the same way next to them, and each pointer is initialized to its stream's storage, so it holds the value the console's holds after load. The tie and unitbuf are not set, since there is no constructed stream to set them on; a new debt entry records this.

Tested

Windows x86-64, WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON, main 4741457fed4. Exact tested commit: fedacbcaedf.

Not tested: Linux, macOS, another SDK, a game, GPU or console. No game compatibility claim. No original module, extracted bytes, harness or log is committed or uploaded.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

…pointers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants