diff options
Diffstat (limited to 'scripts/generate_binaries.py')
-rwxr-xr-x | scripts/generate_binaries.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/generate_binaries.py b/scripts/generate_binaries.py index 8eccc14..705bff8 100755 --- a/scripts/generate_binaries.py +++ b/scripts/generate_binaries.py @@ -26,7 +26,8 @@ import sys import elftools.elf.elffile as elffile def generate_binaries(args): - load_segments = []; + outfiles = [] + with open(args.input, 'rb') as f: elf = elffile.ELFFile(f) for segment in elf.iter_segments(): @@ -38,9 +39,16 @@ def generate_binaries(args): with open(out, 'wb') as of: of.write(segment.data()) + outfiles.append(out) + + if args.d: + with open(args.d, 'w') as f: + f.writelines(outfiles) + if __name__ == '__main__': parser = argparse.ArgumentParser(description='Generate binaries from ELF file') parser.add_argument('-o', '--output', default='.', required=False, help='Output directory for binaries') + parser.add_argument('-d', help='Dependency file') parser.add_argument('input', metavar='inputfile', type=str, help='ELF file to extract binaries from') args = parser.parse_args() |