| 1 |
#!/bin/bash - |
| 2 |
# Copyright (C) 2009-2010 Red Hat Inc. |
| 3 |
# |
| 4 |
# This program is free software; you can redistribute it and/or modify |
| 5 |
# it under the terms of the GNU General Public License as published by |
| 6 |
# the Free Software Foundation; either version 2 of the License, or |
| 7 |
# (at your option) any later version. |
| 8 |
# |
| 9 |
# This program is distributed in the hope that it will be useful, |
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
# GNU General Public License for more details. |
| 13 |
# |
| 14 |
# You should have received a copy of the GNU General Public License |
| 15 |
# along with this program; if not, write to the Free Software |
| 16 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 17 |
|
| 18 |
set -e |
| 19 |
|
| 20 |
# Example program which modifies a hive. |
| 21 |
# |
| 22 |
# This program removes any existing (key, value) pairs at the root |
| 23 |
# node and replaces them with some example values. |
| 24 |
# |
| 25 |
# You can load the modified hive using another tool to see the |
| 26 |
# changes. eg. Using Windows regedit, select HKLM and then in the |
| 27 |
# File menu choose "Load Hive ...". Point to the update hive, and |
| 28 |
# then give a key (eg. "test1"). The modified hive will be loaded |
| 29 |
# under HKLM\test1 and the values can be inspected there. After |
| 30 |
# inspecting the changes, unload the hive using File -> Unload Hive. |
| 31 |
# |
| 32 |
# Don't replace the original Windows hive, else you'll break things :-) |
| 33 |
|
| 34 |
if [ $# -ne 0 ]; then |
| 35 |
echo "$0: no arguments required" |
| 36 |
exit 1 |
| 37 |
fi |
| 38 |
|
| 39 |
d=`dirname $0` |
| 40 |
|
| 41 |
$d/hivexsh -w <<EOF |
| 42 |
load $d/t/minimal |
| 43 |
setval 4 |
| 44 |
@ |
| 45 |
string:Root |
| 46 |
A |
| 47 |
string:abcd |
| 48 |
B |
| 49 |
dword:0x12345678 |
| 50 |
C |
| 51 |
string:dcbadcbadcbaabcd |
| 52 |
commit /tmp/modified |
| 53 |
EOF\ No newline at end of file |