()
| 28 | |
| 29 | |
| 30 | def main(): |
| 31 | with enterprise.LicenseCheckout(): |
| 32 | # Connect to remote from Enterprise |
| 33 | remote = collaboration.enterprise_remote() |
| 34 | if not remote: |
| 35 | return |
| 36 | if not remote.is_connected: |
| 37 | # Will pull default credentials from Enterprise |
| 38 | remote.connect() |
| 39 | |
| 40 | # Pull every file from every project |
| 41 | for project in remote.projects: |
| 42 | for file in project.files: |
| 43 | bndb_path = file.default_path |
| 44 | print(f"{project.name}/{file.name} BNDB at {bndb_path}") |
| 45 | |
| 46 | try: |
| 47 | metadata: binaryninja.FileMetadata = file.download_to_bndb(bndb_path) |
| 48 | |
| 49 | for v in metadata.existing_views: |
| 50 | if v == 'Raw': |
| 51 | continue |
| 52 | bv = metadata.get_view_of_type(v) |
| 53 | # Show the entry point to demonstrate we have pulled the analyzed file |
| 54 | print(f"{project.name}/{file.name} {v} Entrypoint @ 0x{bv.entry_point:08x}") |
| 55 | except InterruptedError as e: |
| 56 | # In case of ^C |
| 57 | raise e |
| 58 | |
| 59 | except Exception as e: |
| 60 | # In case download or open fails |
| 61 | print(f"{project.name}/{file.name} Load failed: {e}", file=sys.stderr) |
| 62 | |
| 63 | |
| 64 | if __name__ == '__main__': |
no test coverage detected