def make_ast(self, trace): trace = folder.fold(trace) def store_to_set(line): if line ~ ('store', :size, :off, :idx, :val): return ('set', ('stor', size, off, idx), val) else:
def make_ast(self, trace): trace = folder.fold(trace) def store_to_set(line): if m := match(line, ("store", ":size", ":off", ":idx", ":val")): return ("set", ("stor", m.size, m.off, m.idx), m.val) else:
def dec(): trace = VM(loader).run(target, stack=stack, timeout=60) explain("Initial decompiled trace", trace[1:]) if "--explain" in sys.argv: trace = rewrite_trace( trace, lambda line: [] if type(line) == str else [line]) explain("Without assembly", trace) trace = make_whiles(trace) explain("final", trace) if "--explain" in sys.argv: explain("folded", folder.fold(trace)) return trace
def dec(): trace = VM(loader).run(target) explain('Initial decompiled trace', trace[1:]) if '--explain' in sys.argv: trace = rewrite_trace( trace, lambda line: [] if type(line) == str else [line]) explain('Without assembly', trace) trace = make_whiles(trace) explain('final', trace) if '--explain' in sys.argv: explain('folded', folder.fold(trace)) return trace