search for: hivex_value_key

Displaying 20 results from an estimated 34 matches for "hivex_value_key".

2015 May 27
3
Concurrent scanning of same disk
Greetings, I am suffering of several weird errors which show randomly and make me suspect some concurrency issue. Libguestfs version is 1.28.1, linux kernel 3.16, libvirt 1.2.9 and qemu 2.1. What I'm trying to do is comparing the disk state at two different point of a guest execution. Disk snapshots are taken through libvirt in different moments (I am aware of caching issue), from such
2015 May 28
3
Re: Concurrent scanning of same disk
...tfs: trace: hivex_node_get_child = 104312 libguestfs: trace: hivex_node_values 104312 guestfsd: main_loop: proc 355 (hivex_node_get_child) took 0.00 seconds guestfsd: main_loop: new request, len 0x30 libguestfs: trace: hivex_node_values = <struct guestfs_hivex_value_list *> libguestfs: trace: hivex_value_key 4496744 guestfsd: main_loop: proc 357 (hivex_node_values) took 0.00 seconds guestfsd: main_loop: new request, len 0x30 libguestfs: trace: hivex_value_key = "CurrentVersion" libguestfs: trace: hivex_value_utf8 4496744 libguestfs: trace: hivex_value_value 4496744 guestfsd: main_loop: proc 3...
2011 Sep 02
1
[PATCH 2/7] hivex: Split value_key function into value_key and value_key_len
...ot;]), "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,23 +1199,38 @@ hivex_value_key (hive_h *h, hive_value_h value) struct ntreg_vk_record *v...
2014 Jan 13
3
Re: [PATCH 2/7] lib: Use vk->len for string conversion
...11, 2014 at 12:12:47AM +0100, Hilko Bengen wrote: > --- > lib/value.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/lib/value.c b/lib/value.c > index 65404d7..e700c84 100644 > --- a/lib/value.c > +++ b/lib/value.c > @@ -207,14 +207,8 @@ hivex_value_key (hive_h *h, hive_value_h value) > struct ntreg_vk_record *vk = > (struct ntreg_vk_record *) ((char *) h->addr + value); > > - /* AFAIK the key is always plain ASCII, so no conversion to UTF-8 is > - * necessary. However we do need to nul-terminate the string. > -...
2010 Jul 22
0
Fwd: [PATCH hivex] non-ASCII characters in node names
...; + 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_h value) struct ntreg_vk_record *vk = (struct ntreg_vk_record *) (...
2014 Jan 13
1
[PATCH 2/7 take 2] lib: Use vk->len for string conversion
--- lib/value.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/value.c b/lib/value.c index 65404d7..7b2e9d3 100644 --- a/lib/value.c +++ b/lib/value.c @@ -207,14 +207,14 @@ hivex_value_key (hive_h *h, hive_value_h value) struct ntreg_vk_record *vk = (struct ntreg_vk_record *) ((char *) h->addr + value); - /* AFAIK the key is always plain ASCII, so no conversion to UTF-8 is - * necessary. However we do need to nul-terminate the string. - */ - errno = 0; - size_t l...
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:
2013 Nov 22
4
[PATCH 1/3] Document ntreg_nk_record.flags
--- lib/hivex-internal.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/hivex-internal.h b/lib/hivex-internal.h index f391b98..d7ce339 100644 --- a/lib/hivex-internal.h +++ b/lib/hivex-internal.h @@ -125,7 +125,19 @@ struct ntreg_hbin_block { struct ntreg_nk_record { int32_t seg_len; /* length (always -ve because used) */ char id[2];
2011 Apr 13
1
[PATCH hivex] maint: split long lines
...es: returning EFAULT because value is not a valid block (0x%zx)\n", + fprintf (stderr, "hivex_node_values: returning EFAULT" + " because value is not a valid block (0x%zx)\n", value); errno = EFAULT; goto error; @@ -1134,7 +1154,8 @@ hivex_value_key (hive_h *h, hive_value_h value) size_t seg_len = block_len (h, value, NULL); if (sizeof (struct ntreg_vk_record) + len - 1 > seg_len) { if (h->msglvl >= 2) - fprintf (stderr, "hivex_value_key: returning EFAULT because key length is too long (%zu, %zu)\n", + f...
2011 Aug 31
1
[PATCH] hivex: Add byte runs for nodes and values
...ode 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) { @@ -1189,8 +1213,17 @@ 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_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 ntreg_vk_record) - 1...
2013 Nov 22
0
[PATCH 3/3] Correctly handle latin1-encoded key/value names
...return NULL; /* iconv(3) has an insane interface ... */ - /* Mostly UTF-8 will be smaller, so this is a good initial guess. */ size_t outalloc = len; again:; diff --git a/lib/value.c b/lib/value.c index 66cde48..3460a8c 100644 --- a/lib/value.c +++ b/lib/value.c @@ -215,12 +215,7 @@ hivex_value_key (hive_h *h, hive_value_h value) return NULL; size_t flags = le16toh (vk->flags); if (flags & 0x01) { - char *ret = malloc (len + 1); - if (ret == NULL) - return NULL; - memcpy (ret, vk->name, len); - ret[len] = '\0'; - return ret; + return _hivex_...
2014 Jan 10
0
[PATCH 2/7] lib: Use vk->len for string conversion
--- lib/value.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/value.c b/lib/value.c index 65404d7..e700c84 100644 --- a/lib/value.c +++ b/lib/value.c @@ -207,14 +207,8 @@ hivex_value_key (hive_h *h, hive_value_h value) struct ntreg_vk_record *vk = (struct ntreg_vk_record *) ((char *) h->addr + value); - /* AFAIK the key is always plain ASCII, so no conversion to UTF-8 is - * necessary. However we do need to nul-terminate the string. - */ - errno = 0; - size_t l...
2011 Sep 02
1
[PATCH 6/7] hivexml: Report attributes in values instead of text.
Reporting value data in attributes has two advantages: * The output of hivexml breaks Python expat processing if binary data makes it out. This was observed in Software hives. * Not having child text makes room for child elements. Signed-off-by: Alex Nelson <ajnelson at cs.ucsc.edu> --- xml/hivexml.c | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff
2014 Aug 07
4
[PATCH 0/2] Fix errors found by Clang static analyzer
Hi, Here is one trivial initialization fix and another patch to convert a huge macro to an inline function. The result of the expansion would show up in an assertion which triggered a -Woverlength-strings warning. Peter Wu (2): Fix garbage return value on error Fix overly long assertion string lib/hivex-internal.h | 28 ++++++++++++++++------------ lib/node.c | 18
2010 Jul 07
1
[PATCH] hivex: add hivex_set_value api call and ocaml/perl bindings, tests
...hive_set_value *value = &values[prev_val - prev_values]; + + char *valval = hivex_value_value (h, *prev_val, &t, &len); + if (valval == NULL) goto leave_partial; + + ++alloc_ct; + value->value = valval; + value->t = t; + value->len = len; + + char *valkey = hivex_value_key (h, *prev_val); + if (valkey == NULL) goto leave_partial; + + ++alloc_ct; + value->key = valkey; + + if (STRCASEEQ (valkey, val->key)) + idx_of_val = prev_val - prev_values; + } + + if (idx_of_val > -1) { + free (values[idx_of_val].key); + free (values[idx_of_val]....
2018 Feb 09
3
[PATCH] Add a cache for iconv_t handles to hive_t
...t = 0; - char *buf = _hivex_recode(encoding, str, len, "UTF-8", &ret); + char *buf = _hivex_recode (h, t, str, len, &ret); free(buf); return ret; } diff --git a/lib/value.c b/lib/value.c index 2dfe006..3257b53 100644 --- a/lib/value.c +++ b/lib/value.c @@ -209,7 +209,7 @@ hivex_value_key_len (hive_h *h, hive_value_h value) SET_ERRNO (EFAULT, "key length is too long (%zu, %zu)", len, seg_len); return 0; } - return _hivex_utf8_strlen (vk->name, len, ! (le16toh (vk->flags) & 0x01)); + return _hivex_utf8_strlen (h, vk->name, len, ! (le16toh (vk-&gt...
2010 Jul 03
1
[PATCH] hivex: add hivex_set_value api call
...hive_set_value *value = &values[prev_val - prev_values]; + + char *valval = hivex_value_value (h, *prev_val, &t, &len); + if (valval == NULL) goto leave_partial; + + ++alloc_ct; + value->value = valval; + value->t = t; + value->len = len; + + char *valkey = hivex_value_key (h, *prev_val); + if (valkey == NULL) goto leave_partial; + + ++alloc_ct; + value->key = valkey; + + if (strcmp (valkey, val->key) == 0) + idx_of_val = prev_val - prev_values; + } + + if (idx_of_val > -1) { + free (values[idx_of_val].key); + free (values[idx_of_val...
2010 Jul 03
1
[PATCH] hivex: add hivex_set_value api call and perl bindings, tests
...hive_set_value *value = &values[prev_val - prev_values]; + + char *valval = hivex_value_value (h, *prev_val, &t, &len); + if (valval == NULL) goto leave_partial; + + ++alloc_ct; + value->value = valval; + value->t = t; + value->len = len; + + char *valkey = hivex_value_key (h, *prev_val); + if (valkey == NULL) goto leave_partial; + + ++alloc_ct; + value->key = valkey; + + if (STRCASEEQ (valkey, val->key)) + idx_of_val = prev_val - prev_values; + } + + if (idx_of_val > -1) { + free (values[idx_of_val].key); + free (values[idx_of_val]....
2018 Feb 09
0
Re: [PATCH] Add a cache for iconv_t handles to hive_t
...str, len, "UTF-8", &ret); > + char *buf = _hivex_recode (h, t, str, len, &ret); > free(buf); > return ret; > } > diff --git a/lib/value.c b/lib/value.c > index 2dfe006..3257b53 100644 > --- a/lib/value.c > +++ b/lib/value.c > @@ -209,7 +209,7 @@ hivex_value_key_len (hive_h *h, hive_value_h value) > SET_ERRNO (EFAULT, "key length is too long (%zu, %zu)", len, seg_len); > return 0; > } > - return _hivex_utf8_strlen (vk->name, len, ! (le16toh (vk->flags) & 0x01)); > + return _hivex_utf8_strlen (h, vk->name...
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