diff options
| author | Malfurious <m@lfurio.us> | 2022-09-12 20:33:37 -0400 | 
|---|---|---|
| committer | Malfurious <m@lfurio.us> | 2022-09-12 20:33:37 -0400 | 
| commit | 4fb3e9ac04cb7772bca3988c5983019a7a34bf20 (patch) | |
| tree | 9dca10b9bb28c73f92f00036e42d3dc4b78b951e /sploit/rev | |
| parent | 9c1d2ebf21d0b7b10d3b78ce387d774dedfe8ba7 (diff) | |
| parent | e2665bbeac88d55b78be6a97cb6c247ee57b8dbd (diff) | |
| download | nsploit-4fb3e9ac04cb7772bca3988c5983019a7a34bf20.tar.gz nsploit-4fb3e9ac04cb7772bca3988c5983019a7a34bf20.zip | |
Merge branch 'sploit/symtbl-base'
This branch brings some conveniences to the semantics behind Symtbl base
values.
* sploit/symtbl-base:
  sploit: rev: Properly base Symtbls for non-PIC binaries
  sploit: Fix bugs involving Symtbl base value
  sploit: mem: Allow Symtbl base to be modified
Diffstat (limited to 'sploit/rev')
| -rw-r--r-- | sploit/rev/r2.py | 7 | 
1 files changed, 6 insertions, 1 deletions
| diff --git a/sploit/rev/r2.py b/sploit/rev/r2.py index bb3edb3..6dfd499 100644 --- a/sploit/rev/r2.py +++ b/sploit/rev/r2.py @@ -13,6 +13,11 @@ def get_elf_symbols(elf):      ilog(f'Retrieving symbols of {elf} with r2...')      out = {} +    cmd_base = 'iI~baddr' +    base = run_cmd(elf,cmd_base) +    base = re.split(r'\s+',base[0])[1] +    base = int(base,0) +      cmd_syms = 'is'      out_syms = run_cmd(elf,cmd_syms)      out_syms = [re.split(r'\s+',sym) for sym in out_syms][4:] @@ -39,7 +44,7 @@ def get_elf_symbols(elf):      out_strs = {sym[2][sym[2].rfind('.')+1:]:int(sym[0],0) for sym in out_strs}      out.update(out_strs) -    return Symtbl(**out) +    return Symtbl(base=base, **out)  def get_locals(binary,func):      ilog(f'Retrieving local stack frame of {hex(func)} in {binary} with r2...') | 
