From 60f14478e2860cb97ef15954f80ee82202f5935f Mon Sep 17 00:00:00 2001 From: Dave Lassalle Date: Sat, 3 Aug 2024 14:30:27 -0700 Subject: [PATCH] #816 - black fixes --- .../framework/plugins/windows/cmdscan.py | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/volatility3/framework/plugins/windows/cmdscan.py b/volatility3/framework/plugins/windows/cmdscan.py index 1e435c56f..b92d7efab 100644 --- a/volatility3/framework/plugins/windows/cmdscan.py +++ b/volatility3/framework/plugins/windows/cmdscan.py @@ -65,7 +65,9 @@ class CmdScan(interfaces.plugins.PluginInterface): @classmethod def get_filtered_vads( - cls, conhost_proc: interfaces.context.ContextInterface, size_filter: Optional[int]=0x40000000 + cls, + conhost_proc: interfaces.context.ContextInterface, + size_filter: Optional[int] = 0x40000000, ) -> List[Tuple[int, int]]: """ Returns vads of a process with smaller than size_filter @@ -129,7 +131,9 @@ class CmdScan(interfaces.plugins.PluginInterface): f"Found conhost process {conhost_proc} with pid {conhost_proc.UniqueProcessId}" ) - conhostexe_base, conhostexe_size = consoles.Consoles.find_conhostexe(conhost_proc) + conhostexe_base, conhostexe_size = consoles.Consoles.find_conhostexe( + conhost_proc + ) if not conhostexe_base: vollog.info( "Unable to find the location of conhost.exe. Analysis cannot proceed." @@ -154,7 +158,7 @@ class CmdScan(interfaces.plugins.PluginInterface): context, scanners.BytesScanner(max_history_bytes), sections=sections, - ): + ): command_history_properties = [] try: @@ -272,18 +276,24 @@ class CmdScan(interfaces.plugins.PluginInterface): no_registry = self.config.get("no_registry") if no_registry is False: - max_history, _max_buffers = consoles.Consoles.get_console_settings_from_registry( - self.context, - self.config_path, - kernel.layer_name, - kernel.symbol_table_name, - max_history, - [], + max_history, _max_buffers = ( + consoles.Consoles.get_console_settings_from_registry( + self.context, + self.config_path, + kernel.layer_name, + kernel.symbol_table_name, + max_history, + [], + ) ) vollog.debug(f"Possible CommandHistorySize values: {max_history}") - for proc, command_history, command_history_properties in self.get_command_history( + for ( + proc, + command_history, + command_history_properties, + ) in self.get_command_history( self.context, kernel.layer_name, kernel.symbol_table_name, @@ -305,7 +315,9 @@ class CmdScan(interfaces.plugins.PluginInterface): ( renderers.NotApplicableValue() if command_history_property["address"] is None - else format_hints.Hex(command_history_property["address"]) + else format_hints.Hex( + command_history_property["address"] + ) ), str(command_history_property["data"]), ),