From 605e12fc5cf0fb64e45f68378390a09aa28df2f9 Mon Sep 17 00:00:00 2001 From: Theofilos Augoustis Date: Wed, 17 Jan 2024 17:08:48 +0100 Subject: Refactor symbolic transformation handling --- tools/capture_transforms.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tools/capture_transforms.py (limited to 'tools/capture_transforms.py') diff --git a/tools/capture_transforms.py b/tools/capture_transforms.py new file mode 100644 index 0000000..de35d86 --- /dev/null +++ b/tools/capture_transforms.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +import argparse +import logging + +from focaccia import parser +from focaccia.symbolic import collect_symbolic_trace + +def main(): + prog = argparse.ArgumentParser() + prog.description = 'Trace an executable concolically to capture symbolic' \ + ' transformations among instructions.' + prog.add_argument('binary', help='The program to analyse.') + prog.add_argument('args', action='store', nargs=argparse.REMAINDER, + help='Arguments to the program.') + prog.add_argument('-o', '--output', + default='trace.out', + help='Name of output file. (default: trace.out)') + args = prog.parse_args() + + logging.disable(logging.CRITICAL) + trace = collect_symbolic_trace(args.binary, args.args, None) + with open(args.output, 'w') as file: + parser.serialize_transformations(trace, file) + +if __name__ == "__main__": + main() -- cgit 1.4.1