From 35adefaa9d1ecf5e8c09a787dbd6bda1d1a49325 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Wed, 5 Apr 2023 13:54:44 -0400 Subject: Add APIs for dumping the contents of TypeLibraries --- python/typelibrary.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'python/typelibrary.py') diff --git a/python/typelibrary.py b/python/typelibrary.py index 63e7c33b..adc3919d 100644 --- a/python/typelibrary.py +++ b/python/typelibrary.py @@ -54,6 +54,27 @@ 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 decompress(path: str) -> str: + """ + Decompresses a type library file to a string. + + :param str path: + :rtype: str + """ + return core.BNTypeLibraryDecompressToString(path) + @staticmethod def load_from_file(path: str) -> Optional['TypeLibrary']: """ -- cgit v1.3.1