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

corefile: also expose page_offset #1169

Merged
merged 5 commits into from
Jul 3, 2018
Merged

corefile: also expose page_offset #1169

merged 5 commits into from
Jul 3, 2018

Conversation

Mic92
Copy link
Contributor

@Mic92 Mic92 commented Jun 11, 2018

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'
from pwn import Corefile
coredump = Corefile('./core')
print(coredump.mappings)

@zachriggle
Copy link
Member

zachriggle commented Jun 12, 2018

Can you rebase this on dev or revert aac086d in this branch?

This is useful to load the code from the original files.
@Mic92
Copy link
Contributor Author

Mic92 commented Jun 12, 2018

Rebased...

@zachriggle
Copy link
Member

I made some quick changes to preserve the original ordering of the constructor arguments -- I'll merge this if/when CI passes 😄

@@ -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)' \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about this one?

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),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

and here?

@zachriggle
Copy link
Member

zachriggle commented Jun 13, 2018 via email

@Mic92
Copy link
Contributor Author

Mic92 commented Jun 13, 2018

I just toughed it is more consistent.

@zachriggle
Copy link
Member

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 😅)

@Mic92
Copy link
Contributor Author

Mic92 commented Jun 13, 2018

Done. The current failure is just a temporary connection problem to ftp.ubuntu.org: https://travis-ci.org/Gallopsled/pwntools/builds/391975461#L1456

@zachriggle
Copy link
Member

Restarted the CI build after fixing #1172

@zachriggle zachriggle merged commit 9023b38 into Gallopsled:dev Jul 3, 2018
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