1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 __author__ = "Michael Cohen <scudette@google.com>"
20
21 from rekall.plugins.darwin import common
22
23
25 """Detects hooks in I/O Kit IONotify objects."""
26
27 __name = "notifiers"
28
30 renderer.table_header([
31 ("Notify Type", "notify_type", "25"),
32 ("Handler", "handler", "[addrpad]"),
33 ("Match Key", "match_key", "20"),
34 ("Match Value", "match_value", "30"),
35 ("Symbol", "symbol", ""),
36 ])
37
38 gnotifications = self.profile.get_constant_cpp_object(
39 "gNotifications",
40 target="Pointer",
41 target_args=dict(
42 target="OSDictionary"
43 )
44 )
45
46 if not gnotifications:
47 self.session.logging.error("Could not find the gNotifications "
48 "object. The profile %r could be "
49 "incomplete." % self.profile)
50 return
51
52 resolver = self.session.address_resolver
53
54
55 for key, value in gnotifications.items("OSOrderedSet"):
56 for notifier in value.list_of_type("_IOServiceNotifier"):
57 symbol = resolver.format_address(notifier.handler)
58
59 for match_key, match_value in notifier.matching.items(
60 "OSString"):
61 renderer.table_row(
62 key, notifier.handler,
63 match_key, match_value.value,
64 symbol)
65