From 893e730742452a041f26501b30e95e46d4363ec1 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 22 Apr 2019 20:27:18 -0400 Subject: Add SetLicense API --- python/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'python/__init__.py') diff --git a/python/__init__.py b/python/__init__.py index 03154991..711a178a 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -225,11 +225,12 @@ _plugin_init = False def _init_plugins(): global _plugin_init if not _plugin_init: - _plugin_init = True core.BNInitCorePlugins() core.BNInitUserPlugins() core.BNInitRepoPlugins() - if not core.BNIsLicenseValidated(): + if core.BNIsLicenseValidated(): + _plugin_init = True + else: raise RuntimeError("License is not valid. Please supply a valid license.") @@ -299,3 +300,8 @@ def core_license_count(): def core_ui_enabled(): '''Indicates that a UI exists and the UI has invoked BNInitUI''' return core.BNIsUIEnabled() + + +def core_set_license(licenseData): + '''Set the Binary Ninja license data, an alternative to storing a ``license.dat`` file''' + core.BNSetLicense(licenseData) \ No newline at end of file -- cgit v1.3.1