search for: hive_typ

Displaying 20 results from an estimated 33 matches for "hive_typ".

Did you mean: hive_type
2011 Dec 08
0
[hivex] [PATCH 2/8] generator: Add new return type to ABI: RLenValue
...uot; | RLenType -> pr "int " | RLenTypeVal -> pr "char *" | RInt32 -> pr "int32_t " @@ -909,6 +911,7 @@ and generate_c_prototype ?(extern = false) name style = ) (snd style); (match fst style with | RLenType | RLenTypeVal -> pr ", hive_type *t, size_t *len" + | RLenValue -> pr ", size_t *len" | _ -> () ); pr ");\n" @@ -1111,6 +1114,10 @@ On error this returns NULL and sets errno.\n\n" pr "\ Returns 0 on success. On error this returns -1 and sets errno.\n\n" +...
2011 Oct 19
1
[hivex][PATCH 2/8] generator: Add new return type to ABI: RLenValue
...uot; | RLenType -> pr "int " | RLenTypeVal -> pr "char *" | RInt32 -> pr "int32_t " @@ -909,6 +911,7 @@ and generate_c_prototype ?(extern = false) name style = ) (snd style); (match fst style with | RLenType | RLenTypeVal -> pr ", hive_type *t, size_t *len" + | RLenValue -> pr ", size_t *len" | _ -> () ); pr ");\n" @@ -1111,6 +1114,10 @@ On error this returns NULL and sets errno.\n\n" pr "\ Returns 0 on success. On error this returns -1 and sets errno.\n\n" +...
2011 Aug 31
1
[PATCH] hivex: Add byte runs for nodes and values
...uot; | RLenType -> pr "int " | RLenTypeVal -> pr "char *" | RInt32 -> pr "int32_t " @@ -886,6 +926,8 @@ and generate_c_prototype ?(extern = false) name style = ) (snd style); (match fst style with | RLenType | RLenTypeVal -> pr ", hive_type *t, size_t *len" + | RLenNode -> pr ", size_t *len" + | RLenValue -> pr ", size_t *len" | _ -> () ); pr ");\n" @@ -1046,6 +1088,10 @@ The hive handle must not be used again after calling this function.\n\n" pr "\ Retu...
2011 Aug 11
2
[Hivex] [PATCH] Correct 32-bit to 64-bit call
--- generator/generator.ml | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/generator/generator.ml b/generator/generator.ml index 31478cd..de911f1 100755 --- a/generator/generator.ml +++ b/generator/generator.ml @@ -1771,7 +1771,7 @@ static void raise_closed (const char *) Noreturn; pr " rv = copy_type_value (r, len, t);\n"; pr "
2012 Mar 31
2
[PATCH v6] hivexml: Add byte run reporting functions
...rWriteAttribute, (writer, BAD_CAST "len", BAD_CAST buf)); + XML_CHECK (xmlTextWriterEndElement, (writer)); + } + XML_CHECK (xmlTextWriterEndElement, (writer)); + return 0; +} + +static int value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value, hive_type t, size_t len, const char *key, const char *str) { xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; const char *type; + int ret = 0; switch (t) { case hive_t_string: type = "string"; break; @@ -297,8 +369,9 @@ value_string (hive_h *h, void *writer_v, hive_node_h nod...
2011 Dec 13
1
[hivex] [PATCH 1/1] hivexml: Change value type output to standard names
..._v, hive_node_h node, const char *name) return 0; } +/* + * Hive type names retrieved from: + * https://secure.wikimedia.org/wikipedia/en/wiki/Windows_Registry#Keys_and_values + * (Retrieved 2011-10-09) + * Caller should not free return value. + */ +static char * +value_type_windows_string (hive_type t) +{ + switch (t) { + case 0: return "REG_NONE"; break; + case 1: return "REG_SZ"; break; + case 2: return "REG_EXPAND_SZ"; break; + case 3: return "REG_BINARY"; break; + case 4: return "REG_DWORD_LITTLE_ENDIAN"; break; + case 5: return &qu...
2011 Aug 10
1
[Hivex][PATCH v2] Report last-modified time of hive root and nodes
...112 insertions(+), 4 deletions(-) diff --git a/generator/generator.ml b/generator/generator.ml index 31478cd..36615f7 100755 --- a/generator/generator.ml +++ b/generator/generator.ml @@ -772,6 +772,7 @@ struct hivex_visitor { int (*value_none) (hive_h *, void *opaque, hive_node_h, hive_value_h, hive_type t, size_t len, const char *key, const char *value); int (*value_other) (hive_h *, void *opaque, hive_node_h, hive_value_h, hive_type t, size_t len, const char *key, const char *value); int (*value_any) (hive_h *, void *opaque, hive_node_h, hive_value_h, hive_type t, size_t len, const char *k...
2014 Aug 04
6
[hivex] Segfault for an integer value to node_set_value
Hi, When an integer argument is passed as value, node_set_value segfaults. Reproducer is at the end of this message The backtrace points at hivex-py.c, function get_value. While obj is non-NULL, `bytes = PyUnicode_AsUTF8String (obj);` returns NULL. Kind regards, Peter https://lekensteyn.nl #!/usr/bin/env python3 import hivex, sys h = hivex.Hivex(sys.argv[1]) print(h) val = {
2011 Dec 08
1
[hivex] [PATCH 8/8] hivexml: Add byte run reporting functions
...rWriteAttribute, (writer, BAD_CAST "len", BAD_CAST buf)); + XML_CHECK (xmlTextWriterEndElement, (writer)); + } + XML_CHECK (xmlTextWriterEndElement, (writer)); + return 0; +} + +static int value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value, hive_type t, size_t len, const char *key, const char *str) { xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; const char *type; + int ret = 0; switch (t) { case hive_t_string: type = "string"; break; @@ -298,8 +369,9 @@ value_string (hive_h *h, void *writer_v, hive_node_h nod...
2010 Jul 07
1
[PATCH] hivex: add hivex_set_value api call and ocaml/perl bindings, tests
...AOpenFlags | AUnusedFlags -> pr "int flags" | ASetValues -> pr "size_t nr_values, const hive_set_value *values" + | ASetValue -> pr "const hive_set_value *val" ) (snd style); (match fst style with | RLenType | RLenTypeVal -> pr ", hive_type *t, size_t *len" @@ -937,6 +947,11 @@ Any existing values stored at the node are discarded, and their C<hive_value_h> handles become invalid. Thus you can remove all values stored at C<node> by passing C<nr_values = 0>.\n\n"; + if List.mem ASetValue (snd style...
2011 Aug 10
1
[PATCH] Report last-modified time of hive root and nodes
...id *opaque, hive_node_h, const char *name); + int (*node_start) (hive_h *, void *opaque, hive_node_h, const char *name, const char *last_modified); int (*node_end) (hive_h *, void *opaque, hive_node_h, const char *name); int (*value_string) (hive_h *, void *opaque, hive_node_h, hive_value_h, hive_type t, size_t len, const char *key, const char *str); int (*value_multiple_strings) (hive_h *, void *opaque, hive_node_h, hive_value_h, hive_type t, size_t len, const char *key, char **argv); @@ -1110,7 +1150,7 @@ terminates immediately. If you don't need a callback function at all, set the f...
2014 Aug 16
7
[hivex] [PATCH 0/6] Python fixes for node_set_value
Hi, This patch series is based on a prior patch[1], splitting off changes as requested and incorporating feedback from Richard Jones. It introduces type validation to avoid segmentation faults (instead, it reports an exception) and fixes handling of the bytes type in Python 3. Major changes since that series: - Drop newly introduced support for integer types for DWORD/QWORDS - Reject Unicode
2014 Aug 08
2
[PATCH 1/2] Add type checking, support integers as value
...Item (v, i), &(ret->values[i])) == -1) { + if (get_value (PyList_GetItem (v, i), &(ret->values[i]), &(ret->words[i])) == -1) { free (ret->values); + free (ret->words); return -1; } } @@ -3070,9 +3124,10 @@ put_val_type (char *val, size_t len, hive_type t) | ASetValues -> pr " py_set_values values;\n"; pr " PyObject *py_values;\n" - | ASetValue -> - pr " hive_set_value val;\n"; - pr " PyObject *py_val;\n" + | ASetValue -> + pr " hive_set_value val;\...
2011 Apr 27
2
[PATCH] hivex/python fix for i386 integer size issue
...y.c, I have successfully tested the 1.2.5 code base on both architectures. Cheers, -Hilko diff --git a/generator/generator.ml b/generator/generator.ml index 7e706d1..9722312 100755 --- a/generator/generator.ml +++ b/generator/generator.ml @@ -2875,7 +2875,7 @@ put_val_type (char *val, size_t len, hive_type t) pr "O" | ANode n | AValue n -> - pr "L" + pr "l" | AString n -> pr "s" | AStringNullable n ->
2011 Aug 31
1
[hivex] OCaml binding error?
...m? --Alex --- generator/generator.ml | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/generator/generator.ml b/generator/generator.ml index de103ed..c98e625 100755 --- a/generator/generator.ml +++ b/generator/generator.ml @@ -1946,7 +1946,7 @@ copy_type_len (size_t len, hive_type t) v = Val_hive_type (t); Store_field (rv, 0, v); v = Val_int (len); - Store_field (rv, 1, len); + Store_field (rv, 1, v); CAMLreturn (rv); } -- 1.7.4.4
2014 Jan 15
0
[PATCH 3/4] hivex: python: Produce Unicode strings in get_* methods
...t_SetItem (list, i, PyString_FromString (argv[i])); -#else - PyList_SetItem (list, i, PyUnicode_FromString (argv[i])); -#endif + PyList_SetItem (list, i, PyUnicode_DecodeUTF8 (argv[i], strlen (argv[i]), NULL)); } return list; @@ -2985,11 +2981,7 @@ put_val_type (char *val, size_t len, hive_type t) { PyObject *r = PyTuple_New (2); PyTuple_SetItem (r, 0, PyLong_FromLong ((long) t)); -#ifdef HAVE_PYSTRING_ASSTRING - PyTuple_SetItem (r, 1, PyString_FromStringAndSize (val, len)); -#else - PyTuple_SetItem (r, 1, PyBytes_FromStringAndSize (val, len)); -#endif + PyTuple_SetItem (r, 1,...
2011 Oct 19
0
[hivex][PATCH 3/8] hivex: Add offset-&-length function for long value data
...ypeVal, [AHive; AValue "val"]), "return data length, data type and data of a value", "\ diff --git a/lib/hivex.c b/lib/hivex.c index bf1a860..df313bf 100644 --- a/lib/hivex.c +++ b/lib/hivex.c @@ -1257,6 +1257,66 @@ hivex_value_type (hive_h *h, hive_value_h value, hive_type *t, size_t *len) return 0; } +hive_value_h +hivex_value_data_cell_offset (hive_h *h, hive_value_h value, size_t *len) +{ + if (!IS_VALID_BLOCK (h, value) || !BLOCK_ID_EQ (h, value, "vk")) { + errno = EINVAL; + return 0; + } + + if (h->msglvl >= 2) + fprintf (stder...
2011 Dec 08
0
[hivex] [PATCH 3/8] hivex: Add offset-&-length function for long value data
...ypeVal, [AHive; AValue "val"]), "return data length, data type and data of a value", "\ diff --git a/lib/hivex.c b/lib/hivex.c index bf1a860..df313bf 100644 --- a/lib/hivex.c +++ b/lib/hivex.c @@ -1257,6 +1257,66 @@ hivex_value_type (hive_h *h, hive_value_h value, hive_type *t, size_t *len) return 0; } +hive_value_h +hivex_value_data_cell_offset (hive_h *h, hive_value_h value, size_t *len) +{ + if (!IS_VALID_BLOCK (h, value) || !BLOCK_ID_EQ (h, value, "vk")) { + errno = EINVAL; + return 0; + } + + if (h->msglvl >= 2) + fprintf (stder...
2011 Sep 02
1
[PATCH 5/7] hivex: Add offset-&-length function for long value data
...ypeVal, [AHive; AValue "val"]), "return data length, data type and data of a value", "\ diff --git a/lib/hivex.c b/lib/hivex.c index d8ffa63..04ceed3 100644 --- a/lib/hivex.c +++ b/lib/hivex.c @@ -1294,6 +1294,51 @@ hivex_value_type (hive_h *h, hive_value_h value, hive_type *t, size_t *len) return 0; } +hive_value_h +hivex_value_data_cell_offset (hive_h *h, hive_value_h value, size_t *len) +{ + if (!IS_VALID_BLOCK (h, value) || !BLOCK_ID_EQ (h, value, "vk")) { + errno = EINVAL; + return 0; + } + + struct ntreg_vk_record *vk = (struct ntreg_vk...
2014 Feb 03
1
[PATCH] hivex: python: value_value no longer generates Unicode strings
...lue.py | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/generator/generator.ml b/generator/generator.ml index 908c5f3..02aaf12 100755 --- a/generator/generator.ml +++ b/generator/generator.ml @@ -2981,7 +2981,7 @@ put_val_type (char *val, size_t len, hive_type t) { PyObject *r = PyTuple_New (2); PyTuple_SetItem (r, 0, PyLong_FromLong ((long) t)); - PyTuple_SetItem (r, 1, PyUnicode_DecodeUTF8 (val, len, NULL)); + PyTuple_SetItem (r, 1, PyBytes_FromStringAndSize (val, len)); return r; } diff --git a/python/t/210-setvalue.py b/python/t/210-s...