From 1d9924a4f753d335ed12a0dc9e6b816414338e18 Mon Sep 17 00:00:00 2001 From: Ajax Date: Mon, 21 Mar 2016 16:27:09 +0100 Subject: Introduce Container.symbol_pool, containing container symbols (if any) --- example/disasm/full.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'example/disasm/full.py') diff --git a/example/disasm/full.py b/example/disasm/full.py index ee0b88dd..7ff60d3b 100644 --- a/example/disasm/full.py +++ b/example/disasm/full.py @@ -78,7 +78,7 @@ mn, dis_engine = machine.mn, machine.dis_engine ira, ir = machine.ira, machine.ir log.info('ok') -mdis = dis_engine(bs) +mdis = dis_engine(bs, symbol_pool=cont.symbol_pool) # configure disasm engine mdis.dontdis_retcall = args.dontdis_retcall mdis.blocs_wd = args.blockwatchdog @@ -86,7 +86,13 @@ mdis.dont_dis_nulstart_bloc = not args.dis_nulstart_block mdis.follow_call = args.followcall todo = [] -addrs = [int(a, 0) for a in args.address] +addrs = [] +for addr in args.address: + try: + addrs.append(int(addr, 0)) + except ValueError: + # Second chance, try with symbol + addrs.append(mdis.symbol_pool.getby_name(addr).offset) if len(addrs) == 0 and default_addr is not None: addrs.append(default_addr) -- cgit 1.4.1