mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-26 19:44:50 +02:00
Handle bad unix timestamps.
This commit is contained in:
@@ -42,9 +42,13 @@ def array_of_pointers(array: objects.Array,
|
||||
return array.cast("array", count = count, subtype = subtype_pointer)
|
||||
|
||||
|
||||
def wintime_to_datetime(wintime: objects.Struct) -> typing.Union[renderers.NotApplicableValue, datetime.datetime]:
|
||||
def wintime_to_datetime(wintime: objects.Struct) -> typing.Union[
|
||||
interfaces.renderers.BaseAbsentValue, datetime.datetime]:
|
||||
unix_time = wintime.QuadPart // 10000000
|
||||
if unix_time == 0:
|
||||
return renderers.NotApplicableValue()
|
||||
unix_time = unix_time - 11644473600
|
||||
return datetime.datetime.utcfromtimestamp(unix_time)
|
||||
try:
|
||||
return datetime.datetime.utcfromtimestamp(unix_time)
|
||||
except ValueError:
|
||||
return renderers.UnparsableValue()
|
||||
|
||||
Reference in New Issue
Block a user