Skip to content

Commit

Permalink
Add some typing fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikelos committed Jun 16, 2018
1 parent 60df83e commit c0ec528
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions volatility/framework/interfaces/objects.py
Expand Up @@ -108,6 +108,10 @@ def validate(self) -> bool:
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
Expand Down
4 changes: 3 additions & 1 deletion volatility/framework/symbols/utility.py
@@ -1,11 +1,13 @@
import typing

from volatility.framework import interfaces


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)
Expand Down
2 changes: 1 addition & 1 deletion volatility/plugins/windows/vadinfo.py
Expand Up @@ -60,7 +60,7 @@ def protect_values(cls,
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,
Expand Down

0 comments on commit c0ec528

Please sign in to comment.