-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
corefile: also expose page_offset #1169
Conversation
Can you rebase this on |
This is useful to load the code from the original files.
Rebased... |
I made some quick changes to preserve the original ordering of the constructor arguments -- I'll merge this if/when CI passes 😄 |
pwnlib/elf/corefile.py
Outdated
@@ -184,12 +187,13 @@ def __str__(self): | |||
return '%x-%x %s %x %s' % (self.start,self.stop,self.permstr,self.size,self.name) | |||
|
|||
def __repr__(self): | |||
return '%s(%r, start=%#x, stop=%#x, size=%#x, flags=%#x)' \ | |||
return '%s(%r, start=%#x, stop=%#x, size=%#x, page_offset=%#x, flags=%#x)' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this one?
pwnlib/elf/corefile.py
Outdated
Mapping('/lib/i386-linux-gnu/ld-2.19.so', start=0xf7712000, stop=0xf7713000, size=0x1000, flags=0x4), | ||
Mapping('/lib/i386-linux-gnu/ld-2.19.so', start=0xf7713000, stop=0xf7714000, size=0x1000, flags=0x6), | ||
Mapping('[stack]', start=0xfff3e000, stop=0xfff61000, size=0x23000, flags=0x6)] | ||
[Mapping('/home/user/pwntools/crash', start=0x8048000, stop=0x8049000, size=0x1000, page_offset=0x0, flags=0x5), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here?
It shouldn’t matter since:
1) The doctest is still correct (repr() returns that string)
2) That repr() is still valid since it uses **kwargs instead of ordered arguments
|
I just toughed it is more consistent. |
Definitely -- feel free to fix it if you'd like, I just didn't want to make a large edit in the browser (and still ended up needing to make 3 edits 😅) |
Done. The current failure is just a temporary connection problem to ftp.ubuntu.org: https://travis-ci.org/Gallopsled/pwntools/builds/391975461#L1456 |
Restarted the CI build after fixing #1172 |
Pwntools Pull Request
Adds page_offset to corefiles. This is useful to data from the original files.
This pull request depends on: #1167
Testing
tested via testsuite and:
$ gdb ls -batch -ex 'break _start' -ex run -ex 'generate-core-file core'