Ejemplo n.º 1
0
def make_whiles(trace):
    trace = make(trace)
    explain("Loops -> whiles", trace)

    # clean up jumpdests
    trace = rewrite_trace(
        trace, lambda line: [] if opcode(line) == "jumpdest" else [line])
    trace = simplify_trace(trace)

    return trace
Ejemplo n.º 2
0
def make_whiles(trace): 

    trace = make(trace)

    explain('Loops -> whiles', trace)

    # clean up jumpdests
    trace = rewrite_trace(trace, lambda line: [] if line ~ ('jumpdest', ...) else [line])

    trace = simplify_trace(trace)

    return trace
Ejemplo n.º 3
0
            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