forked from KVM-VMI/nitro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from KVM-VMI/refactor_windows_process
Refactor windows process
- Loading branch information
Showing
4 changed files
with
38 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from nitro.backends.process import Process | ||
|
||
class WindowsProcess(Process): | ||
|
||
__slots__ = ( | ||
"name", | ||
"pid", | ||
) | ||
|
||
# descriptor is the start address of the EPROCESS struct | ||
def __init__(self, libvmi, cr3, descriptor): | ||
super().__init__(libvmi, cr3, descriptor) | ||
# get name | ||
image_file_name_off = self.descriptor + self.libvmi.get_offset('win_pname') | ||
self.name = self.libvmi.read_str_va(image_file_name_off, 0) | ||
# get pid | ||
unique_processid_off = self.descriptor + self.libvmi.get_offset('win_pid') | ||
self.pid = self.libvmi.read_addr_va(unique_processid_off, 0) |