From e0fbcc712f8ca31914d2f1e04b7f8b16eff44d66 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Fri, 12 Jun 2020 16:27:36 -0400 Subject: Add BinaryView.parse_types_from_string to the python API and update how the underlying BNParseTypesString works --- python/platform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/platform.py') diff --git a/python/platform.py b/python/platform.py index 5031d2d6..8d7d1d99 100644 --- a/python/platform.py +++ b/python/platform.py @@ -411,7 +411,7 @@ class Platform(with_metaclass(_PlatformMetaClass, object)): errors = ctypes.c_char_p() result = core.BNParseTypesFromSource(self.handle, source, filename, parse, errors, dir_buf, len(include_dirs), auto_type_source) - error_str = errors.value + error_str = errors.value.decode("utf-8") core.BNFreeString(ctypes.cast(errors, ctypes.POINTER(ctypes.c_byte))) if not result: raise SyntaxError(error_str) @@ -460,7 +460,7 @@ class Platform(with_metaclass(_PlatformMetaClass, object)): errors = ctypes.c_char_p() result = core.BNParseTypesFromSourceFile(self.handle, filename, parse, errors, dir_buf, len(include_dirs), auto_type_source) - error_str = errors.value + error_str = errors.value.decode("utf-8") core.BNFreeString(ctypes.cast(errors, ctypes.POINTER(ctypes.c_byte))) if not result: raise SyntaxError(error_str) -- cgit v1.3.1