From 9d98ab9b6548cfc5b36c3e6ade3425ea87498442 Mon Sep 17 00:00:00 2001 From: Dave Lassalle Date: Fri, 27 Sep 2024 10:39:57 -0500 Subject: [PATCH] #816 - black fixes --- .../framework/plugins/windows/consoles.py | 26 +++++++++++++------ .../symbols/windows/extensions/consoles.py | 5 ++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/volatility3/framework/plugins/windows/consoles.py b/volatility3/framework/plugins/windows/consoles.py index 46699aa31..89f9fcc80 100644 --- a/volatility3/framework/plugins/windows/consoles.py +++ b/volatility3/framework/plugins/windows/consoles.py @@ -244,15 +244,19 @@ class Consoles(interfaces.plugins.PluginInterface): configuration.path_join(config_path, "conhost"), "windows", "pe", - class_types=pe.class_types + class_types=pe.class_types, ) try: - (major, minor, product, build) = verinfo.VerInfo.get_version_information( - context, pe_table_name, conhost_layer_name, conhost_base + (major, minor, product, build) = ( + verinfo.VerInfo.get_version_information( + context, pe_table_name, conhost_layer_name, conhost_base + ) ) conhost_mod_version = build - vollog.debug(f"Found conhost.exe version {major}.{minor}.{product}.{build} in {conhost_layer_name} at base {conhost_base:#x}") + vollog.debug( + f"Found conhost.exe version {major}.{minor}.{product}.{build} in {conhost_layer_name} at base {conhost_base:#x}" + ) except (exceptions.InvalidAddressException, TypeError, AttributeError): # the following is IntelLayer specific and might need to be adapted to other architectures. physical_layer_name = context.layers[layer_name].config.get( @@ -432,7 +436,7 @@ class Consoles(interfaces.plugins.PluginInterface): kernel_table_name, config_path, proc_layer_name, - conhostexe_base + conhostexe_base, ) conhost_module = context.module( @@ -620,7 +624,9 @@ class Consoles(interfaces.plugins.PluginInterface): "data": exe_alias_list.get_exename(), } ) - for alias_index, alias in enumerate(exe_alias_list.get_aliases()): + for alias_index, alias in enumerate( + exe_alias_list.get_aliases() + ): console_properties.append( { "level": 3, @@ -722,7 +728,9 @@ class Consoles(interfaces.plugins.PluginInterface): ) try: - vollog.debug(f"Getting ScreenBuffer entries for {console_info}") + vollog.debug( + f"Getting ScreenBuffer entries for {console_info}" + ) console_properties.append( { "level": 1, @@ -895,7 +903,9 @@ class Consoles(interfaces.plugins.PluginInterface): ), ) else: - vollog.warn(f"_CONSOLE_INFORMATION not found for {process_name} with pid {process_pid}.") + vollog.warn( + f"_CONSOLE_INFORMATION not found for {process_name} with pid {process_pid}." + ) if proc is None: vollog.warn("No conhost.exe processes found.") diff --git a/volatility3/framework/symbols/windows/extensions/consoles.py b/volatility3/framework/symbols/windows/extensions/consoles.py index 70ef15093..555197fc4 100644 --- a/volatility3/framework/symbols/windows/extensions/consoles.py +++ b/volatility3/framework/symbols/windows/extensions/consoles.py @@ -64,7 +64,7 @@ class ROW(objects.StructType): line = "".join( ( char_row[i : i + 2].decode("utf-16le", errors="replace") - if self._valid_dbcs(char_row[i + 2], char_row[i+1]) + if self._valid_dbcs(char_row[i + 2], char_row[i + 1]) else "" ) for i in range(0, len(char_row), 3) @@ -108,6 +108,7 @@ class ALIAS(objects.StructType): "string", encoding="utf-16", errors="replace", max_length=512 ) + class EXE_ALIAS_LIST(objects.StructType): """An Exe Alias List Structure""" @@ -284,7 +285,7 @@ class CONSOLE_INFORMATION(objects.StructType): exe_alias_list = exe_alias_list.dereference() for exe_alias_list_item in exe_alias_list.to_list( f"{self.get_symbol_table_name()}{constants.BANG}_EXE_ALIAS_LIST", - "ListEntry" + "ListEntry", ): yield exe_alias_list_item