Skip to content

Commit

Permalink
next fails if string is not found in binary
Browse files Browse the repository at this point in the history
fixes #2306
  • Loading branch information
xambroz authored Nov 25, 2023
1 parent d10c70f commit 5957218
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pwnlib/commandline/libcdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,11 @@ def translate_offset(offs, args, exe):

def collect_synthetic_symbols(exe):
available_symbols = ['str_bin_sh']
exe.symbols['str_bin_sh'] = next(exe.search(b'/bin/sh\x00'))

try:
exe.symbols['str_bin_sh'] = next(exe.search(b'/bin/sh\x00'))
except:
pass

libc_start_main_return = exe.libc_start_main_return
if libc_start_main_return > 0:
exe.symbols['__libc_start_main_ret'] = libc_start_main_return
Expand Down

0 comments on commit 5957218

Please sign in to comment.