Skip to content

Commit

Permalink
Don't run prompt_hook_on_stop if binary is not running (pwndbg#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsingh93 authored and zachriggle committed Jun 3, 2016
1 parent e510f75 commit d326a75
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pwndbg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import pwndbg.disasm.x86

try:
import unicorn
import pwndbg.emu
import unicorn
import pwndbg.emu
except:
pass
pass

import pwndbg.vmmap
import pwndbg.dt
Expand Down Expand Up @@ -124,7 +124,7 @@
""".strip() % prompt

for line in pre_commands.strip().splitlines():
gdb.execute(line)
gdb.execute(line)

msg = "Loaded %i commands. Type pwndbg for a list." % len(pwndbg.commands._Command.commands)
print(pwndbg.color.red(msg))
Expand All @@ -139,7 +139,9 @@ def prompt_hook(*a):
pwndbg.events.after_reload()
cur = new

prompt_hook_on_stop(*a)
if pwndbg.proc.alive:
prompt_hook_on_stop(*a)


@pwndbg.memoize.reset_on_stop
def prompt_hook_on_stop(*a):
Expand Down

0 comments on commit d326a75

Please sign in to comment.