Skip to content

What's the difference between passive and active objects in the python API? #2360

Answered by psifertex
psifertex asked this question in Q&A
Discussion options

You must be logged in to vote

First, a quick refresher: Binary Ninja has a C++ core with a C API for binary compatibility (and multi-language bindings) and its most popular (but not only!) API for plugins is Python. That means when you use the Python API to request an objet from the core, some of those objects will represent a currently live, active object in the core. Changes you make in the core will be immediately reflected in the Python API and vice-versa.

For example:

>>> a = current_function
>>> a.name
_start
>>> #Use the UI and rename the function
>>> a.name
newname
>>> a.name = "different"
>>> # Look in the UI and the function has changed

Function objects are active.

(One rule of thumb is that if the python c…

Replies: 1 comment

Comment options

psifertex
Apr 7, 2021
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by psifertex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant