docs(libkernel): note the sceKernelVirtualQuery fields seven titles read #11732

Merged
milescoviello merged 2 commits from upstream-pr/11732 into main 2026-10-28 09:09:05 +00:00
milescoviello commented 2026-10-27 06:21:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-27T06:21:01Z.


What

The sceKernelVirtualQuery entry in docs/dev/debt/libkernel.md says the console offsets beyond the address, protection and size fields are not hardware-measured. Title code gives evidence for them, and this adds it. Of 34 calls in seven titles, 31 pass an info size of 0x48 (the 72 bytes the entry describes). In the 30 instructions after each call, the 27 that take the result in a stack buffer read:

Offset Read as Field in VirtualQueryInfo Calls
0x0 64-bit start 25
0x8 64-bit end 24
0x10 64-bit offset 16
0x18 32-bit protection 4
0x1c 32-bit memory_type 6
0x20 byte flags 10, testing 0x2 (is_direct), 0x10 (is_committed) or 0x50, or masking 0x1f
0x21 byte first byte of name 1, ASTRO BOT comparing it with 0

This is a bounded scan: reads later in the caller, or through a copy of the result, aren't ruled out, so a field missing here may still be used.

Title Version Calls
Borderlands 4 (PPSA01494) 01.100.002 2
Forspoken (PPSA03984) 01.020.000 3
Metal Gear Solid 4 (PPSA18194) 01.004.003 18
ASTRO BOT (PPSA21564) 01.007.000 7
MXGP 26 (PPSA30839) 01.003.000 2
Super Meat Boy 3D (PPSA31162) 02.000.001 1
Call of Duty: Black Ops II (PPSA34502) 01.010.000 1

How

I found the calls through the import's PLT stub in each title's relinked eboot.bin, took the info buffer from the rdx set before each call, and listed the reads from that buffer in the 30 instructions after it. Calls whose buffer isn't a stack slot aren't counted. No code change.

Changed: docs/dev/debt/libkernel.md.

Overlap: #11625 rewrites the next entry (app0.zar files and directories). I offered on #11625 to land second; this PR is marked to go after it, and I will rebase it once #11625 merges.

Tested

Docs only. tools/check_conventions.py --base upstream/main passes.

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: #11625
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5029562117 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11732). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-27T06:21:01Z. --- ### What The `sceKernelVirtualQuery` entry in `docs/dev/debt/libkernel.md` says the console offsets beyond the address, protection and size fields are not hardware-measured. Title code gives evidence for them, and this adds it. Of 34 calls in seven titles, 31 pass an info size of 0x48 (the 72 bytes the entry describes). In the 30 instructions after each call, the 27 that take the result in a stack buffer read: | Offset | Read as | Field in `VirtualQueryInfo` | Calls | |---|---|---|---| | 0x0 | 64-bit | `start` | 25 | | 0x8 | 64-bit | `end` | 24 | | 0x10 | 64-bit | `offset` | 16 | | 0x18 | 32-bit | `protection` | 4 | | 0x1c | 32-bit | `memory_type` | 6 | | 0x20 | byte | flags | 10, testing 0x2 (`is_direct`), 0x10 (`is_committed`) or 0x50, or masking 0x1f | | 0x21 | byte | first byte of `name` | 1, ASTRO BOT comparing it with 0 | This is a bounded scan: reads later in the caller, or through a copy of the result, aren't ruled out, so a field missing here may still be used. | Title | Version | Calls | |---|---|---| | Borderlands 4 (PPSA01494) | 01.100.002 | 2 | | Forspoken (PPSA03984) | 01.020.000 | 3 | | Metal Gear Solid 4 (PPSA18194) | 01.004.003 | 18 | | ASTRO BOT (PPSA21564) | 01.007.000 | 7 | | MXGP 26 (PPSA30839) | 01.003.000 | 2 | | Super Meat Boy 3D (PPSA31162) | 02.000.001 | 1 | | Call of Duty: Black Ops II (PPSA34502) | 01.010.000 | 1 | ### How I found the calls through the import's PLT stub in each title's relinked `eboot.bin`, took the info buffer from the `rdx` set before each call, and listed the reads from that buffer in the 30 instructions after it. Calls whose buffer isn't a stack slot aren't counted. No code change. Changed: `docs/dev/debt/libkernel.md`. Overlap: #11625 rewrites the next entry (`app0.zar files and directories`). I offered on #11625 to land second; this PR is marked to go after it, and I will rebase it once #11625 merges. ### Tested Docs only. `tools/check_conventions.py --base upstream/main` passes. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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: #11625 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-27 06:33:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T06:33:52Z.

Review: DISMISSED


The title-call-site inventory is useful, but the table's unqualified “read” wording is broader than the stated method, which inspects the 30 instructions after each call. Please scope the title/field claims to that inspected window and note that later or indirect reads are not ruled out, as the revised #11739 now does.

There is also an unresolved overlap order with open #11625. I found the offer on #11625 to land first and the Depends on: #11625 line, but no acknowledgement from #11625's author agreeing to that sequence. CONTRIBUTING.md requires agreement with the overlapping PR's author. Please get that confirmation (or agree the opposite order) and reflect the agreed sequence in the checklist before this is ready for approval.

This is docs-only; hosted current-base conventions passes, and product jobs are skipped by policy. I did not independently inspect the title binaries.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5663115128 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11732#pullrequestreview-5663115128). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T06:33:52Z. **Review:** DISMISSED --- The title-call-site inventory is useful, but the table's unqualified “read” wording is broader than the stated method, which inspects the 30 instructions after each call. Please scope the title/field claims to that inspected window and note that later or indirect reads are not ruled out, as the revised #11739 now does. There is also an unresolved overlap order with open #11625. I found the offer on #11625 to land first and the `Depends on: #11625` line, but no acknowledgement from #11625's author agreeing to that sequence. `CONTRIBUTING.md` requires agreement with the overlapping PR's author. Please get that confirmation (or agree the opposite order) and reflect the agreed sequence in the checklist before this is ready for approval. This is docs-only; hosted current-base conventions passes, and product jobs are skipped by policy. I did not independently inspect the title binaries.
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!11732
No description provided.