[Libguestfs] [PATCH] hivexml: Add -u flag for HIVEX_OPEN_UNSAFE

Hilko Bengen bengen at hilluzination.de
Tue Jul 11 10:06:03 UTC 2017


---
 xml/hivexml.c   | 5 ++++-
 xml/hivexml.pod | 7 +++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/xml/hivexml.c b/xml/hivexml.c
index b496bb6..8ba6594 100644
--- a/xml/hivexml.c
+++ b/xml/hivexml.c
@@ -95,7 +95,7 @@ main (int argc, char *argv[])
   int open_flags = 0;
   int visit_flags = 0;
 
-  while ((c = getopt (argc, argv, "dk")) != EOF) {
+  while ((c = getopt (argc, argv, "dku")) != EOF) {
     switch (c) {
     case 'd':
       open_flags |= HIVEX_OPEN_DEBUG;
@@ -103,6 +103,9 @@ main (int argc, char *argv[])
     case 'k':
       visit_flags |= HIVEX_VISIT_SKIP_BAD;
       break;
+    case 'u':
+      open_flags |= HIVEX_OPEN_UNSAFE;
+      break;
     default:
       fprintf (stderr, "hivexml [-dk] regfile > output.xml\n");
       exit (EXIT_FAILURE);
diff --git a/xml/hivexml.pod b/xml/hivexml.pod
index 257257c..afab80b 100644
--- a/xml/hivexml.pod
+++ b/xml/hivexml.pod
@@ -29,6 +29,13 @@ bug report.
 Keep going even if we find errors in the Registry file.  This
 skips over any parts of the Registry that we cannot read.
 
+=item B<-u>
+
+Use heuristics to tolerate certain levels of corruption within hives.
+
+This is unsafe but may allow to export/merge valid keys/values in an
+othewise corrupted hive.
+
 =back
 
 =head1 SEE ALSO
-- 
2.13.2




More information about the Libguestfs mailing list