From 6661609598076636391651115793864291319845 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Thu, 11 Apr 2024 16:24:47 -0400 Subject: Change default paddingCols value to 64 80 would have made sense if it were characters, but blocks of 0x50 bytes just look plain weird --- binaryninjaapi.h | 8 ++++---- python/typeprinter.py | 10 +++++----- python/types.py | 2 +- rust/src/types.rs | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 7b66133c..602b2475 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -8795,7 +8795,7 @@ namespace BinaryNinja { bool AddTypeMemberTokens(BinaryView* data, std::vector& tokens, int64_t offset, std::vector& nameList, size_t size = 0, bool indirect = false); std::vector GetLines(const TypeContainer& types, const std::string& name, - int paddingCols = 80, bool collapsed = false, BNTokenEscapingType escaping = NoTokenEscapingType); + int paddingCols = 64, bool collapsed = false, BNTokenEscapingType escaping = NoTokenEscapingType); static std::string GetSizeSuffix(size_t size); }; @@ -14924,7 +14924,7 @@ namespace BinaryNinja { Ref type, const TypeContainer& types, const QualifiedName& name, - int paddingCols = 80, + int paddingCols = 64, bool collapsed = false, BNTokenEscapingType escaping = NoTokenEscapingType ) = 0; @@ -14940,7 +14940,7 @@ namespace BinaryNinja { virtual std::string PrintAllTypes( const std::vector>>& types, Ref data, - int paddingCols = 80, + int paddingCols = 64, BNTokenEscapingType escaping = NoTokenEscapingType ); @@ -14956,7 +14956,7 @@ namespace BinaryNinja { std::string DefaultPrintAllTypes( const std::vector>>& types, Ref data, - int paddingCols = 80, + int paddingCols = 64, BNTokenEscapingType escaping = NoTokenEscapingType ); }; diff --git a/python/typeprinter.py b/python/typeprinter.py index 47793ec3..aea598b3 100644 --- a/python/typeprinter.py +++ b/python/typeprinter.py @@ -288,7 +288,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass): log_error(traceback.format_exc()) return False - def _default_print_all_types(self, types_: List[Tuple[types.QualifiedNameType, types.Type]], data: binaryview.BinaryView, padding_cols = 80, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) -> str: + def _default_print_all_types(self, types_: List[Tuple[types.QualifiedNameType, types.Type]], data: binaryview.BinaryView, padding_cols = 64, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) -> str: cpp_names = (core.BNQualifiedName * len(types_))() cpp_types = (ctypes.POINTER(core.BNType) * len(types_))() @@ -379,7 +379,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass): """ raise NotImplementedError() - def get_type_lines(self, type: types.Type, container: 'typecontainer.TypeContainer', name: types.QualifiedNameType, padding_cols = 80, collapsed = False, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) -> List[types.TypeDefinitionLine]: + def get_type_lines(self, type: types.Type, container: 'typecontainer.TypeContainer', name: types.QualifiedNameType, padding_cols = 64, collapsed = False, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) -> List[types.TypeDefinitionLine]: """ Generate a multi-line representation of a type @@ -393,7 +393,7 @@ class TypePrinter(metaclass=_TypePrinterMetaclass): """ raise NotImplementedError() - def print_all_types(self, types: List[Tuple[types.QualifiedNameType, types.Type]], data: binaryview.BinaryView, padding_cols = 80, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) -> str: + def print_all_types(self, types: List[Tuple[types.QualifiedNameType, types.Type]], data: binaryview.BinaryView, padding_cols = 64, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) -> str: """ Print all types to a single big string, including headers, sections, etc @@ -491,7 +491,7 @@ class CoreTypePrinter(TypePrinter): def get_type_lines(self, type: types.Type, container: 'typecontainer.TypeContainer', name: types.QualifiedNameType, - padding_cols = 80, collapsed = False, + padding_cols = 64, collapsed = False, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType ) -> List[types.TypeDefinitionLine]: if not isinstance(name, types.QualifiedName): @@ -507,7 +507,7 @@ class CoreTypePrinter(TypePrinter): core.BNFreeTypeDefinitionLineList(core_lines, count.value) return lines - def print_all_types(self, types_: List[Tuple[types.QualifiedNameType, types.Type]], data: binaryview.BinaryView, padding_cols = 80, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) -> str: + def print_all_types(self, types_: List[Tuple[types.QualifiedNameType, types.Type]], data: binaryview.BinaryView, padding_cols = 64, escaping: TokenEscapingType = TokenEscapingType.BackticksTokenEscapingType) -> str: cpp_names = (core.BNQualifiedName * len(types_))() cpp_types = (ctypes.POINTER(core.BNType) * len(types_))() diff --git a/python/types.py b/python/types.py index e08bc796..945b88be 100644 --- a/python/types.py +++ b/python/types.py @@ -2005,7 +2005,7 @@ class Type: return result def get_lines( - self, bv: Union['binaryview.BinaryView', 'typecontainer.TypeContainer'], name: str, padding_cols: int = 80, collapsed: bool = False, + self, bv: Union['binaryview.BinaryView', 'typecontainer.TypeContainer'], name: str, padding_cols: int = 64, collapsed: bool = False, escaping: TokenEscapingType = TokenEscapingType.NoTokenEscapingType ) -> List['TypeDefinitionLine']: """ diff --git a/rust/src/types.rs b/rust/src/types.rs index 2a2a50d4..8f14cf00 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -1235,7 +1235,7 @@ impl fmt::Debug for Type { self.handle, container, "".as_ptr() as *const c_char, - 80, + 64, false, BNTokenEscapingType::NoTokenEscapingType, &mut count as *mut usize, -- cgit v1.3.1