#816 formatting fixes

This commit is contained in:
Dave Lassalle
2024-10-01 13:00:15 -05:00
parent bd678eaf80
commit ece2dbe9a7
2 changed files with 15 additions and 5 deletions
@@ -168,7 +168,7 @@ class Consoles(interfaces.plugins.PluginInterface):
raise NotImplementedError(
"Kernel Debug Structure version format not supported!"
)
except:
except Exception:
# unsure what to raise here. Also, it might be useful to add some kind of fallback,
# either to a user-provided version or to another method to determine conhost.exe's version
raise exceptions.VolatilityException(
@@ -834,7 +834,7 @@ class Consoles(interfaces.plugins.PluginInterface):
max_history.add(value.decode_data())
elif val_name == "NumberOfHistoryBuffers":
max_buffers.add(value.decode_data())
except:
except Exception:
continue
return max_history, max_buffers
@@ -95,6 +95,8 @@ class ALIAS(objects.StructType):
"string", encoding="utf-16", errors="replace", max_length=512
)
return None
def get_target(self):
if self.Target.Length < 8:
return self.Target.Chars.cast(
@@ -108,6 +110,8 @@ class ALIAS(objects.StructType):
"string", encoding="utf-16", errors="replace", max_length=512
)
return None
class EXE_ALIAS_LIST(objects.StructType):
"""An Exe Alias List Structure"""
@@ -131,6 +135,8 @@ class EXE_ALIAS_LIST(objects.StructType):
"string", encoding="utf-16", errors="replace", max_length=512
)
return None
def get_aliases(self):
"""Generator for the individual aliases for a
particular executable."""
@@ -211,7 +217,7 @@ class SCREEN_INFORMATION(objects.StructType):
try:
text = row.get_text(truncate_lines)
rows.append(text)
except:
except Exception:
break
if truncate_rows:
@@ -301,7 +307,7 @@ class CONSOLE_INFORMATION(objects.StructType):
return self.Title.dereference().cast(
"string", encoding="utf-16", errors="replace", max_length=512
)
except:
except Exception:
return ""
def get_original_title(self):
@@ -309,7 +315,7 @@ class CONSOLE_INFORMATION(objects.StructType):
return self.OriginalTitle.dereference().cast(
"string", encoding="utf-16", errors="replace", max_length=512
)
except:
except Exception:
return ""
@@ -340,6 +346,8 @@ class COMMAND(objects.StructType):
"string", encoding="utf-16", errors="replace", max_length=512
)
return None
class COMMAND_HISTORY(objects.StructType):
"""A Command History Structure."""
@@ -387,6 +395,8 @@ class COMMAND_HISTORY(objects.StructType):
"string", encoding="utf-16", errors="replace", max_length=512
)
return None
def scan_command_bucket(self, end=None):
"""Brute force print all strings pointed to by the CommandBucket entries by
going to greater of EndCapacity or CommandCountMax*sizeof(_COMMAND)"""