Last change
on this file since 211 was
209,
checked in by tim, 14 years ago
|
worked on pyregfi value data interface
added initial scons target for API/devel documentation
|
-
Property svn:executable set to
*
|
File size:
725 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | import sys |
---|
4 | import pyregfi |
---|
5 | |
---|
6 | files = sys.argv[1:] |
---|
7 | |
---|
8 | |
---|
9 | def iter_values(key): |
---|
10 | i = 0 |
---|
11 | for value in key.values(): |
---|
12 | i += 1 |
---|
13 | |
---|
14 | return i |
---|
15 | |
---|
16 | |
---|
17 | for f in files: |
---|
18 | rf = pyregfi.RegistryFile(f) |
---|
19 | iter = rf.TreeIterator() |
---|
20 | |
---|
21 | num_keys = 0 |
---|
22 | num_values = 0 |
---|
23 | # The iterator now walks the entire registry hive, depth-first |
---|
24 | for key in iter: |
---|
25 | #print key.key.keyname |
---|
26 | num_keys +=1 |
---|
27 | num_values += iter_values(key) |
---|
28 | |
---|
29 | print "keys: %d" % num_keys |
---|
30 | print "values: %d" % num_values |
---|
31 | |
---|
32 | |
---|
33 | iter = rf.TreeIterator() |
---|
34 | root = iter.current() |
---|
35 | for key in root.subkeys(): |
---|
36 | for subkey in key.subkeys(): |
---|
37 | for subsubkey in subkey.subkeys(): |
---|
38 | print key.key.keyname |
---|
39 | |
---|
Note: See
TracBrowser
for help on using the repository browser.