strip_binary.py 910 B

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