diff options
| author | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2024-01-17 17:08:48 +0100 |
|---|---|---|
| committer | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2024-01-17 17:08:48 +0100 |
| commit | 605e12fc5cf0fb64e45f68378390a09aa28df2f9 (patch) | |
| tree | b8ba3c3c6f0776b5b2cd99fee7811d3c27af3f1d /tools/capture_transforms.py | |
| parent | eae0b3b08bd078ad2f621ce2ef201e656da3f16a (diff) | |
| download | focaccia-605e12fc5cf0fb64e45f68378390a09aa28df2f9.tar.gz focaccia-605e12fc5cf0fb64e45f68378390a09aa28df2f9.zip | |
Refactor symbolic transformation handling
Diffstat (limited to '')
| -rw-r--r-- | tools/capture_transforms.py | 27 |
1 files changed, 27 insertions, 0 deletions
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() |