From a3355fdccff82ac7b44f2d9dccb7d776dbcd92fd Mon Sep 17 00:00:00 2001 From: TMPLR11 <55187710+TMPLR11@users.noreply.github.com> Date: Wed, 11 Sep 2019 14:58:28 +0200 Subject: [PATCH] Malsysproc able to use unified output Malsysproc modified to use unified output --- malsysproc.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/malsysproc.py b/malsysproc.py index 3185654..c511ed7 100644 --- a/malsysproc.py +++ b/malsysproc.py @@ -317,6 +317,36 @@ def calculate(self): info = self.build_obj(process, name, parent, ctime, counter, namelist[name], pathlist[name], prioritylist[name], cmdlinelist[name]) yield info + + + def unified_output(self, data): + return TreeGrid ([ + ("ProcessName", str), + ("PId", int), + ("NameList", str), + ("Path", str), + ("PPId", str), + ("Time", str), + ("Priority", str), + ("CmdLine", str), + ("Count", str)], + self.generator(data)) + + + def generator(self, data): + for info in data: + yield (0,[ + str(info['processname']), + int(info['pid']), + str(info['name']), + str(info['path']), + str(info['ppid']), + str(info['time']), + str(info['priority']), + str(info['cmdline']), + str(info['count']) + ]) + def render_text(self, outfd, data):