From 61b4bb24e06aa955484293d35fa926c07887544b Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 7 Jun 2021 09:59:54 -0400 Subject: Add type hints to basicblock.py, lowlevelil.py, architecture.py --- docs/dev/batch.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/dev/batch.md') diff --git a/docs/dev/batch.md b/docs/dev/batch.md index dd955bf8..044be8ac 100644 --- a/docs/dev/batch.md +++ b/docs/dev/batch.md @@ -22,7 +22,7 @@ Let's try a simple example script (note that this script will work identically o #!/usr/bin/env python3 import binaryninja with binaryninja.open_view("/bin/ls") as bv: - print(f"Opening {bv.file.filename} which has {len(bv.functions)} functions") + print(f"Opening {bv.file.filename} which has {len(list(bv.functions))} functions") ``` If we run it, we'll see: @@ -48,7 +48,7 @@ from binaryninja import open_view from glob import glob for bin in glob("/bin/*"): with open_view(bin, update_analysis=False) as bv: - print(f"Opening {bv.file.filename} which has {len(bv.functions)} functions") + print(f"Opening {bv.file.filename} which has {len(list(bv.functions))} functions") ``` Now let's run it and notice it's fast enough to parse all of `/bin/*` in just a few seconds: @@ -97,7 +97,7 @@ from multiprocessing import Pool, cpu_count, set_start_method def spawn(filename): binaryninja.set_worker_thread_count(1) with binaryninja.open_view(filename, update_analysis=False) as bv: - print(f"Binary {bv.file.filename} has {len(bv.functions)} functions.") + print(f"Binary {bv.file.filename} has {len(list(bv.functions))} functions.") if __name__ == '__main__': set_start_method("spawn") -- cgit v1.3.1