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

Cross-Version Python Unmarshal #73

Open
jhhcs opened this issue Jan 1, 2025 · 0 comments
Open

Cross-Version Python Unmarshal #73

jhhcs opened this issue Jan 1, 2025 · 0 comments
Assignees
Labels
feature Discusses the implementation of a new feature. help-wanted The maintainer would actually accept PRs to fix this, maybe even desperately so.

Comments

@jhhcs
Copy link
Contributor

jhhcs commented Jan 1, 2025

The pym unit currently just uses the unmarshal method that is provided by the current Python interpreter. This can easily fail if the target binary was marshaled with a different version, since the marshal format is an implementation detail and changes across Python versions.

I had assumed that xdis unmarshal would be a solution to this problem, but testing and inspection of their code indicates that this is wrong: While their unmarshal implementation accepts a version parameter, this parameter has no effect on the unmarshal implementation and using it on several test samples failed for every conceivable version input.

The alternative is straightforward but will take some time: Re-implement a version-agnostic unmarshal by going through past versions of marshal.c in the CPython code.

@jhhcs jhhcs added the feature Discusses the implementation of a new feature. label Jan 1, 2025
@jhhcs jhhcs added the help-wanted The maintainer would actually accept PRs to fix this, maybe even desperately so. label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Discusses the implementation of a new feature. help-wanted The maintainer would actually accept PRs to fix this, maybe even desperately so.
Projects
None yet
Development

No branches or pull requests

2 participants