-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Volshell: Add Dedicated Method to retrieve EPROCESS/Task object given the PID #1381
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
name="kernel", description="Linux kernel module" | ||
), | ||
requirements.PluginRequirement( | ||
name="pslist", plugin=pslist.PsList, version=(2, 0, 0) | ||
name="pslist", plugin=pslist.PsList, version=(3, 0, 0) | ||
), | ||
requirements.IntRequirement( | ||
name="pid", description="Process ID", optional=True | ||
|
@@ -40,6 +40,14 @@ | |
return None | ||
print(f"No task with task ID {pid} found") | ||
|
||
def get_task(self, pid): | ||
"""Get Task based on a process ID. Does not retrieve the layer, to change layer use the .pid attribute""" | ||
tasks = self.list_tasks() | ||
for task in tasks: | ||
if task.pid == pid: | ||
return task | ||
print(f"No task with task ID {pid} found") | ||
|
||
def list_tasks(self): | ||
"""Returns a list of task objects from the primary layer""" | ||
# We always use the main kernel memory and associated symbols | ||
|
@@ -50,6 +58,7 @@ | |
result += [ | ||
(["ct", "change_task", "cp"], self.change_task), | ||
(["lt", "list_tasks", "ps"], self.list_tasks), | ||
(["gp", "get_task"], self.get_task), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we feel about the naming? Should it be gt in linux, or will the difference be confusing? Should we call it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, you're right... shame... 5:S Would it be worth aliasing it to |
||
(["symbols"], self.context.symbol_space[self.current_symbol_table]), | ||
] | ||
if self.config.get("pid", None) is not None: | ||
|
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure this ends in an explicit
return None
if the pid isn't found or there's no tasks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also looks like there's two bits of whitespace that are causing black to complain