mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-26 19:44:50 +02:00
Core: Fix LGTM recommendations
This is mostly unused imports and unused variables.
This commit is contained in:
@@ -151,9 +151,9 @@ class QemuSuspendLayer(segmented.NonLinearlySegmentedLayer):
|
||||
layer_name = self._base_layer,
|
||||
max_length = name_len)
|
||||
index += name_len
|
||||
instance_id = self.context.object(self._qemu_table_name + constants.BANG + 'unsigned long',
|
||||
offset = index,
|
||||
layer_name = self._base_layer)
|
||||
# instance_id = self.context.object(self._qemu_table_name + constants.BANG + 'unsigned long',
|
||||
# offset = index,
|
||||
# layer_name = self._base_layer)
|
||||
index += 4
|
||||
version_id = self.context.object(self._qemu_table_name + constants.BANG + 'unsigned long',
|
||||
offset = index,
|
||||
|
||||
@@ -33,6 +33,7 @@ except ImportError:
|
||||
|
||||
vollog = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# TODO: Type-annotating the ResourceAccessor.open method is difficult because HTTPResponse is not actually an IO[Any] type
|
||||
# fix this
|
||||
|
||||
@@ -155,9 +156,7 @@ class ResourceAccessor(object):
|
||||
IMPORTED_MAGIC = True
|
||||
# This is because python-magic and file provide a magic module
|
||||
# Only file's python has magic.detect_from_fobj
|
||||
except AttributeError:
|
||||
pass
|
||||
except:
|
||||
except (AttributeError, IOError):
|
||||
pass
|
||||
|
||||
if detected:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
import re
|
||||
from typing import Generator, List, Tuple, Union
|
||||
from typing import Generator, List, Tuple
|
||||
|
||||
|
||||
class MultiRegexp(object):
|
||||
|
||||
@@ -49,7 +49,7 @@ class VmwareLayer(segmented.SegmentedLayer):
|
||||
raise VmwareFormatException(self.name, "Wrong magic bytes for Vmware layer: {}".format(repr(magic)))
|
||||
|
||||
# TODO: Change certain structure sizes based on the version
|
||||
version = magic[1] & 0xf
|
||||
# version = magic[1] & 0xf
|
||||
|
||||
group_size = struct.calcsize(self.group_structure)
|
||||
|
||||
@@ -91,9 +91,9 @@ class VmwareLayer(segmented.SegmentedLayer):
|
||||
if tags[("regionsCount", ())][1] == 0:
|
||||
raise VmwareFormatException(self.name, "VMware VMEM is not split into regions")
|
||||
for region in range(tags[("regionsCount", ())][1]):
|
||||
offset = tags[("regionPPN", (region, ))][1] * self._page_size
|
||||
mapped_offset = tags[("regionPageNum", (region, ))][1] * self._page_size
|
||||
length = tags[("regionSize", (region, ))][1] * self._page_size
|
||||
offset = tags[("regionPPN", (region,))][1] * self._page_size
|
||||
mapped_offset = tags[("regionPageNum", (region,))][1] * self._page_size
|
||||
length = tags[("regionSize", (region,))][1] * self._page_size
|
||||
self._segments.append((offset, mapped_offset, length, length))
|
||||
|
||||
@property
|
||||
@@ -111,7 +111,6 @@ class VmwareLayer(segmented.SegmentedLayer):
|
||||
|
||||
|
||||
class VmwareStacker(interfaces.automagic.StackerLayerInterface):
|
||||
|
||||
stack_order = 20
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user