1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 """This module implements renderers specific to Linux structures."""
20
21 import os
22
23 from rekall.ui import json_renderer
24 from rekall.ui import text
25 from rekall.plugins.addrspaces import amd64
26 from rekall.plugins.renderers import base_objects
27 from rekall.plugins.renderers import data_export
28
29
30 -class kuid_t_TextObjectRenderer(text.TextObjectRenderer):
31 renders_type = "kuid_t"
32 renderers = ["TextRenderer", "TestRenderer", "WideTextRenderer"]
33
34 - def render_row(self, target, **_):
35 return text.Cell(unicode(target))
36
37 -class kgid_t_TextObjectRenderer(kuid_t_TextObjectRenderer):
38 renders_type = "kgid_t"
39
40
47
48
50 renders_type = "XenM2PMapper"
51
53 result = {}
54 result["m2p_map"] = dict(item)
55 result["mro"] = ":".join(self.get_mro(item))
56
57 return result
58
61
62
63 -class TaskStruct_TextObjectRenderer(base_objects.StructTextRenderer):
64 renders_type = "task_struct"
65 COLUMNS = [
66 dict(style="address", name="obj_offset"),
67 dict(width=20, align="l", name="name"),
68 dict(width=6, align="r", name="pid")
69 ]
70
71
73 renders_type = "task_struct"
74
76 result = super(TaskStruct_DataExport, self).EncodeToJsonSafe(task)
77 fullpath = task.get_path(task.mm.m("exe_file"))
78 result["Cybox"] = dict(
79 type=u"ProcessObj:ProcessObjectType",
80 Name=task.name,
81 PID=task.pid,
82 Creation_Time=task.task_start_time,
83 Parent_PID=task.parent.pid,
84 Image_Info=dict(
85 type=u"ProcessObj:ImageInfoType",
86 Path=fullpath,
87 Command_Line=task.commandline,
88 TrustedPath=fullpath,
89 File_Name=os.path.basename(fullpath),
90 )
91 )
92
93 res = json_renderer.JsonObjectRenderer.EncodeToJsonSafe(self, result)
94 return res
95
97 return "%s (%s)" % (item.get("Cybox", {}).get("Name", ""),
98 item.get("Cybox", {}).get("PID", ""))
99