From b765ffd736ecbfbb7c19b7e166a021ac46a9eeb8 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 17 Feb 2026 20:11:39 -0800 Subject: [BNTL] Allow decompressing standalone TypeLibrary objects Previously you must have written the type library to disk --- python/typelibrary.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'python/typelibrary.py') diff --git a/python/typelibrary.py b/python/typelibrary.py index 71848c23..b02fbfda 100644 --- a/python/typelibrary.py +++ b/python/typelibrary.py @@ -56,17 +56,6 @@ class TypeLibrary: """ return TypeLibrary(core.BNNewTypeLibrary(arch.handle, name)) - @staticmethod - def decompress_to_file(path: str, output: str) -> bool: - """ - Decompresses a type library file to a file on disk. - - :param str path: - :param str output: - :rtype: bool - """ - return core.BNTypeLibraryDecompressToFile(path, output) - @staticmethod def load_from_file(path: str) -> Optional['TypeLibrary']: """ @@ -92,6 +81,17 @@ class TypeLibrary: if not core.BNWriteTypeLibraryToFile(self.handle, path): raise OSError(f"Failed to write type library to '{path}'") + def decompress_to_file(self, path: str) -> None: + """ + Decompresses the type library file to a file on disk. + + :param str path: + :rtype: bool + :raises: OSError if saving the file fails + """ + if not core.BNTypeLibraryDecompressToFile(self.handle, path): + raise OSError(f"Failed to decompress type library to '{path}'") + @staticmethod def from_name(arch: architecture.Architecture, name: str): """ -- cgit v1.3.1