diff options
| author | Mason Reed <mason@vector35.com> | 2026-02-17 20:11:39 -0800 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-02-23 00:09:44 -0800 |
| commit | b765ffd736ecbfbb7c19b7e166a021ac46a9eeb8 (patch) | |
| tree | 674f5aaa6a8541e29a407511f1db37e07074e436 /python/typelibrary.py | |
| parent | c980b77666bba9e4480c44de72cc8de0ca10c8e4 (diff) | |
[BNTL] Allow decompressing standalone TypeLibrary objects
Previously you must have written the type library to disk
Diffstat (limited to 'python/typelibrary.py')
| -rw-r--r-- | python/typelibrary.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/python/typelibrary.py b/python/typelibrary.py index 71848c23..b02fbfda 100644 --- a/python/typelibrary.py +++ b/python/typelibrary.py @@ -57,17 +57,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']: """ Loads a finalized type library instance from file @@ -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): """ |
