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

add support of PIE for r2 #567

Merged
merged 2 commits into from Nov 8, 2018

Conversation

Projects
None yet
2 participants
@matrix1001
Contributor

matrix1001 commented Nov 7, 2018

Sorry for this super late PR. This is just a small problem due to PIE. I am not very familiar to the api of pwndbg. But this change just fixed the PIE problem of r2.

@@ -25,8 +25,11 @@ def r2(arguments, no_seek=False):
# Build up the command line to run
cmd = ['radare2', filename]
addr = pwndbg.regs.pc
if pwndbg.wrappers.checksec.pie_status() == "PIE enabled":

This comment has been minimized.

@disconnect3d

disconnect3d Nov 7, 2018

Member
Suggested change Beta
if pwndbg.wrappers.checksec.pie_status() == "PIE enabled":
if pwndbg.elf.is_pie():

Can you check if that works fine?

This comment has been minimized.

@matrix1001

matrix1001 Nov 7, 2018

Contributor

Exception occured: r2: 'module' object has no attribute 'is_pie' (<type 'exceptions.AttributeError'>)

elf is a module.

Maybe we need an object?

This comment has been minimized.

@disconnect3d

disconnect3d Nov 7, 2018

Member

Oh it should be:

pwndbg.elf.get_elf_info(filepath).is_pie

This comment has been minimized.

@matrix1001

matrix1001 Nov 8, 2018

Contributor

Checked. But that line should be:

if pwndbg.elf.get_elf_info(filename).is_pie:

This comment has been minimized.

@disconnect3d

disconnect3d Nov 8, 2018

Member

Sure, can you change it to this? :)

This comment has been minimized.

@matrix1001

matrix1001 Nov 8, 2018

Contributor

Can you see it ?

This comment has been minimized.

@disconnect3d

disconnect3d Nov 8, 2018

Member

Yeah, thx!

Update radare2.py
API update

@disconnect3d disconnect3d merged commit 1d4d6ff into pwndbg:dev Nov 8, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment