strip_binary.py (889B)
1 #!/usr/bin/env python3 2 # 3 # Copyright 2021 The Chromium Authors 4 # Use of this source code is governed by a BSD-style license that can be 5 # found in the LICENSE file. 6 7 import argparse 8 import subprocess 9 import sys 10 11 12 def main(): 13 argparser = argparse.ArgumentParser(description='eu-strip binary.') 14 15 argparser.add_argument('--eu-strip-binary-path', help='eu-strip path.') 16 argparser.add_argument('--binary-input', help='exe file path.') 17 argparser.add_argument('--symbol-output', help='debug file path.') 18 argparser.add_argument('--stripped-binary-output', help='stripped file path.') 19 args = argparser.parse_args() 20 21 cmd_line = [ 22 args.eu_strip_binary_path, '-o', args.stripped_binary_output, '-f', 23 args.symbol_output, args.binary_input 24 ] 25 26 process = subprocess.Popen(cmd_line) 27 process.wait() 28 return process.returncode 29 30 31 if __name__ == '__main__': 32 sys.exit(main())