/usr/lib/python2.7/dist-packages/rekall/plugins/overlays/windows/xp.py is in python-rekall-core 1.6.0+dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | # Rekall Memory Forensics
# Copyright (c) 2008 Volatile Systems
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
"""
@author: Brendan Dolan-Gavitt
@license: GNU General Public License 2.0 or later
@contact: bdolangavitt@wesleyan.edu
This file provides support for windows XP SP2. We provide a profile
for SP2.
"""
from rekall.plugins.overlays.windows import common
# Windows XP specific overlays.
win_xp_overlays = {
'_EPROCESS' : [None, {
'VadRoot': [None, ['pointer', ['_MMVAD']]],
'RealVadRoot': lambda x: x.VadRoot.dereference(),
}],
'_MMVAD_SHORT': [None, {
'Tag': [-4, ['String', dict(length=4)]],
'Start': lambda x: x.StartingVpn << 12,
'End': lambda x: ((x.EndingVpn + 1) << 12) - 1,
'Length': lambda x: x.End - x.Start + 1,
'CommitCharge': lambda x: x.u.VadFlags.CommitCharge,
}],
'_MMVAD': [None, {
'Tag': [-4, ['String', dict(length=4)]],
'Start': lambda x: x.StartingVpn << 12,
'End': lambda x: ((x.EndingVpn + 1) << 12) - 1,
'Length': lambda x: x.End - x.Start + 1,
'CommitCharge': lambda x: x.u.VadFlags.CommitCharge,
}],
'_MMVAD_LONG': [None, {
'Tag': [-4, ['String', dict(length=4)]],
'Start': lambda x: x.StartingVpn << 12,
'End': lambda x: ((x.EndingVpn + 1) << 12) - 1,
'Length': lambda x: x.End - x.Start + 1,
'CommitCharge': lambda x: x.u.VadFlags.CommitCharge,
}],
# This is not documented in Windows XP but is in Windows 7.
"_OBJECT_HEADER_HANDLE_INFO": [16, {
"HandleCountDataBase": [0, ["Pointer", {
"target": "_OBJECT_HANDLE_COUNT_DATABASE"
}]],
"SingleEntry": [0, ["_OBJECT_HANDLE_COUNT_ENTRY", {}]]
}],
"_OBJECT_HANDLE_COUNT_ENTRY": [16, {
"HandleCount": [8, ["BitField", {
"end_bit": 24,
"target": "unsigned long"
}]],
"LockCount": [8, ["BitField", {
"end_bit": 32,
"start_bit": 24,
"target": "unsigned long"
}]],
"Process": [0, ["Pointer", {
"target": "_EPROCESS"
}]]
}],
'_MM_SESSION_SPACE': [None, {
# Specialized iterator to produce all the _IMAGE_ENTRY_IN_SESSION
# records.
'ImageIterator': lambda x: x.ImageList.list_of_type(
"_IMAGE_ENTRY_IN_SESSION", "Link")
}],
'_IMAGE_ENTRY_IN_SESSION': [None, {
'ImageBase': lambda x: x.Address.v()
}],
"_SECTION_OBJECT": [None, {
"Segment": [None, ["Pointer", dict(target="_SEGMENT")]]
}],
}
class _MMVAD(common.VadTraverser):
"""Windows XP uses the _MMVAD struct itself as a traversor.
i.e. The _MMVAD contains the LeftChild and RightChild.
"""
def InitializeXPProfile(profile):
if profile.metadata("arch") == "AMD64":
profile.add_constants(dict(PoolAlignment=16))
else:
profile.add_constants(dict(PoolAlignment=8))
profile.add_overlay(win_xp_overlays)
profile.add_classes(dict(_MMVAD=_MMVAD))
|