My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
#
# Registry Decoder
# Copyright (c) 2011 Digital Forensics Solutions, LLC
#
# Contact email: registrydecoder@digitalforensicssolutions.com
#
# Authors:
# Andrew Case - andrew@digitalforensicssolutions.com
# Lodovico Marziale - vico@digitalforensicssolutions.com
#
# 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
#

import regkey
import regvalue
import pyregfi


class RegFile:

'''
DOCME
'''

def __init__(self, regfile):
self.regfile = regfile

def get_keygen(self):

reghive = pyregfi.openHive(self.regfile)
regiter = pyregfi.HiveIterator(reghive)

for key in regiter:
path_list = []
for val in regiter.current_path():
path_list.append(val)
value_list = []
for val in key.values:

data = val.fetch_data()

if not data:
data = val.fetch_raw_data()

v = regvalue.Value(val.name, val.type, data)
value_list.append(v)
yield regkey.RegKeyNK(path_list, value_list, key.modified)


# for now, give me a registry file and I will try to parse some stuff out
def main():

if len(sys.argv) != 2:
usage()
sys.exit()

regfile = RegFile(sys.argv[1])

generator = regfile.get_keygen()
for key in generator:
print key


if __name__ == "__main__":
main()

Change log

r81 by atcuno on Oct 25, 2011   Diff
updates
Go to: 
Project members, sign in to write a code review

Older revisions

r8 by atcuno on Sep 6, 2011   Diff
first google commit
All revisions of this file

File info

Size: 2104 bytes, 78 lines
Powered by Google Project Hosting