Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit 370cb98

Browse files
authored
Update tty_check.py to support unified output
Added in codes to support JSON/unified output
1 parent 8769579 commit 370cb98

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

volatility/plugins/linux/tty_check.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import volatility.debug as debug
2828
import volatility.plugins.linux.common as linux_common
2929
import volatility.plugins.linux.lsmod as linux_lsmod
30+
from volatility.renderers import TreeGrid
31+
from volatility.renderers.basic import Address
3032

3133
class linux_check_tty(linux_common.AbstractLinuxCommand):
3234
"""Checks tty devices for hooks"""
@@ -70,6 +72,16 @@ def calculate(self):
7072

7173
yield (name, recv_buf, sym_name, hooked)
7274

75+
def unified_output(self, data):
76+
return TreeGrid([("Name", str),
77+
("Address", Address),
78+
("Symbol", str)],
79+
self.generator(data))
80+
81+
def generator(self, data):
82+
for name, call_addr, sym_name, _hooked in data:
83+
yield (0, [str(name), Address(call_addr), str(sym_name)])
84+
7385
def render_text(self, outfd, data):
7486
self.table_header(outfd, [("Name", "<16"), ("Address", "[addrpad]"), ("Symbol", "<30")])
7587
for name, call_addr, sym_name, _hooked in data:

0 commit comments

Comments
 (0)