summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2023-03-23 08:19:34 -0400
committerdusoleil <howcansocksbereal@gmail.com>2023-03-23 08:19:34 -0400
commite313b0eb10278ddc3cfdb42baa100fa8f60aba61 (patch)
treead21dfb7b7eed1e5b41e61eebdc1610434551590
parentf388499a625af89e56669a8c76c65da21a7c1b1a (diff)
downloadsploit-e313b0eb10278ddc3cfdb42baa100fa8f60aba61.tar.gz
sploit-e313b0eb10278ddc3cfdb42baa100fa8f60aba61.zip
r2: Get all relocs that have a name
Originally I was deciding whether to get a reloc based on the type. I'm not sure what SET_64 vs ADD_64 means, but the SET* types seemed to be the only symbols we care about. After running into a binary where a SET* symbol didn't have a name (and crashed sploit), I have decided to filter on that instead. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r--sploit/rev/r2.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/sploit/rev/r2.py b/sploit/rev/r2.py
index f239d09..f00458e 100644
--- a/sploit/rev/r2.py
+++ b/sploit/rev/r2.py
@@ -32,8 +32,7 @@ def get_elf_symbols(elf):
syms = Symtbl(base=base, **syms)
got = json.loads(run_cmd(elf,'irj')[0])
- got = [g for g in got if g['type'].startswith('SET')]
- got = {sym['name']:sym['vaddr'] for sym in got}
+ got = {sym['name']:sym['vaddr'] for sym in got if 'name' in sym}
got = Symtbl(base=sect.get('.got',0), **got)
strings = json.loads(run_cmd(elf,'izj')[0])