From 1c3e5a0b1c62829d78960c4d99e4928ccf73625f Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Wed, 4 Jul 2012 23:14:52 -0500 Subject: Added Newer nullsubs for dynamic use, improved mapfile a little (mostly error output), updated newer and summer sun with nullsub fixes. --- tools/mapfile_tool.py | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'tools') diff --git a/tools/mapfile_tool.py b/tools/mapfile_tool.py index 92e53ad..3556d0d 100755 --- a/tools/mapfile_tool.py +++ b/tools/mapfile_tool.py @@ -215,28 +215,39 @@ def do_mapfile(src, dest, fix_offset): def work_on_hook(hook, id, func): - #print 'doing %s (%s) for %s' % (hook['name'], hook['type'], id) + + try: + t = hook['type'] - t = hook['type'] + if t == 'patch': + error = 'missing addr' + + hook['addr_%s' % id] = func(hook['addr_%s' % original]) - if t == 'patch': - hook['addr_%s' % id] = func(hook['addr_%s' % original]) + elif t == 'branch_insn' or t == 'add_func_pointer': + error = 'missing src_addr' - elif t == 'branch_insn' or t == 'add_func_pointer': - hook['src_addr_%s' % id] = func(hook['src_addr_%s' % original]) + hook['src_addr_%s' % id] = func(hook['src_addr_%s' % original]) - if 'target_func_%s' % original in hook: - hook['target_func_%s' % id] = func(hook['target_func_%s' % original]) + if 'target_func_%s' % original in hook: + error = 'missing target_func' - elif t == 'nop_insn': - area = hook['area_%s' % original] - if isinstance(area, list): - start = func(area[0]) - new_area = [start, start + (area[1] - area[0])] - else: - new_area = func(area) + hook['target_func_%s' % id] = func(hook['target_func_%s' % original]) - hook['area_%s' % id] = new_area + elif t == 'nop_insn': + error = 'missing area' + + area = hook['area_%s' % original] + if isinstance(area, list): + start = func(area[0]) + new_area = [start, start + (area[1] - area[0])] + else: + new_area = func(area) + + hook['area_%s' % id] = new_area + + except: + print 'Key Error %s for %s (%s) for %s' % (error, hook['name'], hook['type'], id) #if hook['name'] == 'WM_onCreate': print hook -- cgit v1.2.3