From 3811debea64b0bec42257bcec9399b52a2820a82 Mon Sep 17 00:00:00 2001 From: jonschz Date: Sun, 16 Jun 2024 14:08:57 +0200 Subject: [PATCH] run formatter --- tools/ghidra_scripts/lego_util/function_importer.py | 10 ++++++++-- tools/ghidra_scripts/lego_util/type_importer.py | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/ghidra_scripts/lego_util/function_importer.py b/tools/ghidra_scripts/lego_util/function_importer.py index 9b9b429b..80176fc5 100644 --- a/tools/ghidra_scripts/lego_util/function_importer.py +++ b/tools/ghidra_scripts/lego_util/function_importer.py @@ -92,9 +92,15 @@ def matches_ghidra_function(self, ghidra_function: Function) -> bool: (not return_type_match) and (self.return_type.getLength() > 4) and (add_pointer_type(self.api, self.return_type) == ghidra_return_type) - and any(param for param in ghidra_function.getParameters() if param.getName() == "__return_storage_ptr__") + and any( + param + for param in ghidra_function.getParameters() + if param.getName() == "__return_storage_ptr__" + ) ): - logger.debug("%s has a return type larger than 4 bytes", self.get_full_name()) + logger.debug( + "%s has a return type larger than 4 bytes", self.get_full_name() + ) return_type_match = True # match arguments: decide if thiscall or not diff --git a/tools/ghidra_scripts/lego_util/type_importer.py b/tools/ghidra_scripts/lego_util/type_importer.py index a3e55a26..c645ebf8 100644 --- a/tools/ghidra_scripts/lego_util/type_importer.py +++ b/tools/ghidra_scripts/lego_util/type_importer.py @@ -269,7 +269,6 @@ def _get_or_create_namespace(self, class_name_with_namespace: str): def _get_or_create_enum_data_type( self, enum_type_name: str, enum_type_size: int ) -> Enum: - if (known_enum := self.handled_enums.get(enum_type_name, None)) is not None: return known_enum @@ -325,7 +324,9 @@ def _get_or_create_data_type( data_type = ( self.api.getCurrentProgram() .getDataTypeManager() - .addDataType(new_instance_callback(), DataTypeConflictHandler.KEEP_HANDLER) + .addDataType( + new_instance_callback(), DataTypeConflictHandler.KEEP_HANDLER + ) ) logger.info( "Created new %s data type %s", readable_name_of_type_category, type_name