Make sure objects.utility is imported automatically.

This commit is contained in:
Mike Auty
2019-05-09 00:07:59 +01:00
parent d0ff961ed1
commit 1c0cd7ddaf
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -19,7 +19,6 @@
#
import collections
import functools
import logging
import struct
from collections import abc
@@ -27,7 +26,7 @@ from typing import Any, ClassVar, Dict, List, Iterable, Optional, Tuple, Type, U
from volatility.framework import interfaces
from volatility.framework.interfaces.objects import ObjectInformation
from volatility.framework.objects import templates
from volatility.framework.objects import templates, utility
vollog = logging.getLogger(__name__)
+2 -2
View File
@@ -23,7 +23,7 @@ from typing import Optional, Union
from volatility.framework import interfaces, objects, constants
def array_to_string(array: objects.Array, count: Optional[int] = None,
def array_to_string(array: 'objects.Array', count: Optional[int] = None,
errors: str = 'replace') -> interfaces.objects.ObjectInterface:
"""Takes a volatility Array of characters and returns a string"""
# TODO: Consider checking the Array's target is a native char
@@ -35,7 +35,7 @@ def array_to_string(array: objects.Array, count: Optional[int] = None,
return array.cast("string", max_length = count, errors = errors)
def pointer_to_string(pointer: objects.Pointer, count: int, errors: str = 'replace'):
def pointer_to_string(pointer: 'objects.Pointer', count: int, errors: str = 'replace'):
"""Takes a volatility Pointer to characters and returns a string"""
if not isinstance(pointer, objects.Pointer):
raise TypeError("pointer_to_string takes a Pointer")