Add user cache directory as fallback for downloaded symbols

This commit is contained in:
Esa Jokinen
2026-03-16 08:47:19 +02:00
parent 98e2f7a1f5
commit dd06faa7ce
+15 -12
View File
@@ -25,6 +25,18 @@ from volatility3.framework.constants._version import (
REQUIRED_PYTHON_VERSION = (3, 8, 0)
CACHE_PATH = os.path.join(
os.environ.get("XDG_CACHE_HOME") or os.path.join(os.path.expanduser("~"), ".cache"),
"volatility3",
)
"""Default path to store cached data"""
if sys.platform == "win32":
CACHE_PATH = os.path.realpath(
os.path.join(os.environ.get("APPDATA", os.path.expanduser("~")), "volatility3")
)
os.makedirs(CACHE_PATH, exist_ok=True)
PLUGINS_PATH = [
os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "plugins")),
os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "plugins")),
@@ -34,6 +46,9 @@ PLUGINS_PATH = [
SYMBOL_BASEPATHS = [
os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "symbols")),
os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "symbols")),
os.path.abspath(
os.path.join(CACHE_PATH, "symbols")
), # User cache fallback for automatically downloaded temporary symbols
]
"""Default list of paths to load symbols from (volatility3/symbols and volatility3/framework/symbols)"""
@@ -71,21 +86,9 @@ LOGLEVEL_VVVV = 6
"""Logging level for four levels of detail: -vvvvvv"""
CACHE_PATH = os.path.join(
os.environ.get("XDG_CACHE_HOME") or os.path.join(os.path.expanduser("~"), ".cache"),
"volatility3",
)
"""Default path to store cached data"""
SQLITE_CACHE_PERIOD = "-3 days"
"""SQLite time modifier for how long each item is valid in the cache for"""
if sys.platform == "win32":
CACHE_PATH = os.path.realpath(
os.path.join(os.environ.get("APPDATA", os.path.expanduser("~")), "volatility3")
)
os.makedirs(CACHE_PATH, exist_ok=True)
IDENTIFIERS_FILENAME = "identifier.cache"
"""Default location to record information about available identifiers"""