Trees | Indices | Help |
|
---|
|
1 # Rekall Memory Forensics 2 # 3 # Copyright 2013 Google Inc. All Rights Reserved. 4 # 5 # This program is free software; you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by 7 # the Free Software Foundation; either version 2 of the License, or (at 8 # your option) any later version. 9 # 10 # This program is distributed in the hope that it will be useful, but 11 # WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 # General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with this program; if not, write to the Free Software 17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 19 """ 20 Collectors and plugins that deal with Darwin zone allocator. 21 """ 22 23 __author__ = "Adam Sindelar <adamsh@google.com>" 24 25 from rekall_lib import utils 26 27 from rekall.plugins.darwin import common 43 4851 """Finds all the valid structs in an allocation zone.""" 52 53 __abstract = True 54 55 zone_name = None 56 type_name = None 57 607962 # Find the zone that contains our data. 63 zone = self.session.plugins.search( 64 "(select zone from zones() where zone.name == ?).zone", 65 query_parameters=[self.zone_name]).first_result 66 67 if not zone: 68 raise ValueError("Zone %r doesn't exist." % self.zone_name) 69 70 results = set() 71 for offset in zone.known_offsets: 72 element = self.session.profile.Object(offset=offset, 73 type_name=self.type_name) 74 75 if self.validate_element(element): 76 results.add(element.obj_offset) 77 78 return results82 """Dumps an allocation zone's contents.""" 83 84 name = "dump_zone" 85 86 table_header = [ 87 dict(name="offset", style="address"), 88 dict(name="data", width=34) 89 ] 90 91 @classmethod 95 99114101 zone = self.session.plugins.search( 102 "(select zone from zones() where zone.name == {zone_name}).zone", 103 query_parameters=dict(zone_name=self.zone_name), 104 silent=True 105 ).first_result 106 107 if not zone: 108 raise ValueError("No such zone %r." % self.zone_name) 109 110 for offset in zone.known_offsets: 111 yield dict(offset=offset, 112 data=utils.HexDumpedString( 113 zone.obj_vm.read(offset, zone.elem_size)))115 116 # All plugins below dump and validate elements from specific zones. 117 118 119 -class DarwinSocketZoneFinder(AbstractZoneElementFinder):126 131 140 145 154 159 170 175178 name = "dead_procs" 179 zone_name = "proc" 180 type_name = "proc" 181184183 return element.validate()187 """Lists dead processes using the proc allocation zone.""" 188 name = "dead_procs" 189 type_name = "proc"190 199 204
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Oct 9 03:29:51 2017 | http://epydoc.sourceforge.net |