1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
23 """A lazy evaluator for context information around physical addresses."""
24
25 - def __init__(self, session, address):
28
30 rammap_plugin = self.session.plugins.rammap(
31 start=self.address, end=self.address+1)
32 for row in rammap_plugin.collect():
33 return row
34
36 rammap_plugin = self.session.plugins.rammap(
37 start=self.address, end=self.address+1)
38 if rammap_plugin != None:
39 return rammap_plugin.summary()[0]
40
41 return "Phys: %#x" % self.address
42
43
45 """A plugin to display information about virtual address pages."""
46
47 name = "vadmap"
48
49 __args = [
50 dict(name="start", default=0, type="IntParser",
51 help="Start reading from this page."),
52
53 dict(name="end", default=2**63, type="IntParser",
54 help="Stop reading at this offset."),
55 ]
56
57 table_header = [
58 dict(name='_EPROCESS', type="_EPROCESS", hidden=True),
59 dict(name="Divider", type="Divider"),
60 dict(name="VAddr", style="address"),
61 dict(name="PAddr", style="address", hidden=True),
62 dict(name="length", style="address"),
63 dict(name="type", width=20),
64 dict(name="comment"),
65 ]
66
88
90 """A Generator of vaddr, metadata for each page."""
91 _ = task
92 return []
93
95 for task in self.filter_processes():
96 yield dict(_EPROCESS=task,
97 Divider="Pid: {0} {1}\n".format(task.pid, task.name))
98
99 with self.session.plugins.cc() as cc:
100 cc.SwitchProcessContext(task)
101
102 old_offset = 0
103 old_vaddr = 0
104 length = 0x1000
105 old_metadata = {}
106 for vaddr, metadata in self.GeneratePageMetatadata(task):
107
108
109 offset = metadata.pop("offset", None)
110
111
112 if ((offset is None or old_offset is None or
113 self.plugin_args.verbosity < 5 or
114 offset == old_offset + length) and
115 metadata == old_metadata and
116 vaddr == old_vaddr + length):
117 length += 0x1000
118 continue
119
120 type = old_metadata.get("type", None)
121 if type:
122 comment = self.FormatMetadata(type, old_metadata,
123 vaddr)
124
125 yield dict(VAddr=vaddr, PAddr=offset, length=length,
126 type=type, comment=comment)
127
128 old_metadata = metadata
129 old_vaddr = vaddr
130 old_offset = offset
131 length = 0x1000
132
133 if old_metadata:
134 comment = self.FormatMetadata(type, old_metadata, vaddr)
135 yield dict(VAddr=vaddr, PAddr=offset, length=length,
136 type=type, comment=comment)
137