Displaying 18 results from an estimated 18 matches for "node_set_value".
Did you mean:
node_get_value
2011 Jun 28
2
minor Hivex.xs leaks
Hi Rich,
While I was looking at hivex today I ran coverity on it.
It spotted one problem but missed a similar one nearby.
The following are from Hivex.xs: (generated by generator.ml)
void
node_set_values (h, node, values)
hive_h *h;
int node;
pl_set_values values = unpack_pl_set_values (ST(2));
PREINIT:
int r;
PPCODE:
r = hivex_node_set_values (h, node, values.nr_values, values.values, 0);
free (values.values);
if (r == -1)
croak ("%s: %s&quo...
2014 Feb 03
1
[PATCH] hivex: python: value_value no longer generates Unicode strings
...root, "B")
-assert b
+B = h.node_get_child (root, "B")
+assert B
values = [
{ "key": "Key1", "t": 3, "value": "ABC" },
{ "key": "Key2", "t": 3, "value": "DEF" }
]
-h.node_set_values (b, values)
+h.node_set_values (B, values)
value1 = { "key": "Key3", "t": 3, "value": "GHI" }
-h.node_set_value (b, value1)
+h.node_set_value (B, value1)
value1 = { "key": "Key1", "t": 3, "value": "...
2014 Mar 04
2
Hivex3: Saving values - always string
.... For
that I choose to use really excellent library hivex3. Just now I'm
performing same test to see, if everything is saved correctly.
Most of things work really well, but there is problem with saving some
values and his types.
Description of problem:
For saving values is used function : node_set_values or node_set_value
This function take 3 arguments, node name, value type and value. It
seems that this function accept for value only strings (any other type
throw error). The problem lay when I want save values differed then
string. For example:
value1 = { "key": "TEST_DWORD2(15...
2011 May 11
1
hivex: Test failure for Perl, OCaml, Python bindings on sparc
On a Debian/unstable chroot environment on smetana.debian.org ("Linux
smetana 2.6.32-5-sparc64-smp #1 SMP Tue Mar 8 01:00:11 UTC 2011 sparc64
GNU/Linux") node_set_value and node_values fail with a "Bad address"
error, see below.
I am going to make an attempt at debugging this tonight, any advice
would be appreciated.
Cheers,
-Hilko
,----
| (sid)bengen at smetana:~/hivex.git/perl$ make check
| make check-TESTS
| make[1]: Entering directory `/home/beng...
2010 Jul 03
1
[PATCH] hivex: add hivex_set_value api call and perl bindings, tests
...or.ml
@@ -71,6 +71,7 @@ and argt = (* Note, cannot be NULL/0 unless it
| AOpenFlags (* HIVEX_OPEN_* flags list. *)
| AUnusedFlags (* Flags arg that is always 0 *)
| ASetValues (* See hivex_node_set_values. *)
+ | ASetValue (* See hivex_node_set_value. *)
(* Hive types, from:
* https://secure.wikimedia.org/wikipedia/en/wiki/Windows_Registry#Keys_and_values
@@ -304,8 +305,15 @@ subnodes become invalid. You cannot delete the root node.";
"set (key, value...
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]...
2010 Jul 07
1
[PATCH] hivex: add hivex_set_value api call and ocaml/perl bindings, tests
...or.ml
@@ -71,6 +71,7 @@ and argt = (* Note, cannot be NULL/0 unless it
| AOpenFlags (* HIVEX_OPEN_* flags list. *)
| AUnusedFlags (* Flags arg that is always 0 *)
| ASetValues (* See hivex_node_set_values. *)
+ | ASetValue (* See hivex_node_set_value. *)
(* Hive types, from:
* https://secure.wikimedia.org/wikipedia/en/wiki/Windows_Registry#Keys_and_values
@@ -304,8 +305,15 @@ subnodes become invalid. You cannot delete the root node.";
"set (key, value...
2014 Mar 05
2
Re: Hivex3: Saving values - always string
...ow
>> I'm performing same test to see, if everything is saved correctly.
>>
>> Most of things work really well, but there is problem with saving
>> some values and his types.
>>
>> Description of problem:
>>
>> For saving values is used function : node_set_values or node_set_value
>> This function take 3 arguments, node name, value type and value. It
>> seems that this function accept for value only strings (any other
>> type throw error). The problem lay when I want save values differed
>> then string. For example:
> It's a...
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 Jan 15
0
[PATCH 4/4] hivex: python: Get rid of to_string function in test script
...3 would break tests.
---
python/t/210-setvalue.py | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/python/t/210-setvalue.py b/python/t/210-setvalue.py
index 9d93519..2ee7ac5 100644
--- a/python/t/210-setvalue.py
+++ b/python/t/210-setvalue.py
@@ -47,20 +47,12 @@ h.node_set_value (b, value1)
value1 = { "key": "Key1", "t": 3, "value": "JKL" }
h.node_set_value (b, value1)
-# In Python2, the data is returned as a string. In Python3, it is
-# returned as bytes. Provide a function to convert either to a string.
-def to_stri...
2010 Aug 13
2
[PATCH] Add debug output to hivex_close
---
lib/hivex.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/hivex.c b/lib/hivex.c
index 13d7556..8a774de 100644
--- a/lib/hivex.c
+++ b/lib/hivex.c
@@ -543,6 +543,9 @@ hivex_close (hive_h *h)
free (h->filename);
free (h);
+ if (h->msglvl >= 1)
+ fprintf (stderr, "hivex_close\n");
+
return r;
}
--
1.7.2.1
2014 Jan 15
4
[PATCH 1/4] hivex: Python 2.6 does not have sysconfig.
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6785037..203f34f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -329,8 +329,8 @@ AS_IF([test "x$enable_python" != "xno"],
AC_MSG_CHECKING([for Python extension suffix (PEP-3149)])
if test -z "$PYTHON_EXT_SUFFIX"; then
2010 Aug 16
1
[PATCH] Install VirtIO storage and network drivers in Windows
...and a new explicit trailing NULL
+ $value .= $append."\0";
+
+ # Re-encode the string back to utf16le
+ $data = encode('UTF-16LE', $value);
+ }
+
+ push (@new, { key => $key, t => $type, value => $data });
+ }
+ $h->node_set_values($node, \@new);
+
+ $h->commit(undef);
+ undef $h;
+
+ # Upload the new registry.
+ $g->upload($sw_local, $sw_guest);
+}
+
sub _upload_files
{
my $g = shift;
--
1.7.2.1
2014 Aug 08
2
[PATCH 1/2] Add type checking, support integers as value
Before this patch, Python would segfault once you pass a non-string key
or value to node_set_value. It was also not possible to set bytes on
Python 3 as Unicode was assumed (Python 2 was not affected by this).
This patch fixes recognition of bytes for Python 3, but in addition it
recognizes ints (includes 'long' in Python 2) for DWORD (LE + BE) and
QWORDs. For this purpose, a new field...
2011 Dec 08
0
[hivex] [PATCH 1/8] Add test hive and generator script
...uot;31Bytes", "t": 3, "value": (moderate_value*2)[:31] },
+ { "key": "32Bytes", "t": 3, "value": moderate_value*2 },
+ { "key": "33Bytes", "t": 3, "value": (moderate_value*3)[:33] },
+]
+h.node_set_values (mvp, values)
+
+new_moderate_value = h.node_get_value (mvp, "16Bytes")
+
+assert h.value_value (new_moderate_value)[1] == moderate_value
+
+h.commit ("%s/../images/rlenvalue_test_hive" % srcdir)
diff --git a/images/rlenvalue_test_hive b/images/rlenvalue_test_hive
new file mode...
2014 Aug 10
2
About the return value of value_value
Hi,
I have been working on a Python application that uses hivex. Meanwhile I have
encountered some Python bindings issues which could be fixed.
The next issue I see now is about the value_value function. This is briefly
documented as: "return data length, data type and data of a value".
For Perl, Python and OCaml, this is not true. A tuple is returned for both
without the length
2010 Jul 03
1
[PATCH] hivex: add hivex_set_value api call
I'm not entirely sure the generator/generator.ml changes are as correct
as they could be. I'm not very familiar with Caml.
The hivex_node_set_value call builds up a list of hive_set_values by
walking the existing values at the node, adding or replacing the passed
hive_set_value as necessary, then shoving the list at
hivex_node_set_values.
Not included: Perl or OCaml binding glue.
I'm not on the list, please CC me to replies. Thanks!
---...
2014 Aug 10
2
New Python API? (was: Re: About the return value of value_value)
...ue_value(start_id)
dword_value = h.value_dword(start_id)
if node_value != 4:
new_value = {
"key": "Start",
# constant from hivex.hive_types
"t": REG_DWORD,
# alternative of b'\4\0\0\0'
"value": 4
}
h.node_set_value(svc_viostor, new_value)
h.commit()
It would be great if something like this could be done instead:
import hivex
hive = hivex.Hivex2("system", write=True)
ccs_name = "ControlSet001"
svc_viostor = hive.root()[ccs_name].Services.viostor
if svc_viostor.Start != 4:
# Automatic...