mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-23 00:53:02 -05:00
6.2 KiB
6.2 KiB
libSceRudp technical debt
Silent stubs
- sceRudpProcessEvents, sceRudpNetFlush and sceRudpNetReceived (libSceRudp) - there is no reliable-UDP stack on the host, and every
sceRudpWrite,sceRudpReadandsceRudpGetStatuscall here reports a reset or idle context without queueing data, so no context ever holds pending data to process, send or receive; the three calls return success aftersceRudpInitandRUDP_ERROR_NOT_INITIALIZEDbefore it, as shadPS4 returns OK from its stubs. What the console'ssceRudpNetReceivedreturns is unverified. PPSA03490 callssceRudpProcessEvents(0)followed bysceRudpNetFlush()from its P2P service thread and ignores the first result; whether the real calls take parameters is unknown - sceRudpEnableInternalIOThread2 (libSceRudp) takes
(uint32_t stack_size, uint32_t priority, uint64_t affinity), taken from the managedSceRudp.Rudp.EnableInternalIOThread(uint stackSize, uint priority, ulong affinity)in PPSA06888's Unity metadata; the first two matchsceRudpEnableInternalIOThread. It returns success aftersceRudpInitandRUDP_ERROR_NOT_INITIALIZEDbefore it, assceRudpEnableInternalIOThreaddoes, without starting any thread. Whether the console reports other errors, and whether it applies the affinity, is unverified. - sceRudpActivate (libSceRudp) - there is no reliable-UDP stack on the host to activate, so it returns success without doing anything, as shadPS4 does for its own
sceRudpActivate. PPSA01325 calls it with no arguments during start-up; what the console activates, and whether it reports an error beforesceRudpInit, is unverified
Unknown function info
- sceRudpGetStatus - PPSA01521 passes an output pointer and byte count
0xF8. Measured on a PS5 (firmware 13.60): the status is 0xF8 bytes; beforesceRudpInitevery call returnsRUDP_ERROR_NOT_INITIALIZED, and after it a null pointer or a byte count of 0 or above 0xF8 returnsRUDP_ERROR_INVALID_ARGUMENT. The layout matchesSceRudpStatusin Vita3K withcurrentContextsat 0x64 andallocs,frees,memCurrentandmemPeakat 0xC8 to 0xD4. OnlycurrentContextsis reported: the traffic counters stay 0 because nothing is sent, and the allocator counters stay 0 because the library does not allocate from the title's pool (the console reports 6 allocations and 0x1260 bytes right aftersceRudpInit, and 4 more allocations and 0x3F0 bytes per context). The console also writescurrentContextsand the allocator counters when the byte count is smaller than their offset; only the requested bytes are written here. - sceRudpGetMaxSegmentSize (libSceRudp) - measured on a PS5 (firmware 13.60) in #3073: before
sceRudpInitit returnsRUDP_ERROR_NOT_INITIALIZEDand leaves the value untouched, also for a null pointer; after it a null pointer returnsRUDP_ERROR_INVALID_ARGUMENTand a valid one gets 1410 with result 0. The library keeps no configurable segment size (there is nosceRudpSetMaxSegmentSize), so 1410 is always reported. Theuint16_t*parameter is inferred: the measurement does not show how many bytes the console writes, PPSA03490 passes a pointer to a 16-bit value and RPCS3 declares the PS3cellRudpSetMaxSegmentSize(u16 mss), so only 16 bits are written - sceRudpGetOption (libSceRudp) takes
(int ctx_id, int option, void* value, uint32_t len), taken from the bundledMedia/Plugins/SceRudp.prxof PPSA06888: its two exported wrappers pass their first three arguments through unchanged and setlento 4, the same shape as itssceRudpSetOptioncall, which passes a 4-byte value. The option codes, the defaults and the error results are unknown, so it still throws - PPSA06888 imports with unknown signatures: sceRudpGetRemoteInfo (libSceRudp), imported by its bundled
Media/Plugins/SceRudp.prxand not called during start-up. The third argument is a pointer to a 4-byte buffer seeded from the byte its wrapper reads through the second argument, which does not show what the arguments mean. The managedSceRudp.Context.GetRemoteInfo()in the title's Unity metadata takes no parameters and returns aSceRudp.AddrAndVport; its native arguments are not visible there. Names from the NID table of shadPS4, which declares them without parameters too - sceRudpPollCreate, sceRudpPollControl, sceRudpPollWait, sceRudpPollDestroy (libSceRudp) - unverified on a PS5; imported by PPSA31327 and not called before the main menu. The signatures, the 8-byte
SceRudpPollEvent, the operations (1 add, 2 modify, 3 remove) and the argument checks follow the PS Vita library in Vita3K, and the error codes match RPCS3. Vita3K leavessceRudpPollDestroyunimplemented, soint sceRudpPollDestroy(int pollId)and its checks are inferred. No context can connect, so no event is ever reported:sceRudpPollWaitreturns 0 when its timeout elapses, also for an empty poll, where Vita3K returns at once - sceRudpAccept, sceRudpFlush, sceRudpGetLocalInfo, sceRudpListen, sceRudpPollCancel and sceRudpSetMaxSegmentSize (libSceRudp) - names and NIDs are present in the PS5 3.20 export inventory, but no credible prototypes were found. They are declared without parameters solely to resolve known imports; this is not an ABI claim.