From e313b0eb10278ddc3cfdb42baa100fa8f60aba61 Mon Sep 17 00:00:00 2001 From: dusoleil Date: Thu, 23 Mar 2023 08:19:34 -0400 Subject: 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 --- sploit/rev/r2.py | 3 +-- 1 file changed, 1 insertion(+), 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]) -- cgit v1.2.3