#1473 - black fixes

This commit is contained in:
Dave Lassalle
2025-01-23 11:59:37 -06:00
parent b8d9c7b883
commit 6c4cafa64f
4 changed files with 31 additions and 7 deletions
@@ -87,10 +87,18 @@ class GetServiceSIDs(interfaces.plugins.PluginInterface):
# Get ControlSet\Services.
try:
services = hive.get_key(r"CurrentControlSet\Services")
except (KeyError, exceptions.InvalidAddressException, registry.RegistryFormatException):
except (
KeyError,
exceptions.InvalidAddressException,
registry.RegistryFormatException,
):
try:
services = hive.get_key(r"ControlSet001\Services")
except (KeyError, exceptions.InvalidAddressException, registry.RegistryFormatException):
except (
KeyError,
exceptions.InvalidAddressException,
registry.RegistryFormatException,
):
continue
if services:
@@ -158,7 +158,11 @@ class GetSIDs(interfaces.plugins.PluginInterface):
layers.registry.RegistryFormatException,
):
continue
except (KeyError, exceptions.InvalidAddressException, layers.registry.RegistryFormatException):
except (
KeyError,
exceptions.InvalidAddressException,
layers.registry.RegistryFormatException,
):
continue
return sids
@@ -173,10 +173,14 @@ class UserAssist(interfaces.plugins.PluginInterface, timeliner.TimeLinerInterfac
return_list=True,
)
except RegistryFormatException as e:
vollog.warning(f"Error accessing UserAssist key in {hive_name} at {hive.hive_offset:#x}")
vollog.warning(
f"Error accessing UserAssist key in {hive_name} at {hive.hive_offset:#x}"
)
return None
except KeyError:
vollog.warning(f"UserAssist key not found in {hive_name} at {hive.hive_offset:#x}")
vollog.warning(
f"UserAssist key not found in {hive_name} at {hive.hive_offset:#x}"
)
return None
if not userassist_node_path:
@@ -159,12 +159,20 @@ class SvcScan(interfaces.plugins.PluginInterface):
return cast(
objects.StructType, hive.get_key(r"CurrentControlSet\Services")
)
except (KeyError, exceptions.InvalidAddressException, registry.RegistryFormatException):
except (
KeyError,
exceptions.InvalidAddressException,
registry.RegistryFormatException,
):
try:
return cast(
objects.StructType, hive.get_key(r"ControlSet001\Services")
)
except (KeyError, exceptions.InvalidAddressException, registry.RegistryFormatException):
except (
KeyError,
exceptions.InvalidAddressException,
registry.RegistryFormatException,
):
vollog.log(
constants.LOGLEVEL_VVVV,
"Could not retrieve any control set from SYSTEM hive",