Skip to content
Discussion options

You must be logged in to vote

This is a common mistake. There is a circular reference that prevents cleanup. You should use the context manager:

with binaryninja.load(source=b) as view:
    results = process_binary(view)
    write_to_disk(results)

or

for b in binaries:
    view = binaryninja.load(source=b)

    results = process_binary(view)
    write_to_disk(results)
    view.file.close()

Check out the docs for details: https://docs.binary.ninja/dev/batch.html?h=close#our-first-script

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ainterr
Comment options

Answer selected by plafosse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants