From 1c0cd7ddaf447eee0f391af4996779b53b9fdbcd Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Thu, 9 May 2019 00:07:59 +0100 Subject: [PATCH] Make sure objects.utility is imported automatically. --- volatility/framework/objects/__init__.py | 3 +-- volatility/framework/objects/utility.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/volatility/framework/objects/__init__.py b/volatility/framework/objects/__init__.py index ba1046759..027d06c34 100644 --- a/volatility/framework/objects/__init__.py +++ b/volatility/framework/objects/__init__.py @@ -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__) diff --git a/volatility/framework/objects/utility.py b/volatility/framework/objects/utility.py index b10d6a0d9..93cf6aea2 100644 --- a/volatility/framework/objects/utility.py +++ b/volatility/framework/objects/utility.py @@ -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")