"""ADVERSARIAL Q5. The sortPriority merge sort has exactly one entry point (0x180016f81 -> FUN_180010bc0). Identify its containing function, what list it sorts, and who calls it. Also print FUN_1800130c0 in full to see whether +0x1a0 / +0x94 are initialised at all for group tiles (FUN_180014610 sets neither).""" import sys, traceback OUT = "/tmp/claude-1000/-home-alex-Documents-OpenFUT/8e521ca1-ca3e-4138-bb96-df1744dd1d30/scratchpad/store/adv/q5_out.txt" try: fh = open(OUT, "w") def P(*a): s = " ".join(str(x) for x in a) print(s); fh.write(s + "\n") f = func(0x180016f81) P("0x180016f81 is inside %s @ %#x size=%#x" % (f.getName(), int(f.getEntryPoint().getOffset()), int(f.getBody().getNumAddresses()))) ent = int(f.getEntryPoint().getOffset()) P("=== callers of %s ===" % f.getName()) for frm, typ, fn, e in xrefs_to(ent): P(" from %#x %s in %s @ %#x" % (frm, typ, fn, e)) for t in (ent, 0x1800130c0): g = func(t) P() P("======== DECOMPILE %s @ %#x ========" % (g.getName(), t)) src = dec(t, 300) P("len(src) =", len(src)); P(src) P("======== END %#x ========" % t) fh.close() except Exception: traceback.print_exc() try: fh.close() except Exception: pass