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

Work around renamed ENUM_P_TYPE variables in elftools 0.25 and up. #1191

Closed
wants to merge 2 commits into from

Conversation

rickyz
Copy link
Contributor

@rickyz rickyz commented Sep 2, 2018

Elftools 0.25 renamed ENUM_P_TYPE to ENUM_P_TYPE_BASE: eliben/pyelftools@7371660

Work around this by attempting to import both names.

Fixes #1189.

@rickyz
Copy link
Contributor Author

rickyz commented Sep 2, 2018

Added a comment, thanks!

@rickyz
Copy link
Contributor Author

rickyz commented Sep 4, 2018

@zachriggle (who commented on PR #1190)

Copy link
Contributor

@disconnect3d disconnect3d left a comment

Choose a reason for hiding this comment

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

Works for me 👍

@billm
Copy link

billm commented Sep 16, 2018

While this allows pwntools to run for me, I couldn't successfully execute the demo code in http://docs.pwntools.com/en/stable/elf/corefile.html?highlight=core#using-corefiles-to-automate-exploitation.

With this patch:

[+] Starting local process './crash': pid 32634
[] Process './crash' stopped with exit code -11 (SIGSEGV) (pid 32634)
[+] Parsing corefile...: Done
[!] Could not find the stack!
[
] '/home/billm/pwntest/core'
Arch: i386-32-little
EIP: 0x0
ESP: 0x0
Traceback (most recent call last):
File "demo.py", line 13, in
assert pack(core.eip) in payload
File "/usr/local/lib/python2.7/dist-packages/pwnlib/elf/corefile.py", line 1090, in getattr
return super(Corefile, self).getattribute(attribute)
AttributeError: 'Coredump' object has no attribute 'eip'

And with pyelftools pinned to 0.24

[+] Starting local process './crash': pid 32721
[] Process './crash' stopped with exit code -11 (SIGSEGV) (pid 32721)
[+] Parsing corefile...: Done
[
] '/home/billm/pwntest/core'
Arch: i386-32-little
EIP: 0x565615be
ESP: 0x6161616d
Exe: '/home/billm/pwntest/crash' (0x56561000)
Fault: 0x6161616d
Traceback (most recent call last):
File "demo.py", line 13, in
assert pack(core.eip) in payload
AssertionError

The assertion is bad...but at least now pwntools can read the core file.

@zachriggle
Copy link
Member

Fixed with 7467402e, will cut a new release today

@zachriggle zachriggle closed this Sep 17, 2018
@rickyz rickyz deleted the elftools branch September 17, 2018 23:13
@zachriggle zachriggle mentioned this pull request Jan 14, 2021
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.

None yet

4 participants