mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-11 12:17:38 +02:00
linux: task_struct object extension: Add helper to obtain the task state
This commit is contained in:
@@ -517,6 +517,15 @@ class task_struct(generic.GenericIntelProcess):
|
||||
else None
|
||||
)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
if self.has_member("__state"):
|
||||
return self.member("__state")
|
||||
elif self.has_member("state"):
|
||||
return self.member("state")
|
||||
else:
|
||||
raise AttributeError("Unsupported task_struct: Cannot find state")
|
||||
|
||||
def _get_task_start_time(self) -> datetime.timedelta:
|
||||
"""Returns the task's monotonic start_time as a timedelta.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user