Permalink
Browse files

Only get pc for r2 when the process is running (#584)

  • Loading branch information...
sudhackar authored and disconnect3d committed Jan 4, 2019
1 parent db8fa6c commit 7d71cdd9918333603c85c62490baaeb91d56b298
Showing with 6 additions and 5 deletions.
  1. +6 −5 pwndbg/commands/radare2.py
@@ -25,11 +25,12 @@ def r2(arguments, no_seek=False):

# Build up the command line to run
cmd = ['radare2', filename]
addr = pwndbg.regs.pc
if pwndbg.elf.get_elf_info(filename).is_pie:
addr -= pwndbg.elf.exe().address
if not no_seek and pwndbg.proc.alive:
cmd.extend(['-s', hex(addr)])
if pwndbg.proc.alive:
addr = pwndbg.regs.pc
if pwndbg.elf.get_elf_info(filename).is_pie:
addr -= pwndbg.elf.exe().address
if not no_seek:
cmd.extend(['-s', hex(addr)])
cmd += arguments

try:

0 comments on commit 7d71cdd

Please sign in to comment.