Fix up more typing discrepancies.

This commit is contained in:
Mike Auty
2019-07-15 17:43:43 +01:00
parent 8e6cba022b
commit f5615e28f6
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ class ModuleInterface(metaclass = ABCMeta):
def get_symbol(self, name: str) -> 'interfaces.symbols.SymbolInterface':
"""Returns a symbol from the module"""
def get_enumeration(self, name: str) -> 'interfaces.object.Template':
def get_enumeration(self, name: str) -> 'interfaces.objects.Template':
"""Returns an enumeration from the module"""
def has_type(self, name: str) -> bool:
+1 -1
View File
@@ -268,7 +268,7 @@ class SymbolTableInterface(BaseSymbolTableInterface, configuration.ConfigurableI
class NativeTableInterface(BaseSymbolTableInterface):
"""Class to distinguish NativeSymbolLists from other symbol lists"""
def get_symbol(self, name: str) -> objects.Template:
def get_symbol(self, name: str) -> SymbolInterface:
raise exceptions.SymbolError("NativeTables never hold symbols")
@property
@@ -23,7 +23,7 @@ import datetime
import json
import logging
import os
from typing import Any, List, Tuple
from typing import Any, List, Tuple, Generator
from volatility.framework import exceptions, renderers, constants, interfaces
from volatility.framework.configuration import requirements
@@ -127,7 +127,7 @@ class UserAssist(interfaces.plugins.PluginInterface):
return self.context.symbol_space.get_type(self.config['nt_symbols'] + constants.BANG +
"_KUSER_SHARED_DATA").has_member('CookiePad')
def list_userassist(self, hive: RegistryHive):
def list_userassist(self, hive: RegistryHive) -> Generator[Tuple[int, Tuple], None, None]:
"""Generate userassist data for a registry hive."""
hive_name = hive.hive.cast(self.config["nt_symbols"] + constants.BANG + "_CMHIVE").get_name()
@@ -148,6 +148,9 @@ class UserAssist(interfaces.plugins.PluginInterface):
vollog.warning("list_userassist did not find a valid node_path (or None)")
return
if not isinstance(userassist_node_path, list):
vollog.warning("userassist_node_path did not return a list as expected")
return
userassist_node = userassist_node_path[-1]
# iterate through the GUIDs under the userassist key
for guidkey in userassist_node.get_subkeys():