Add some typing fixes.

This commit is contained in:
Mike Auty
2018-06-16 14:19:36 +01:00
parent 60df83ef15
commit c0ec52822b
3 changed files with 8 additions and 2 deletions
@@ -108,6 +108,10 @@ class ObjectInterface(validity.ValidityRoutines, metaclass = ABCMeta):
Raises InvalidDataException on failure to validate the data correctly.
"""
def __getattr__(self, attr: str) -> typing.Any:
"""Method for ensuring volatility members can be returned"""
pass
def get_symbol_table(self) -> typing.Optional['interfaces.symbols.SymbolTableInterface']:
"""Returns the symbol table for this particular object
+3 -1
View File
@@ -1,3 +1,5 @@
import typing
from volatility.framework import interfaces
@@ -5,7 +7,7 @@ def mask_symbol_table(symbol_table: interfaces.symbols.SymbolTableInterface,
address_mask: int = 0):
"""Alters a symbol table, such that all symbols returned have their address masked by the address mask"""
original_get_symbol = symbol_table.get_symbol
cached_symbols = {}
cached_symbols = {} # type: typing.Dict[interfaces.symbols.Symbol, interfaces.symbols.Symbol]
def address_masked_get_symbol(*args, **kwargs):
symbol = original_get_symbol(*args, **kwargs)
+1 -1
View File
@@ -60,7 +60,7 @@ class VadInfo(interfaces_plugins.PluginInterface):
values = ntkrnlmp.object(type_name = "array", offset = kvo + addr,
subtype = ntkrnlmp.get_type("int"),
count = 32)
return values
return values # type: ignore
@classmethod
def list_vads(cls, proc: interfaces.objects.ObjectInterface,