mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-11 04:07:39 +02:00
Raise the right kind of exception in Intermediate Format SymbolTables.
This commit is contained in:
@@ -4,7 +4,7 @@ import pathlib
|
||||
import pickle
|
||||
from urllib import parse
|
||||
|
||||
from volatility.framework import interfaces, constants
|
||||
from volatility.framework import constants, exceptions, interfaces
|
||||
from volatility.framework.symbols import intermed
|
||||
|
||||
vollog = logging.getLogger(__name__)
|
||||
@@ -78,7 +78,7 @@ class LinuxSymbolCache(interfaces.automagic.AutomagicInterface):
|
||||
bannerlist = linuxbanners.get(banner, [])
|
||||
bannerlist.append(isf_url)
|
||||
linuxbanners[banner] = bannerlist
|
||||
except KeyError:
|
||||
except exceptions.SymbolError:
|
||||
pass
|
||||
|
||||
# Rewrite the cached linuxbanners each run, since writing is faster than the cache validation portion
|
||||
|
||||
@@ -199,7 +199,7 @@ class Version1Format(ISFormatTable):
|
||||
"""Returns the location offset given by the symbol name"""
|
||||
symbol = self._json_object['symbols'].get(name, None)
|
||||
if not symbol:
|
||||
raise KeyError("Unknown symbol: {}".format(name))
|
||||
raise exceptions.SymbolError("Unknown symbol: {}".format(name))
|
||||
return interfaces.symbols.Symbol(name = name, address = symbol['address'])
|
||||
|
||||
@property
|
||||
@@ -369,7 +369,7 @@ class Version3Format(Version2Format):
|
||||
"""Returns the location offset given by the symbol name"""
|
||||
symbol = self._json_object['symbols'].get(name, None)
|
||||
if not symbol:
|
||||
raise KeyError("Unknown symbol: {}".format(name))
|
||||
raise exceptions.SymbolError("Unknown symbol: {}".format(name))
|
||||
symbol_type = None
|
||||
if 'type' in symbol:
|
||||
symbol_type = self._interdict_to_template(symbol['type'])
|
||||
@@ -425,7 +425,7 @@ class Version5Format(Version4Format):
|
||||
"""Returns the location offset given by the symbol name"""
|
||||
symbol = self._json_object['symbols'].get(name, None)
|
||||
if not symbol:
|
||||
raise KeyError("Unknown symbol: {}".format(name))
|
||||
raise exceptions.SymbolError("Unknown symbol: {}".format(name))
|
||||
symbol_type = None
|
||||
if 'type' in symbol:
|
||||
symbol_type = self._interdict_to_template(symbol['type'])
|
||||
|
||||
Reference in New Issue
Block a user