mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-13 13:17:38 +02:00
Allow the vmware stacker to ask the FileLayer it's on top of what filename it had.
This commit is contained in:
@@ -70,6 +70,11 @@ class FileLayer(interfaces.layers.DataLayerInterface):
|
||||
self._file_ = None
|
||||
self._size = os.path.getsize(self._filename)
|
||||
|
||||
@property
|
||||
def filename(self):
|
||||
"""Returns the filename on which this Layer abstracts"""
|
||||
return self._filename
|
||||
|
||||
@property
|
||||
def _file(self):
|
||||
"""Property to prevent the initializer storing an unserializable open file (for context cloning)"""
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
import struct
|
||||
from urllib import parse
|
||||
|
||||
from volatility.framework import interfaces
|
||||
from volatility.framework.configuration import requirements
|
||||
@@ -107,12 +106,10 @@ class VmwareStacker(interfaces.automagic.StackerLayerInterface):
|
||||
"""Attempt to stack this based on the starting information"""
|
||||
if not isinstance(context.memory[layer_name], physical.FileLayer):
|
||||
return
|
||||
if not context.config.get("automagic.general.single_location", None):
|
||||
return
|
||||
location = parse.urlparse(context.config["automagic.general.single_location"])
|
||||
if location.path.endswith(".vmem"):
|
||||
vmss = location.path[:-5] + ".vmss"
|
||||
vmsn = location.path[:-5] + ".vmsn"
|
||||
location = context.memory[layer_name].filename
|
||||
if location.endswith(".vmem"):
|
||||
vmss = location[:-5] + ".vmss"
|
||||
vmsn = location[:-5] + ".vmsn"
|
||||
current_layer_name = context.memory.free_layer_name("VmwareMetaLayer")
|
||||
current_config_path = interfaces.configuration.path_join("automagic", "layer_stacker", "stack",
|
||||
current_layer_name)
|
||||
|
||||
Reference in New Issue
Block a user