mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-17 20:35:40 +02:00
Core: Fix up more scanning notes/warnings
This commit is contained in:
@@ -17,6 +17,7 @@ def seekread(f, offset = None, length = 0, relative = True):
|
||||
f.seek(offset, [0, 1, 2][relative])
|
||||
if length:
|
||||
return f.read(length)
|
||||
return None
|
||||
|
||||
|
||||
def parse_pbzx(pbzx_path):
|
||||
@@ -64,10 +65,6 @@ def parse_pbzx(pbzx_path):
|
||||
xar_f.write(f_content)
|
||||
if tail != 'YZ':
|
||||
raise RuntimeError("Error: Footer is not xar file footer")
|
||||
try:
|
||||
xar_f.close()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -154,7 +154,8 @@ class VmwareStacker(interfaces.automagic.StackerLayerInterface):
|
||||
|
||||
vmss_success = False
|
||||
with contextlib.suppress(IOError):
|
||||
_ = resources.ResourceAccessor().open(vmss).read(10)
|
||||
with resources.ResourceAccessor().open(vmss) as fp:
|
||||
_ = fp.read(10)
|
||||
context.config[interfaces.configuration.path_join(current_config_path, "location")] = vmss
|
||||
context.layers.add_layer(physical.FileLayer(context, current_config_path, current_layer_name))
|
||||
vmss_success = True
|
||||
|
||||
@@ -747,10 +747,8 @@ class AggregateType(interfaces.objects.ObjectInterface):
|
||||
if isinstance(cls, agg_type):
|
||||
agg_name = agg_type.__name__
|
||||
|
||||
assert isinstance(members, collections.abc.Mapping)
|
||||
f"{agg_name} members parameter must be a mapping: {type(members)}"
|
||||
assert all([(isinstance(member, tuple) and len(member) == 2) for member in members.values()])
|
||||
f"{agg_name} members must be a tuple of relative_offsets and templates"
|
||||
assert isinstance(members, collections.abc.Mapping), f"{agg_name} members parameter must be a mapping: {type(members)}"
|
||||
assert all([(isinstance(member, tuple) and len(member) == 2) for member in members.values()]), f"{agg_name} members must be a tuple of relative_offsets and templates"
|
||||
|
||||
def member(self, attr: str = 'member') -> object:
|
||||
"""Specifically named method for retrieving members."""
|
||||
|
||||
@@ -33,7 +33,11 @@ class UserAssist(interfaces.plugins.PluginInterface):
|
||||
self._reg_table_name = None
|
||||
self._win7 = None
|
||||
# taken from http://msdn.microsoft.com/en-us/library/dd378457%28v=vs.85%29.aspx
|
||||
self._folder_guids = json.load(open(os.path.join(os.path.dirname(__file__), "userassist.json"), "rb"))
|
||||
try:
|
||||
with open(os.path.join(os.path.dirname(__file__), "userassist.json"), "rb") as fp:
|
||||
self._folder_guids = json.load(fp)
|
||||
except IOError:
|
||||
vollog.error("Usersassist data file not found")
|
||||
|
||||
@classmethod
|
||||
def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]:
|
||||
|
||||
@@ -128,7 +128,7 @@ class module(generic.GenericIntelProcess):
|
||||
sym_addr = sym.st_value
|
||||
if wanted_sym_name == sym_name:
|
||||
return sym_addr
|
||||
return # Generation finished
|
||||
return None
|
||||
|
||||
@property
|
||||
def section_symtab(self):
|
||||
|
||||
@@ -934,6 +934,7 @@ class PdbRetreiver:
|
||||
if progress_callback is not None:
|
||||
progress_callback(100, f"Downloading {url + suffix}")
|
||||
if result is None:
|
||||
result.close()
|
||||
return None
|
||||
return url + suffix
|
||||
|
||||
|
||||
Reference in New Issue
Block a user