mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-12 12:47:39 +02:00
Make sure we support windows filenames
Consider refactoring out the various URL openning code into one that just returns the open file handle. This would require changing the config option of "filename" to "location" and rejigging a few other bits elsewhere, but would centralize and make it more managable.
This commit is contained in:
@@ -8,7 +8,8 @@ once a layer successfully stacks on top of the existing layers, it is removed fr
|
||||
"""
|
||||
|
||||
import logging
|
||||
from urllib import parse
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
|
||||
import volatility
|
||||
from volatility.framework import configuration, interfaces
|
||||
@@ -64,12 +65,12 @@ class LayerStacker(interfaces.automagic.AutomagicInterface):
|
||||
return []
|
||||
self._check_type(location, str)
|
||||
self._check_type(requirement, interfaces.configuration.RequirementInterface)
|
||||
location = parse.urlparse(location)
|
||||
location = urllib.parse.urlparse(location)
|
||||
|
||||
# Setup the local copy of the resource
|
||||
self.local_store = None
|
||||
if location.scheme == "file":
|
||||
self.local_store = location.path
|
||||
self.local_store = urllib.request.url2pathname(location.path)
|
||||
else:
|
||||
vollog.warning("Only file scheme supported for single-location")
|
||||
return []
|
||||
|
||||
@@ -6,6 +6,7 @@ import lzma
|
||||
import os
|
||||
import pathlib
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
|
||||
from volatility import schemas
|
||||
from volatility.framework import class_subclasses, constants, exceptions, interfaces, objects
|
||||
@@ -76,7 +77,7 @@ class IntermediateSymbolTable(interfaces.symbols.SymbolTableInterface):
|
||||
|
||||
# Open the file and test the version
|
||||
self._versions = dict([(x.version, x) for x in class_subclasses(ISFormatTable)])
|
||||
url_path = urllib.parse.unquote(url.path)
|
||||
url_path = urllib.request.url2pathname(url.path)
|
||||
if url_path.endswith('.xz'):
|
||||
fp = lzma.open(url_path, 'rt')
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user