mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-11 12:17:38 +02:00
Add in better support for sorting BaseAbsentValues.
This commit is contained in:
@@ -98,9 +98,9 @@ class Disassembly(object):
|
||||
# contain the types that the validator will accept (which would not include the base)
|
||||
|
||||
_Type = TypeVar("_Type", bound = Type)
|
||||
ColumnsType = List[Tuple[str, Type]]
|
||||
BaseTypes = Union[Type[int], Type[str], Type[float], Type[bytes], Type[datetime.datetime], Type[BaseAbsentValue],
|
||||
Type[Disassembly]]
|
||||
ColumnsType = List[Tuple[str, BaseTypes]]
|
||||
VisitorSignature = Callable[[TreeNode, _Type], _Type]
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import datetime
|
||||
from typing import Any, Callable, Iterable, List, Optional, Tuple, TypeVar, Union
|
||||
|
||||
from volatility.framework import interfaces
|
||||
from volatility.framework.interfaces import renderers
|
||||
|
||||
|
||||
class UnreadableValue(interfaces.renderers.BaseAbsentValue):
|
||||
@@ -331,6 +332,12 @@ class ColumnSortKey(interfaces.renderers.ColumnSortKey):
|
||||
if isinstance(value, interfaces.renderers.BaseAbsentValue):
|
||||
if self._type == datetime.datetime:
|
||||
value = datetime.datetime.min
|
||||
elif self._type == int:
|
||||
elif self._type in [int, float]:
|
||||
value = -1
|
||||
elif self._type == bool:
|
||||
value = False
|
||||
elif self._type in [str, renderers.Disassembly]:
|
||||
value = "-"
|
||||
elif self._type == bytes:
|
||||
value = b""
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user