1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 """The module provides alternate implementations utilizing C extension modules.
19 """
20
21 __author__ = "scudette@google.com (Michael Cohen)"
22 import logging
23 import os
24
25 from rekall import support
26 from rekall.plugins.addrspaces import amd64
27
28 -class AcceleratedAMD64PagedMemory(amd64.AMD64PagedMemory):
29 """An accelerated AMD64 address space."""
30
31 - def __init__(self, **kwargs):
32 super(AcceleratedAMD64PagedMemory, self).__init__(**kwargs)
33 self._delegate = support.AMD64PagedMemory(self.base, int(self.dtb))
34
35 - def read(self, offset, length):
36 return self._delegate.read(int(offset), int(length))
37
38 - def vtop(self, address):
39 return self._delegate.vtop(int(address))
40
42 for virt, offset, _ in self._delegate.get_available_addresses():
43 yield virt, offset
44
45
46 if os.environ.get("FAST"):
47 logging.info("Installing accelerated address spaces.")
48
49 AcceleratedAMD64PagedMemory.classes[
50 "AMD64PagedMemory"] = AcceleratedAMD64PagedMemory
51