fix(tools): report guest copies through a cast and offset #21686
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21686"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Ethan-Hainline on 2026-11-16T15:29:56Z.
What
guest_pointer_audit.pymisses a raw guest copy when the parameter reaches the call through a cast and an offset:names_parameterstrips leading casts in a loop. Afterstatic_cast<...>is removed, the text is(mode) + 0x10, and the next iteration strips(mode)as a C-style cast, leaving+ 0x10; the parameter no longer matches. The tool therefore reports nothing for this call.This matches the parameter before each strip, accepting an optional leading
(. A plainmode,(mode) + 4,static_cast<T*>(mode), andstatic_cast<T*>(mode) + 0x10all match; an unrelated pointer with an offset (other + 0x10) still does not.On current
mainthe audit goes from 3,171 findings in 2,594 exported functions to 3,229 in 2,648: 58 existing raw copies that were invisible. Most are thememcpy(..., (T*)parameter + offset, ...)pattern. It also surfacessceVideoOutSysIsModeS3dinlibSceVideoOut, the library the GuestPtr pilot converts; that conversion follow-up covers it.No gate changes: the default report still exits 0, and the
--require-zerogate is not onmainyet.Tested
python tools/tests/test_guest_pointer_audit.py: 23/23 passed, including the new cast-plus-offset,(mode) + 4and unrelated-pointer cases.libSceVideoOutreports 22 with the new matcher.python tools/check_conventions.py --base upstream/main --head HEADpasses.Checklist
main; no other open PR implements the same changeNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)