[pr-fix][input][startup] mousehook: nothing is read past the end of the title image #418
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!418
Loading…
Reference in a new issue
No description provided.
Delete branch "iboom72/mousehook-reads-inside-image"
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?
What it changes
mousehook::install(crates/darner-hle/src/mousehook.rs:1815) reads the 1.0.2.1 prologue atbase + 0xe4e3d0for every title, before any setting is checked. If that doesn't match, it still goes on tohook_entryat the same address. With a title or build whose image is smaller than about 15 MB, those reads land past the image's end.What changes:
bytes()returns nothing past the image'sSizeOfImage. darner-hle already reads that from the mapped headers inruntime::image_size, whichset_main_imageuses; it is nowpub(crate).installstops before any hook when the prologue isn't the known build's. It logs the same "prologue … differs (another title/build?)" warning as before.With the known build nothing changes: the prologue matches and the same hooks are installed.
How it was tested
2520657d(onmainf3840d73)cargo test -p darner-hle --lib --locked mousehook: 9 passed, including the newbytes_reads_nothing_past_the_image.cargo clippy -p darner-hle --lib --locked -- -D warnings: clean.bytes_reads_nothing_past_the_imageuses a synthetic 0x100-byte image header.Checklist
main.docs/asset-policy.md.Checked for overlap
runtime::image_sizechange (pub(crate)) to bound its own DualSense hooks; the two merge cleanly in either order. #185 adds fixed-offset hooks bounded by the constantIMAGE_MAX. #399 editsmousehook.rs(the capture log). Each merges with this branch without a conflict (git merge-treeagainst their current heads).Checked with AI assistance (Claude Code).
🤖 Generated with Claude Code