Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix symbol resolution for rust binaries #321

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JosiahWhite
Copy link

Currently symbol resolution on rust binaries returns an address that is 0x1000 above the correct symbol leading to triggers not working.

The current logic seems to assume the symbol value is an offset from the start of the file, but the spec actually states for an executable that this value is a virtual address already: "In executable and shared object files, st_value holds a virtual address."

Most cases can be solved by just picking the first address from the maps file and adding the symbol value to it but there is an edge case where an exotic binary could select a base virtual address that doesn't start at 0x0. This can be detected by reading the program headers and looking at p_vaddr for the first LOAD segment and subtracting it from the first mapping address that is pulled from /proc/pid/maps.

This PR is blocked by let-def/owee#35 being merged and released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant