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

Function _init_plugins

python/__init__.py:234–256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232
233
234def _init_plugins():
235 global _enable_default_log
236 global _plugin_init
237 global _enterprise_license_checkout
238
239 if not _plugin_init:
240 if not core_ui_enabled() and (core.BNGetProduct() == "Binary Ninja Enterprise Client" or core.BNGetProduct() == "Binary Ninja Ultimate"):
241 # Enterprise client needs to reserve a license or else BNInitPlugins will fail
242 _enterprise_license_checkout = enterprise.LicenseCheckout()
243 _enterprise_license_checkout.acquire()
244
245 # The first call to BNInitCorePlugins returns True for successful initialization and True in this context indicates headless operation.
246 # The result is pulled from BNInitPlugins as that now wraps BNInitCorePlugins.
247 is_headless_init_once = core.BNInitPlugins(not os.environ.get('BN_DISABLE_USER_PLUGINS'))
248 min_level = Settings().get_string("python.log.minLevel")
249 if _enable_default_log and is_headless_init_once and min_level in LogLevel.__members__ and not core_ui_enabled(
250 ) and sys.stderr.isatty():
251 log_to_stderr(LogLevel[min_level])
252 core.BNInitRepoPlugins()
253 if core.BNIsLicenseValidated():
254 _plugin_init = True
255 else:
256 raise RuntimeError("License is not valid. Please supply a valid license.")
257
258
259_destruct_callbacks = _DestructionCallbackHandler()

Callers

nothing calls this directly

Calls 8

acquireMethod · 0.95
core_ui_enabledFunction · 0.85
log_to_stderrFunction · 0.85
LicenseCheckoutMethod · 0.80
SettingsClass · 0.70
getMethod · 0.45
get_stringMethod · 0.45
isattyMethod · 0.45

Tested by

no test coverage detected