Raise the right kind of exception in Intermediate Format SymbolTables.

This commit is contained in:
Mike Auty
2017-08-11 08:49:49 +01:00
parent c6724a538a
commit f7f1c1d5e0
2 changed files with 5 additions and 5 deletions
@@ -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
+3 -3
View File
@@ -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'])