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

Function get_serial_from_license

scripts/download_headless.py:35–47  ·  view source on GitHub ↗

Extracts the serial number from the license specified in path :param path: path to license file :type path: str :raises ValueError: When no headless license is found in the provided license.dat :return: returns the serial number of the headless license :rtype: str

(path: str)

Source from the content-addressed store, hash-verified

33
34
35def get_serial_from_license(path: str) -> str:
36 """Extracts the serial number from the license specified in path
37
38 :param path: path to license file
39 :type path: str
40 :raises ValueError: When no headless license is found in the provided license.dat
41 :return: returns the serial number of the headless license
42 :rtype: str
43 """
44 with open(path) as f:
45 for license in [l for l in json.load(f) if 'Headless' in l['product']]:
46 return license['serial']
47 raise ValueError(f'No "Headless" license in {path}')
48
49
50def download_headless(serial: str, output_path: str = None, dev: bool = False) -> str:

Callers 1

download_and_installFunction · 0.85

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected