diff options
| author | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2025-02-25 15:48:20 +0100 |
|---|---|---|
| committer | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2025-02-25 15:48:20 +0100 |
| commit | 849e5a6ec6e0246b5dde1fb2583aa13ed288e9c1 (patch) | |
| tree | 0596e7ffdd2b18a1e7977a49b55afb6f46976f6a /tools/capture_transforms.py | |
| parent | ed536f04a716d585ce54bab0413f57aba1284b91 (diff) | |
| parent | a514b34d6f708ee80c4f0df91fefa9871d87ad39 (diff) | |
| download | focaccia-849e5a6ec6e0246b5dde1fb2583aa13ed288e9c1.tar.gz focaccia-849e5a6ec6e0246b5dde1fb2583aa13ed288e9c1.zip | |
Merge branch 'ta/develop'
Diffstat (limited to 'tools/capture_transforms.py')
| -rwxr-xr-x | 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 100755 index 0000000..552b855 --- /dev/null +++ b/tools/capture_transforms.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +import argparse + +from focaccia import parser, utils +from focaccia.symbolic import collect_symbolic_trace +from focaccia.trace import TraceEnvironment + +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() + + env = TraceEnvironment(args.binary, args.args, utils.get_envp()) + trace = collect_symbolic_trace(env, None) + with open(args.output, 'w') as file: + parser.serialize_transformations(trace, file) + +if __name__ == "__main__": + main() |