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

(win, python >= 3.10) Fix symbol address resolution #672

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

akhramov
Copy link
Contributor

For PE images we use file offsets to calculate symbol addresses in memory. However PE loader uses RVAs (relative virtual addresses) instead, so the current approach breaks for newer python releases.

This change tweaks windows symbol address resolution to rely on RVAs instead of file offsets.

Cargo.toml Outdated
@@ -35,8 +35,9 @@ serde_derive = "1.0"
serde_json = "1.0"
rand = "0.8"
rand_distr = "0.4"
remoteprocess = {version="0.4.12", features=["unwind"]}
remoteprocess = { git = "https://github.com/akhramov/remoteprocess", branch = "feature/windows-aarch64" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to-do: Unrelated to this effort. Remove this, needed on my machine only, to be upstreamed in benfred/remoteprocess#89

For PE images we use file offsets to calculate symbol addresses in
memory. However PE loader uses RVAs (relative virtual addresses)
instead, so the current approach breaks for newer python releases.

This change tweaks windows symbol address resolution to rely on RVAs
instead of file offsets.
@akhramov akhramov force-pushed the fix/interpreter-location-pe-image branch from 40be901 to 67477ae Compare July 14, 2024 16:12
@WoolenWang
Copy link

nice try, waiting for this.

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.

2 participants