search for: hivex_node_get_value

Displaying 20 results from an estimated 36 matches for "hivex_node_get_value".

2016 Aug 23
1
Re: [PATCH 1/2] v2v:windows: factor out getting CurrentControlSet
...----------------------------------------------*) > (* Perform the conversion of the Windows guest. *) > > + (* Find the 'Current' ControlSet. *) > + let get_current_cs root = > + let select = g#hivex_node_get_child root "Select" in > + let valueh = g#hivex_node_get_value select "Current" in > + let value = int_of_le32 (g#hivex_value_value valueh) in > + sprintf "ControlSet%03Ld" value in > + > let rec configure_firstboot () = > (match installer with > | None -> () > @@ -302,14 +309,8 @@ if errorlevel 3...
2016 Jan 20
1
[PATCH] convert_windows: uninstall Parallels Tools on first boot
...Windows.get_node g root path with + | None -> raise Not_found + | Some node -> node in + let uninstnodes = g#hivex_node_children node in + + Array.iter ( + fun { G.hivex_node_h = uninstnode } -> + try + let valueh = g#hivex_node_get_value uninstnode "DisplayName" in + if valueh = 0L then + raise Not_found; + + let dispname = g#hivex_value_utf8 valueh in + if not (Str.string_match (Str.regexp ".*Parallels Tools.*") + d...
2016 Sep 01
0
Re: [PATCH v2 1/2] v2v:windows: factor out getting CurrentControlSet
...----------------------------------------------*) > (* Perform the conversion of the Windows guest. *) > > + (* Find the 'Current' ControlSet. *) > + let get_current_cs root = > + let select = g#hivex_node_get_child root "Select" in > + let valueh = g#hivex_node_get_value select "Current" in > + let value = int_of_le32 (g#hivex_value_value valueh) in > + sprintf "ControlSet%03Ld" value in > + > let rec configure_firstboot () = > (match installer with > | None -> () > @@ -302,13 +309,7 @@ if errorlevel 3...
2016 Sep 01
3
[PATCH v2 0/2] v2v:windows: prevent conflicts with PnP on firstboot
Wait for driver installations fired by the PnP manager to complete before running firstboot scripts. The first patch is a minor refactoring to pave the way for the second patch. The latter contains the bulk of the changes as well as the description of the idea. Roman Kagan (2): v2v:windows: factor out getting CurrentControlSet v2v:windows: prevent conflicts with PnP on firstboot --- v1
2012 Aug 29
5
[PATCH 0/4] Add hivex APIs into the libguestfs API (RHBZ#852394)
This adds most of the hivex APIs directly to the libguestfs API, so that you can read and write Windows Registry hive files from libguestfs without needing to download and upload hive files from the guest. This is analogous to how Augeas APIs are exposed already (guestfs_aug_*) Also, inspection is now done using the new APIs, which fixes the following bug:
2011 Sep 02
1
[PATCH 4/7] hivex: Add metadata length functions for nodes and values
...(stderr, "hivex_node_struct_length: returning EFAULT because" + " node name is too long (%zu, %zu)\n", name_len, seg_len); + errno = EFAULT; + return 0; + } + return ret; +} + char * hivex_node_name (hive_h *h, hive_node_h node) { @@ -1190,6 +1214,15 @@ hivex_node_get_value (hive_h *h, hive_node_h node, const char *key) } size_t +hivex_value_struct_length (hive_h *h, hive_value_h value) { + size_t key_len = hivex_value_key_len (h, value); + if (errno) + return 0; + /* -1 to avoid double-counting the first name character */ + return key_len + sizeof (struct...
2016 Jun 06
1
[PATCH] v2v:windows: prevent Parallels drivers from loading at boot
...[current_cs; "Control"; "Class"; + "{4d36e967-e325-11ce-bfc1-08002be10318}"] in + match strg_cls with + | None -> () + | Some strg_cls -> + let lfkey = "LowerFilters" in + let valueh = g#hivex_node_get_value strg_cls lfkey in + if valueh <> 0L then ( + let data = g#hivex_value_value valueh in + let filters = String.nsplit "\000" (Regedit.decode_utf16le data) in + let filters = List.filter ( + fun x -> x <> "prl_strg" &&...
2016 Apr 05
0
[PATCH 3/7] customize: add support for pvvxsvc
...t filename = g#case_sensitive_path filename in - g#hivex_open ~write:true filename; - - let root_node = g#hivex_root () in - - (* Find the 'Current' ControlSet. *) - let current_cs = - let select = g#hivex_node_get_child root_node "Select" in - let valueh = g#hivex_node_get_value select "Current" in - let value = int_of_le32 (g#hivex_value_value valueh) in - sprintf "ControlSet%03Ld" value in - - (* Add a new rhsrvany service to the system registry to execute firstboot. - * NB: All these edits are in the HKLM\SYSTEM hive. No other -...
2018 Nov 16
4
[PATCH 0/2] v2v: uninstall the VMware Tools from Windows guests
It seems newer versions of VMware Tools for Windows can be uninstalled also when the guest does not run on VMware anymore. Hence, attempt to uninstall them during a conversion, reusing the same code already used to uninstall Parallel Tools. This was tested with the following Windows guests: - Windows 2008r2 - Windows 2012r2 - Windows 2016 - Windows 7 - Windows 8 - Windows 10 Pino Toscano (2):
2016 Feb 15
1
New API: node_nr_values
...hivex_node_values>."; + "value_key_len", (RSize, [AHive; AValue "val"]), "return the length of a value's key", "\ diff --git a/lib/value.c b/lib/value.c index 43e89f9..2dfe006 100644 --- a/lib/value.c +++ b/lib/value.c @@ -159,6 +159,22 @@ hivex_node_get_value (hive_h *h, hive_node_h node, const char *key) } size_t +hivex_node_nr_values (hive_h *h, hive_node_h node) +{ + if (!IS_VALID_BLOCK (h, node) || !block_id_eq (h, node, "nk")) { + SET_ERRNO (EINVAL, "invalid block or not an 'nk' block"); + return 0; + } + + s...
2018 Nov 16
0
[PATCH 1/2] v2v: windows: factor uninstall commands search
..."Parallels Tools" = -1 && - String.find dispname "Virtuozzo Tools" = -1 then + if not (matchfn dispname) then raise Not_found; let uninstval = "UninstallString" in let valueh = g#hivex_node_get_value uninstnode uninstval in if valueh = 0L then ( let name = g#hivex_node_name uninstnode in - warning (f_"cannot uninstall Parallels Tools: registry key ‘HKLM\\SOFTWARE\\%s\\%s’ with DisplayName ‘%s’ doesn't contain value ‘%s’") -...
2016 Jun 10
0
Re: [PATCH 2/2] v2v: remove the 'graphicsmodedisabled' entry in ESP BCD
..."23000003"] in > + let boot_mgr_default_link = > + match Windows.get_node g root path with > + | None -> raise Not_found > + | Some node -> node in > + let current_boot_entry = g#hivex_value_utf8 ( > + g#hivex_node_get_value boot_mgr_default_link "Element") in > + let path = ["Objects"; current_boot_entry; "Elements"; "16000046"] in > + match Windows.get_node g root path with > + | None -> raise Not_found > + | Some graphics_mode...
2017 Feb 18
11
[PATCH 0/8] Miscellaneous cleanups to Windows registry code.
A very miscellaneous set of cleanups to how we handle the Windows registry in virt-v2v, firstboot, and inspection code. This should all be straightforward non-controversial refactoring. Some highlights: - Add a new mllib Registry module containing various utility functions that are currently scattered all around. - Only compute the software/system hive paths once during inspection, and
2011 Sep 02
1
[PATCH 2/7] hivex: Split value_key function into value_key and value_key_len
...<\"@\">."; + "value_key", (RString, [AHive; AValue "val"]), "return the key of a (key, value) pair", "\ diff --git a/lib/hivex.c b/lib/hivex.c index 4b9fcf0..61177d3 100644 --- a/lib/hivex.c +++ b/lib/hivex.c @@ -1189,8 +1189,8 @@ hivex_node_get_value (hive_h *h, hive_node_h node, const char *key) return ret; } -char * -hivex_value_key (hive_h *h, hive_value_h value) +size_t +hivex_value_key_len (hive_h *h, hive_value_h value) { if (!IS_VALID_BLOCK (h, value) || !BLOCK_ID_EQ (h, value, "vk")) { errno = EINVAL; @@ -1199,2...
2016 Apr 05
0
[PATCH 1/7] v2v: check next free oem%d.inf in /Windows/Inf
...de g root path with - | None -> - error (f_"cannot find HKLM\\SYSTEM\\DriverDatabase\\DeviceIds\\%s in the guest registry") scsi_adapter_guid - | Some node -> - let rec loop node i = - let oem_inf = sprintf "oem%d.inf" i in - let value = g#hivex_node_get_value node oem_inf in - if value = 0_L then oem_inf else loop node (i+1) - in - let oem_inf = loop node 1 in - (* Create the key. *) - g#hivex_node_set_value node oem_inf (* REG_NONE *) 0_L ""; - oem_inf in + let oem_inf = set_free_oem_inf g root scsi_adap...
2014 Dec 02
1
[PATCH NOT TO BE APPLIED] v2v: windows: Make registry changes to all ControlSets, not
[Partly using the mailing list as a backup again ...] This commit changes virt-v2v to make registry changes to all ControlSets, not just the CurrentControlSet. Not sure what difference if any this would make. Rich.
2016 Aug 23
0
Re: [PATCH 2/2] v2v:windows: prevent conflicts with PnP on firstboot
...let node = > + match g#hivex_node_get_child parent x with > + | 0L -> g#hivex_node_add_child parent x (* not found, create *) > + | node -> node in > + loop node xs > + in > + loop root key_path in > + let valueh = g#hivex_node_get_value node name in > + let value = > + match valueh with > + | 0L -> None > + | _ -> Some (int_of_le32 (g#hivex_value_value valueh)) in > + g#hivex_node_set_value node name 4_L (le32_of_int 1_L); > + value > + > + and reg_restore key name value = &gt...
2016 Sep 01
0
Re: [PATCH v2 2/2] v2v:windows: prevent conflicts with PnP on firstboot
...let node = > + match g#hivex_node_get_child parent x with > + | 0L -> g#hivex_node_add_child parent x (* not found, create *) > + | node -> node in > + loop node xs > + in > + loop root key_path in > + let valueh = g#hivex_node_get_value node name in > + let value = > + match valueh with > + | 0L -> None > + | _ -> Some (int_of_le32 (g#hivex_value_value valueh)) in > + g#hivex_node_set_value node name 4_L (le32_of_int 1_L); > + value > + > + and reg_restore key name value = &gt...
2010 Jul 22
0
Fwd: [PATCH hivex] non-ASCII characters in node names
...return NULL; - memcpy (ret, nk->name, len); - ret[len] = '\0'; + char *ret; + if (le16toh(nk->flags) & 0x20) { + ret = windows_latin1_to_utf8(nk->name, len); + } else { + ret = windows_utf16_to_utf8(nk->name, len); + } return ret; } @@ -1113,6 +1111,7 @@ hivex_node_get_value (hive_h *h, hive_node_h node, const char *key) char * hivex_value_key (hive_h *h, hive_value_h value) { + iconv_t ic; if (!IS_VALID_BLOCK (h, value) || !BLOCK_ID_EQ (h, value, "vk")) { errno = EINVAL; return 0; @@ -1120,10 +1119,6 @@ hivex_value_key (hive_h *h, hive_value...
2017 Aug 09
0
[PATCH v12 04/11] New API: Deprecate hivex_value_utf8 and replace with hivex_value_string.
...- *outp = '\0'; - iconv_close (ic); - - return out; -} diff --git a/lib/inspect-apps.c b/lib/inspect-apps.c index 25192340c..0ea962a73 100644 --- a/lib/inspect-apps.c +++ b/lib/inspect-apps.c @@ -919,23 +919,23 @@ list_applications_windows_from_path (guestfs_h *g, value = guestfs_hivex_node_get_value (g, child, "DisplayName"); if (value) { - display_name = guestfs_hivex_value_utf8 (g, value); + display_name = guestfs_hivex_value_string (g, value); if (display_name) { value = guestfs_hivex_node_get_value (g, child, "DisplayVersion"); if...