#!/usr/bin/env python3 import avfs import os, sys def is_elf(fname): return b'\x7fELF' == avfs.open(fname, 'rb').read(4) if __name__ == "__main__": for fname in avfs.find(os.fsencode(sys.argv[1]), {b'.git'}): try: if is_elf(fname): print(fname.decode('utf-8', 'replace')) except: pass