MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / main

Function main

python/collaboration/examples/download_everything.py:30–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29
30def 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
64if __name__ == '__main__':

Callers 1

Calls 4

LicenseCheckoutMethod · 0.80
download_to_bndbMethod · 0.80
connectMethod · 0.45
get_view_of_typeMethod · 0.45

Tested by

no test coverage detected