Skip to content

init detects false Thumb tail call to unmapped memory region #23

@LagoLunatic

Description

@LagoLunatic

For Castlevania: Portrait of Ruin, starting with commit 0337bf7, dsd detects data in a constant pool in ITCM as a Thumb function that ends with a tail call:
image
image

The destination of the tail call is 01ff7f86, which is unmapped memory:
image

dis then errors with this vague message because it tried to write a relocation with no destination module:

thread 'test_roundtrip' panicked at src/config/symbol.rs:1063:66:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This isn't a big deal because symbols.txt/relocs.txt can be easily fixed by hand, but it might be worth considering adding a check that that the tail call branch destination leads to valid memory to make analysis more accurate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions