From 72d971bf3f2dbb4ab52f78439b93abeda6c6a8b1 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Tue, 7 May 2013 23:38:03 +0100 Subject: [PATCH] More speed-ups by not constantly rebuilding the native_dictionary list. --- volatility/framework/symbols/native.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/volatility/framework/symbols/native.py b/volatility/framework/symbols/native.py index 242711e6d..b3a6459d6 100644 --- a/volatility/framework/symbols/native.py +++ b/volatility/framework/symbols/native.py @@ -16,6 +16,8 @@ class NativeTable(interfaces.symbols.NativeTableInterface): for native_type in self._native_dictionary.keys(): native_class, _native_struct = self._native_dictionary[native_type] self._overrides[native_type] = native_class + # Create this once early, because it may get used a lot + self._symbols = set(self._native_dictionary.keys()).union(set(['Enumeration', 'array', 'BitField', 'void', 'pointer'])) def get_symbol_class(self, symbol): ntype, fmt = native_types.get(symbol, (objects.Integer, '')) @@ -24,7 +26,7 @@ class NativeTable(interfaces.symbols.NativeTableInterface): @property def symbols(self): """Returns an iterator of the symbol names""" - return set(self._native_dictionary.keys()).union(set(['Enumeration', 'array', 'BitField', 'void', 'pointer'])) + return self._symbols def resolve(self, symbol_name): """Resolves a symbol name into an object template