hivex: Reimplement hivexget as a simple shell script.
[libguestfs.git] / hivex / hivexsh.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 hivexsh - Windows Registry hive shell
6
7 =head1 SYNOPSIS
8
9  hivexsh [-options] [hivefile]
10
11 =head1 DESCRIPTION
12
13 This program provides a simple shell for navigating Windows Registry
14 'hive' files.  It uses the hivex library for access to these binary
15 files.
16
17 Firstly you will need to provide a hive file from a Windows operating
18 system.  The hive files are usually located in
19 C<C:\Windows\System32\Config> and have names like C<software>,
20 C<system> etc (without any file extension).  For more information
21 about hive files, read L<hivex(3)>.  For information about downloading
22 files from virtual machines, read L<virt-cat(1)> and L<guestfish(1)>.
23
24 You can provide the name of the hive file to examine on the command
25 line.  For example:
26
27  hivexsh software
28
29 Or you can start C<hivexsh> without any arguments, and immediately use
30 the C<load> command to load a hive:
31
32  $ hivexsh
33  
34  Welcome to hivexsh, the hivex interactive shell for examining
35  Windows Registry binary hive files.
36  
37  Type: 'help' for help with commands
38        'quit' to quit the shell
39  
40  > load software
41  software\>
42
43 Navigate through the hive's keys using the C<cd> command, as if it
44 contained a filesystem, and use C<ls> to list the subkeys of the
45 current key.  Other commands are listed below.
46
47 =head1 OPTIONS
48
49 =over 4
50
51 =item B<-d>
52
53 Enable lots of debug messages.  If you find a Registry file that this
54 program cannot parse, please enable this option and post the complete
55 output I<and> the Registry hive file in your bug report.
56
57 =item B<-f> filename
58
59 Read commands from C<filename> instead of stdin.  To write a hivexsh
60 script, use:
61
62  #!/usr/bin/hivexsh -f
63
64 =back
65
66 =head1 COMMANDS
67
68 =over 4
69
70 =item B<cd> path
71
72 Change to the subkey C<path>.  Use Windows-style backslashes to
73 separate path elements, and start with a backslash in order to start
74 from the root of the hive.  For example:
75
76  cd \Classes\*
77
78 moves from the root node, to the C<Classes> node, to the C<*> node.
79 If you were already at the root node, you could do this instead:
80
81  cd Classes\*
82
83 or even:
84
85  cd Classes
86  cd *
87
88 Path elements (node names) are matched case insensitively, and
89 characters like space, C<*>, and C<?> have I<no> special significance.
90
91 C<..> may be used to go to the parent directory.
92
93 =item B<close> | B<unload>
94
95 Close the currently loaded hive.
96
97 =item B<exit> | B<quit>
98
99 Exit the shell.
100
101 =item B<load> hivefile
102
103 Load the binary hive named C<hivefile>.  The currently loaded hive, if
104 any, is closed.  The current directory is changed back to the root
105 node.
106
107 =item B<ls>
108
109 List the subkeys of the current hive Registry key.  Note this command
110 does not take any arguments.
111
112 =item B<lsval> [key]
113
114 List the (key, value) pairs of the current hive Registry key.  If no
115 argument is given then all pairs are displayed.  If C<key> is given,
116 then the value of the named key is displayed.  If C<@> is given, then
117 the value of the default key is displayed.
118
119 =back
120
121 =head1 EXAMPLE
122
123  $ guestfish --ro -i Windows7
124  ><fs> download win:c:\windows\system32\config\software software
125  ><fs> quit
126  
127  $ hivexsh software
128  
129  Welcome to hivexsh, the hivex interactive shell for examining
130  Windows Registry binary hive files.
131  
132  Type: 'help' for help with commands
133        'quit' to quit the shell
134  
135  software\> ls
136  ATI Technologies
137  Classes
138  Clients
139  Intel
140  Microsoft
141  ODBC
142  Policies
143  RegisteredApplications
144  Sonic
145  Wow6432Node
146  software\> quit
147
148 =head1 SEE ALSO
149
150 L<hivex(3)>,
151 L<hivexget(1)>,
152 L<hivexml(1)>,
153 L<virt-win-reg(1)>,
154 L<guestfs(3)>,
155 L<http://libguestfs.org/>,
156 L<virt-cat(1)>,
157 L<virt-edit(1)>.
158
159 =head1 AUTHORS
160
161 Richard W.M. Jones (C<rjones at redhat dot com>)
162
163 =head1 COPYRIGHT
164
165 Copyright (C) 2009-2010 Red Hat Inc.
166
167 This program is free software; you can redistribute it and/or modify
168 it under the terms of the GNU General Public License as published by
169 the Free Software Foundation; either version 2 of the License, or
170 (at your option) any later version.
171
172 This program is distributed in the hope that it will be useful,
173 but WITHOUT ANY WARRANTY; without even the implied warranty of
174 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
175 GNU General Public License for more details.
176
177 You should have received a copy of the GNU General Public License along
178 with this program; if not, write to the Free Software Foundation, Inc.,
179 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.