mrc0mmand / rpms / hivex

Forked from rpms/hivex 3 years ago
Clone
3d1215
Only in hivex-1.3.10/generator: .pod2text.data.version.2
3d1215
Only in hivex-1.3.10/generator: stamp-generator
3d1215
diff -ur hivex-1.3.10.old/lib/hivex.h hivex-1.3.10/lib/hivex.h
3d1215
--- hivex-1.3.10.old/lib/hivex.h	2014-01-10 10:00:53.000000000 +0000
3d1215
+++ hivex-1.3.10/lib/hivex.h	2017-02-17 16:17:58.114476857 +0000
3d1215
@@ -3,7 +3,7 @@
3d1215
  *   generator/generator.ml
3d1215
  * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
  *
3d1215
- * Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+ * Copyright (C) 2009-2017 Red Hat Inc.
3d1215
  * Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
  *   Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
  * Derived from code by Markus Stephany under a compatible license:
3d1215
@@ -111,6 +111,8 @@
3d1215
 #define HIVEX_OPEN_DEBUG      2
3d1215
   /* Enable writes to the hive */
3d1215
 #define HIVEX_OPEN_WRITE      4
3d1215
+  /* Enable heuristics to allow read/write of corrupted hives */
3d1215
+#define HIVEX_OPEN_UNSAFE     8
3d1215
 
3d1215
 /* Array of (key, value) pairs passed to hivex_node_set_values. */
3d1215
 struct hive_set_value {
3d1215
diff -ur hivex-1.3.10.old/lib/hivex.pod hivex-1.3.10/lib/hivex.pod
3d1215
--- hivex-1.3.10.old/lib/hivex.pod	2014-01-10 10:00:53.000000000 +0000
3d1215
+++ hivex-1.3.10/lib/hivex.pod	2017-02-17 16:17:58.137476198 +0000
3d1215
@@ -5,7 +5,7 @@
3d1215
    generator/generator.ml
3d1215
  ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
 
3d1215
- Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+ Copyright (C) 2009-2017 Red Hat Inc.
3d1215
  Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
    Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
  Derived from code by Markus Stephany under a compatible license:
3d1215
@@ -200,6 +200,13 @@
3d1215
 
3d1215
 See L<hivex(3)/WRITING TO HIVE FILES>.
3d1215
 
3d1215
+=item HIVEX_OPEN_UNSAFE
3d1215
+
3d1215
+Open the hive in unsafe mode that enables heuristics to handle corrupted hives.
3d1215
+
3d1215
+This may allow to read or write registry keys/values that appear intact in an
3d1215
+otherwise corrupted hive. Use at your own risk.
3d1215
+
3d1215
 =back
3d1215
 
3d1215
 Returns a new hive handle.
3d1215
@@ -346,7 +353,7 @@
3d1215
 
3d1215
 Return the length of the key (name) of a (key, value) pair as produced
3d1215
 by C<hivex_value_key>. The length can legitimately be 0, so errno is 
3d1215
-the necesary mechanism to check for errors.
3d1215
+the necessary mechanism to check for errors.
3d1215
 
3d1215
 In the context of Windows Registries, a zero-length name means
3d1215
 that this value is the default key for this node in the tree.
3d1215
diff -ur hivex-1.3.10.old/lib/hivex.syms hivex-1.3.10/lib/hivex.syms
3d1215
--- hivex-1.3.10.old/lib/hivex.syms	2014-01-10 10:00:53.000000000 +0000
3d1215
+++ hivex-1.3.10/lib/hivex.syms	2017-02-17 16:17:58.140476112 +0000
3d1215
@@ -3,7 +3,7 @@
3d1215
 #   generator/generator.ml
3d1215
 # ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
 #
3d1215
-# Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+# Copyright (C) 2009-2017 Red Hat Inc.
3d1215
 # Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
 #   Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
 # Derived from code by Markus Stephany under a compatible license:
3d1215
diff -ur hivex-1.3.10.old/ocaml/hivex_c.c hivex-1.3.10/ocaml/hivex_c.c
3d1215
--- hivex-1.3.10.old/ocaml/hivex_c.c	2014-01-10 10:00:53.000000000 +0000
3d1215
+++ hivex-1.3.10/ocaml/hivex_c.c	2017-02-17 16:17:58.161475510 +0000
3d1215
@@ -3,7 +3,7 @@
3d1215
  *   generator/generator.ml
3d1215
  * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
  *
3d1215
- * Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+ * Copyright (C) 2009-2017 Red Hat Inc.
3d1215
  * Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
  *   Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
  * Derived from code by Markus Stephany under a compatible license:
3d1215
diff -ur hivex-1.3.10.old/ocaml/hivex.ml hivex-1.3.10/ocaml/hivex.ml
3d1215
--- hivex-1.3.10.old/ocaml/hivex.ml	2014-01-10 10:00:53.000000000 +0000
3d1215
+++ hivex-1.3.10/ocaml/hivex.ml	2017-02-17 16:17:58.151475796 +0000
3d1215
@@ -3,7 +3,7 @@
3d1215
  *   generator/generator.ml
3d1215
  * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
  *
3d1215
- * Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+ * Copyright (C) 2009-2017 Red Hat Inc.
3d1215
  * Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
  *   Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
  * Derived from code by Markus Stephany under a compatible license:
3d1215
@@ -56,6 +56,7 @@
3d1215
   | OPEN_VERBOSE (** Verbose messages *)
3d1215
   | OPEN_DEBUG (** Debug messages *)
3d1215
   | OPEN_WRITE (** Enable writes to the hive *)
3d1215
+  | OPEN_UNSAFE (** Enable heuristics to allow read/write of corrupted hives *)
3d1215
 
3d1215
 type set_value = {
3d1215
   key : string;
3d1215
diff -ur hivex-1.3.10.old/ocaml/hivex.mli hivex-1.3.10/ocaml/hivex.mli
3d1215
--- hivex-1.3.10.old/ocaml/hivex.mli	2014-01-10 10:00:53.000000000 +0000
3d1215
+++ hivex-1.3.10/ocaml/hivex.mli	2017-02-17 16:17:58.147475911 +0000
3d1215
@@ -3,7 +3,7 @@
3d1215
  *   generator/generator.ml
3d1215
  * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
  *
3d1215
- * Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+ * Copyright (C) 2009-2017 Red Hat Inc.
3d1215
  * Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
  *   Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
  * Derived from code by Markus Stephany under a compatible license:
3d1215
@@ -63,6 +63,7 @@
3d1215
   | OPEN_VERBOSE (** Verbose messages *)
3d1215
   | OPEN_DEBUG (** Debug messages *)
3d1215
   | OPEN_WRITE (** Enable writes to the hive *)
3d1215
+  | OPEN_UNSAFE (** Enable heuristics to allow read/write of corrupted hives *)
3d1215
 (** Open flags for {!open_file} call. *)
3d1215
 
3d1215
 type set_value = {
3d1215
diff -ur hivex-1.3.10.old/perl/Hivex.xs hivex-1.3.10/perl/Hivex.xs
3d1215
--- hivex-1.3.10.old/perl/Hivex.xs	2014-01-13 22:20:34.000000000 +0000
3d1215
+++ hivex-1.3.10/perl/Hivex.xs	2017-02-17 16:17:58.172475194 +0000
3d1215
@@ -3,7 +3,7 @@
3d1215
  *   generator/generator.ml
3d1215
  * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
  *
3d1215
- * Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+ * Copyright (C) 2009-2017 Red Hat Inc.
3d1215
  * Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
  *   Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
  * Derived from code by Markus Stephany under a compatible license:
3d1215
diff -ur hivex-1.3.10.old/perl/lib/Win/Hivex.pm hivex-1.3.10/perl/lib/Win/Hivex.pm
3d1215
--- hivex-1.3.10.old/perl/lib/Win/Hivex.pm	2014-01-10 10:00:53.000000000 +0000
3d1215
+++ hivex-1.3.10/perl/lib/Win/Hivex.pm	2017-02-17 16:17:58.166475366 +0000
3d1215
@@ -3,7 +3,7 @@
3d1215
 #   generator/generator.ml
3d1215
 # ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
 #
3d1215
-# Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+# Copyright (C) 2009-2017 Red Hat Inc.
3d1215
 # Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
 #   Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
 # Derived from code by Markus Stephany under a compatible license:
3d1215
@@ -66,7 +66,8 @@
3d1215
  $h = Win::Hivex->open ($filename,
3d1215
                         [verbose => 1,]
3d1215
                         [debug => 1,]
3d1215
-                        [write => 1,])
3d1215
+                        [write => 1,]
3d1215
+                        [unsafe => 1,])
3d1215
 
3d1215
 Open a Windows Registry binary hive file.
3d1215
 
3d1215
@@ -94,6 +95,8 @@
3d1215
   $flags += 2 if $flags{debug};
3d1215
   # Enable writes to the hive
3d1215
   $flags += 4 if $flags{write};
3d1215
+  # Enable heuristics to allow read/write of corrupted hives
3d1215
+  $flags += 8 if $flags{unsafe};
3d1215
 
3d1215
   my $self = Win::Hivex::_open ($filename, $flags);
3d1215
   bless $self, $class;
3d1215
@@ -212,7 +215,7 @@
3d1215
 
3d1215
 Return the length of the key (name) of a (key, value) pair as produced
3d1215
 by C<value_key>. The length can legitimately be 0, so errno is 
3d1215
-the necesary mechanism to check for errors.
3d1215
+the necessary mechanism to check for errors.
3d1215
 
3d1215
 In the context of Windows Registries, a zero-length name means
3d1215
 that this value is the default key for this node in the tree.
3d1215
@@ -388,7 +391,7 @@
3d1215
 
3d1215
 =head1 COPYRIGHT
3d1215
 
3d1215
-Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+Copyright (C) 2009-2017 Red Hat Inc.
3d1215
 
3d1215
 =head1 LICENSE
3d1215
 
3d1215
diff -ur hivex-1.3.10.old/python/hivex.py hivex-1.3.10/python/hivex.py
3d1215
--- hivex-1.3.10.old/python/hivex.py	2014-01-10 10:00:53.000000000 +0000
3d1215
+++ hivex-1.3.10/python/hivex.py	2017-02-17 16:17:58.177475051 +0000
3d1215
@@ -3,7 +3,7 @@
3d1215
 #   generator/generator.ml
3d1215
 # ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
 #
3d1215
-# Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+# Copyright (C) 2009-2017 Red Hat Inc.
3d1215
 # Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
 #   Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
 # Derived from code by Markus Stephany under a compatible license:
3d1215
@@ -39,7 +39,7 @@
3d1215
 class Hivex(object):
3d1215
     """Instances of this class are hivex API handles."""
3d1215
 
3d1215
-    def __init__ (self, filename, verbose = False, debug = False, write = False):
3d1215
+    def __init__ (self, filename, verbose = False, debug = False, write = False, unsafe = False):
3d1215
         """Create a new hivex handle."""
3d1215
         flags = 0
3d1215
         # Verbose messages
3d1215
@@ -48,6 +48,8 @@
3d1215
         if debug: flags += 2
3d1215
         # Enable writes to the hive
3d1215
         if write: flags += 4
3d1215
+        # Enable heuristics to allow read/write of corrupted hives
3d1215
+        if unsafe: flags += 8
3d1215
         self._o = libhivexmod.open (filename, flags)
3d1215
 
3d1215
     def __del__ (self):
3d1215
diff -ur hivex-1.3.10.old/python/hivex-py.c hivex-1.3.10/python/hivex-py.c
3d1215
--- hivex-1.3.10.old/python/hivex-py.c	2014-04-23 15:47:20.000000000 +0100
3d1215
+++ hivex-1.3.10/python/hivex-py.c	2017-02-17 16:17:58.186474793 +0000
3d1215
@@ -3,7 +3,7 @@
3d1215
  *   generator/generator.ml
3d1215
  * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
  *
3d1215
- * Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+ * Copyright (C) 2009-2017 Red Hat Inc.
3d1215
  * Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
  *   Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
  * Derived from code by Markus Stephany under a compatible license:
3d1215
diff -ur hivex-1.3.10.old/ruby/ext/hivex/_hivex.c hivex-1.3.10/ruby/ext/hivex/_hivex.c
3d1215
--- hivex-1.3.10.old/ruby/ext/hivex/_hivex.c	2014-01-13 22:20:34.000000000 +0000
3d1215
+++ hivex-1.3.10/ruby/ext/hivex/_hivex.c	2017-02-17 16:17:59.440438835 +0000
3d1215
@@ -3,7 +3,7 @@
3d1215
  *   generator/generator.ml
3d1215
  * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
3d1215
  *
3d1215
- * Copyright (C) 2009-2014 Red Hat Inc.
3d1215
+ * Copyright (C) 2009-2017 Red Hat Inc.
3d1215
  * Derived from code by Petter Nordahl-Hagen under a compatible license:
3d1215
  *   Copyright (c) 1997-2007 Petter Nordahl-Hagen.
3d1215
  * Derived from code by Markus Stephany under a compatible license:
3d1215
@@ -121,6 +121,14 @@
3d1215
  * read-only.
3d1215
  * 
3d1215
  * See "WRITING TO HIVE FILES" in hivex(3).
3d1215
+ * 
3d1215
+ * HIVEX_OPEN_UNSAFE
3d1215
+ * Open the hive in unsafe mode that enables heuristics
3d1215
+ * to handle corrupted hives.
3d1215
+ * 
3d1215
+ * This may allow to read or write registry keys/values
3d1215
+ * that appear intact in an otherwise corrupted hive.
3d1215
+ * Use at your own risk.
3d1215
  *
3d1215
  *
3d1215
  * (For the C API documentation for this function, see
3d1215
@@ -137,6 +145,8 @@
3d1215
     flags += 2;
3d1215
   if (RTEST (rb_hash_lookup (flagsv, ID2SYM (rb_intern ("write")))))
3d1215
     flags += 4;
3d1215
+  if (RTEST (rb_hash_lookup (flagsv, ID2SYM (rb_intern ("unsafe")))))
3d1215
+    flags += 8;
3d1215
 
3d1215
   hive_h *r;
3d1215
 
3d1215
@@ -580,8 +590,8 @@
3d1215
  *
3d1215
  * Return the length of the key (name) of a (key, value)
3d1215
  * pair as produced by "h.value_key". The length can
3d1215
- * legitimately be 0, so errno is the necesary mechanism to
3d1215
- * check for errors.
3d1215
+ * legitimately be 0, so errno is the necessary mechanism
3d1215
+ * to check for errors.
3d1215
  * 
3d1215
  * In the context of Windows Registries, a zero-length name
3d1215
  * means that this value is the default key for this node