Skip to content
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

Malprocfind able to use unified output #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion CsabaBarta/malprocfind.py
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,46 @@ def calculate(self):
for pid in list_wo_parent:
print "PID %d Offset: 0x%x Name: %s" % (int(list_wo_parent[pid].UniqueProcessId), int(list_wo_parent[pid].obj_offset), str(list_wo_parent[pid].ImageFileName))


#Unified output


def unified_output (self, data):
return TreeGrid ([
("ProcessName", str),
("PId", int),
("Parent", str),
("Name", str),
("Path", str),
("Priority", str),
("CmdLine", str),
("User", str),
("Session", str),
("Time", str),
("Cmd", str),
("PHollow", str),
("Spath", str)],
self.generator(data))


def generator (self, data):
for p in data:
yield (0,[
str(p['procname']),
int(p['pid']),
str(p['parent']),
str(p['name']),
str(p['path']),
str(p['priority']),
str(p['cmdline']),
str(p['user']),
str(p['session']),
str(p['time']),
str(p['cmd']),
str(p['phollow']),
str(p['spath'])
])



def render_text(self, outfd, data):
Expand Down Expand Up @@ -1548,4 +1588,4 @@ def render_text(self, outfd, data):
if p['time'] != None and not p['time']:
print " Time: %s" % p['process'].CreateTime
if p['spath'] != None and not p['spath']:
print " Path: %s" % str(p['process'].Peb.ProcessParameters.ImagePathName).lower()
print " Path: %s" % str(p['process'].Peb.ProcessParameters.ImagePathName).lower()