search for: node_get_valu

Displaying 20 results from an estimated 24 matches for "node_get_valu".

Did you mean: node_get_value
2014 Feb 03
1
[PATCH] hivex: python: value_value no longer generates Unicode strings
...y3", "t": 3, "value": "GHI" } -h.node_set_value (b, value1) +h.node_set_value (B, value1) value1 = { "key": "Key1", "t": 3, "value": "JKL" } -h.node_set_value (b, value1) +h.node_set_value (B, value1) -val = h.node_get_value (b, "Key1") +val = h.node_get_value (B, "Key1") t_data = h.value_value (val) assert t_data[0] == 3 -assert t_data[1] == "JKL" +assert t_data[1] == b("JKL") -val = h.node_get_value (b, "Key3") +val = h.node_get_value (B, "Key3") t_dat...
2019 Jan 17
1
[hivex PATCH] ruby: improve test functions
...+), 20 deletions(-) diff --git a/ruby/tests/tc_120_rlenvalue.rb b/ruby/tests/tc_120_rlenvalue.rb index 6c03f43..6a2fb72 100644 --- a/ruby/tests/tc_120_rlenvalue.rb +++ b/ruby/tests/tc_120_rlenvalue.rb @@ -37,7 +37,7 @@ class TestRLenValue < MiniTest::Unit::TestCase moderate_value_value = h.node_get_value(moderate_value_node, "33Bytes") r = h.value_data_cell_offset(moderate_value_value) - assert_equal(r[:len], 37) - assert_equal(r[:off], 8712) + assert_equal(37, r[:len]) + assert_equal(8712, r[:off]) end end diff --git a/ruby/tests/tc_130_special.rb b/ruby/tests/tc_...
2014 Jan 15
0
[PATCH 4/4] hivex: python: Get rid of to_string function in test script
...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_string (data): - if sys.version_info[0] == 2: - return data - else: - return str (data, "utf-8") - val = h.node_get_value (b, "Key1") t_data = h.value_value (val) assert t_data[0] == 3 -assert to_string (t_data[1]) == "JKL" +assert t_data[1] == "JKL" val = h.node_get_value (b, "Key3") t_data = h.value_value (val) assert t_data[0] == 3 -assert to_string (t_data[1]) == &qu...
2010 Oct 19
1
[PATCH] Fix Windows conversion when ControlSet001 isn't the CurrentControlSet
...Hivex->open ($tmpdir . "/system", write => 1) or die "open system hive: $!"; + # Get the 'Current' ControlSet. This is normally 001, but not always. + my $select = $h->node_get_child($h->root(), 'Select'); + my $current_cs = $h->node_get_value($select, 'Current'); + $current_cs = sprintf("ControlSet%03i", $h->value_dword($current_cs)); + # Make the changes. - my $regedits = ' + my $regedits = <<REGEDITS; ; Edits to be made to a Windows guest to have ; it boot from viostor. -[HKEY_LOCAL_MA...
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
2014 Mar 04
2
Hivex3: Saving values - always string
Hallo, I working on GUI interface for users to manipulate Windows Registry. 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
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
2011 Dec 08
0
[hivex] [PATCH 1/8] Add test hive and generator script
...(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 100644 index 0000000000000000000000000000000000000000....
2011 Dec 08
0
[hivex] [PATCH 7/8] ruby: Add unit test for new RLenValue type
...h = Hivex::open("../images/rlenvalue_test_hive", {}) + assert_not_nil (h) + + root = h.root () + assert_not_nil (root) + + moderate_value_node = h.node_get_child (root, "ModerateValueParent") + assert_not_nil (moderate_value_node) + + moderate_value_value = h.node_get_value (moderate_value_node, "33Bytes") + + r = h.value_data_cell_offset (moderate_value_value) + assert_equal (r[:len], 37) + assert_equal (r[:off], 8712) + end +end -- 1.7.6.4
2014 Jan 10
0
[PATCH 6/7] python: Python 3 no longer recognizes long integers
...2 deletions(-) diff --git a/python/t/120-rlenvalue.py b/python/t/120-rlenvalue.py index ebc48f5..a9b2129 100644 --- a/python/t/120-rlenvalue.py +++ b/python/t/120-rlenvalue.py @@ -38,5 +38,5 @@ moderate_value_node = h.node_get_child (root, "ModerateValueParent") moderate_value_value = h.node_get_value (moderate_value_node, "33Bytes") r = h.value_data_cell_offset (moderate_value_value) -assert r[0] == 37L -assert r[1] == 8712L +assert r[0] == 37 +assert r[1] == 8712 -- 1.8.5.2
2011 Dec 08
0
[hivex] [PATCH 4/8] ocaml: Add unit test for new RLenValue type
...+ +open Unix +open Printf +let (//) = Filename.concat + +let () = + let h = Hivex.open_file "../images/rlenvalue_test_hive" [] in + let root = Hivex.root h in + let moderate_value_node = Hivex.node_get_child h root "ModerateValueParent" in + let moderate_value_value = Hivex.node_get_value h moderate_value_node "33Bytes" in + let (data_len, data_off) = Hivex.value_data_cell_offset h moderate_value_value in + assert ( (data_off == (Obj.magic 8712:Hivex.value)) && (data_len == 37) ); + + Hivex.close h; + + (* Gc.compact is a good way to ensure we don't have +...
2014 Aug 08
2
[PATCH 1/2] Add type checking, support integers as value
...ue=b'Val'): + global h + h.node_set_value (h.root (), { + "key": key, + "t": t, + "value": value + }) + +def test_pass (t, value, exp_bytes): + global h + key = "test_key" + set_value (key, t, value) + val = h.node_get_value (h.root (), key) + ret_type, ret_value = h.value_value (val) + assert t == ret_type, \ + "expected type {0}, got {1}".format(t, ret_type) + assert exp_bytes == ret_value, \ + "expected value {0}, got {1}".format(exp_bytes, ret_value) + +def test_exception...
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
2014 Jan 10
14
[PATCH 1/7] Add a minimal hive with "special" keys and values
--- images/README | 14 ++++++++++++ images/mkzero/Makefile | 9 ++++++++ images/mkzero/mkzero.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ images/special | Bin 0 -> 8192 bytes 4 files changed, 82 insertions(+) create mode 100644 images/mkzero/Makefile create mode 100644 images/mkzero/mkzero.c create mode 100644 images/special diff --git a/images/README
2014 Aug 10
2
New Python API? (was: Re: About the return value of value_value)
...vex.hive_types import * h = hivex.Hivex("system", write=True) ccs_name = "ControlSet001" ccs = h.node_get_child(h.root(), ccs_name) services = h.node_get_child(ccs, "Services") svc_viostor = h.node_get_child(services, "viostor") start_id = h.node_get_value(svc_viostor, "Start") #node_type, node_value = h.value_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...
2017 Jul 31
0
[PATCH v11 09/10] daemon: Implement inspection of Windows.
...name = get_hostname h root current_control_set in + data.hostname <- hostname + ) (* with_hive *) + +(* Get the CurrentControlSet. *) +and get_current_control_set h root = + try + let path = [ "Select" ] in + let node = get_node h root path in + let current_v = Hivex.node_get_value h node "Current" in + let current_control_set = + sprintf "ControlSet%03ld" (Hivex.value_dword h current_v) in + Some current_control_set + with + | Not_found -> + if verbose () then + eprintf "check_windows_system_registry: cannot locate HKLM\\SY...
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 = {
2017 Jul 31
16
[PATCH v11 00/10] Reimplement inspection in the daemon.
v10: https://www.redhat.com/archives/libguestfs/2017-July/msg00245.html No actual change here, but I rebased and retested. Also this series now does not depend on any other patch series since everything else needed is upstream. Rich.
2017 Jul 21
10
[PATCH v10 00/10] Reimplement inspection in the daemon.
v9 was here: https://www.redhat.com/archives/libguestfs/2017-July/msg00139.html This depends on these three series (the first two being single minor patches): https://www.redhat.com/archives/libguestfs/2017-July/msg00207.html https://www.redhat.com/archives/libguestfs/2017-July/msg00209.html https://www.redhat.com/archives/libguestfs/2017-July/msg00215.html There is no substantive change. I
2017 Jul 17
12
[PATCH v9 00/11] Reimplement inspection in the daemon.
This depends on the patch series "[PATCH 00/27] Reimplement many daemon APIs in OCaml." (https://www.redhat.com/archives/libguestfs/2017-July/msg00098.html) v8 was posted here: https://www.redhat.com/archives/libguestfs/2017-June/msg00274.html v9: - I split up the mega-patch into a more reviewable series of smaller, incremental patches. There are some other changes vs v8, but