Loading...
Searching...
No Matches
BinaryNinja::Enterprise::LicenseCheckout Class Reference

RAII object for holding an Enterprise floating license in a scope. More...

Detailed Description

RAII object for holding an Enterprise floating license in a scope.

Automatically releases the license when destroyed.

Example:

using namespace BinaryNinja;
assert(Enterprise::AuthenticateWithCredentials("username", "password", true));
{
Ref<BinaryView> bv = Load("/bin/ls", true, {}, options);
printf("%llx\n", bv->GetStart());
// License is released at end of scope
}

Public Member Functions

 LicenseCheckout (int64_t duration=900)
 RAII constructor that checks out a license.
 ~LicenseCheckout ()

Constructor & Destructor Documentation

◆ LicenseCheckout()

BinaryNinja::Enterprise::LicenseCheckout::LicenseCheckout ( int64_t duration = 900)
explicit

RAII constructor that checks out a license.

License will be refreshed automatically in a background thread while checked out, in intervals of duration In the event of program crash, the license will expire duration seconds after the most recent background refresh, so you may want a smaller value like 60 if you expect your program to crash / be killed often. See class docs for example usage.

Parameters
durationDuration for refreshes and also length of each license checkout.
Exceptions
EnterpriseExceptionIf license checkout fails

◆ ~LicenseCheckout()

BinaryNinja::Enterprise::LicenseCheckout::~LicenseCheckout ( )