summaryrefslogtreecommitdiff
path: root/python/__init__.py
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2024-02-19 15:04:00 -0500
committerJordan Wiens <jordan@psifertex.com>2024-02-23 11:14:06 -0500
commit448f40be71dffa86a6581c3696627ccc1bdf74f2 (patch)
treecd79923c85986c0135b41eb7432e54218f1a56e5 /python/__init__.py
parent748c2295e31c03afa1d4b1b776a59f9fa9a48d34 (diff)
4.0 documentation
- Refactored Type Documentation - Added Projects - Added Type Archives - Added New Sidebar Documentation - Added String Concepts - Added Light/Dark Mode - Added New Tab Documentation - Added BNIL Guide: HLIL docs - Added new cookbook examples - Added migration guide - Added script for building docsets - Added documentation for themes - Updated all images to Ninja Edit - API Docs : Documents BasicBlockEdge and BasicBlock - API Docs : Documents CoreVariable, Variable, and VariableNameAndType - API Docs : Corrects note on `BinaryView.update_analysis` and `BinaryView.update_analysis_and_wait` to represent that analysis is run by default for you now. - Many, many other changes
Diffstat (limited to 'python/__init__.py')
-rw-r--r--python/__init__.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/python/__init__.py b/python/__init__.py
index 144d022a..9e31f906 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -94,6 +94,8 @@ if core.BNGetProduct() == "Binary Ninja Enterprise Client":
def shutdown():
"""
``shutdown`` cleanly shuts down the core, stopping all workers and closing all log files.
+
+ .. note:: This will be called automatically on script exit if you import the binaryninja module.
"""
core.BNShutdown()
@@ -103,13 +105,30 @@ atexit.register(shutdown)
@dataclass
class CoreVersionInfo:
+ """
+ Structure representing the Binary Ninja Version.
+
+ Use :py:func:`core_version_info` to look up the current version of Binary Ninja loaded.
+ """
+
major: int
+ """Major version number, e.g. 4.0.5000-dev would be 4"""
+
minor: int
+ """Minor version number, e.g. 4.0.5000-dev would be 0"""
+
build: int
+ """Build version number, e.g. 4.0.5000-dev would be 5000"""
+
channel: str
+ """Release channel name, e.g. "dev" or "Stable" """
def get_unique_identifier():
+ """
+ Generate a GUID
+ :return: A GUID string
+ """
return core.BNGetUniqueIdentifierString()
@@ -299,6 +318,10 @@ def core_set_license(licenseData: str) -> None:
def get_memory_usage_info() -> Mapping[str, int]:
+ """
+ Get counts of various Binary Ninja objects in memory.
+ :return: Dictionary of {class name: count} for objects in memory
+ """
count = ctypes.c_ulonglong()
info = core.BNGetMemoryUsageInfo(count)
assert info is not None, "core.BNGetMemoryUsageInfo returned None"
@@ -341,7 +364,7 @@ def load(*args, **kwargs) -> BinaryView:
return bv
-@deprecation.deprecated(deprecated_in="3.5.4378", details='Use :py:func:`BinaryView.load` instead')
+@deprecation.deprecated(deprecated_in="3.5.4378", details='Use :py:func:`load` instead')
def open_view(*args, **kwargs) -> BinaryView:
return load(*args, **kwargs)
@@ -383,6 +406,9 @@ def connect_vscode_debugger(port=5678):
class UIPluginInHeadlessError(Exception):
+ """
+ Error thrown when trying to load a UI plugin in a headless Binary Ninja installation.
+ """
def __init__(self, *args, **kwargs):
Exception.__init__(self, *args, **kwargs)