search for: _hivex_recode

Displaying 14 results from an estimated 14 matches for "_hivex_recode".

2018 Feb 09
3
[PATCH] Add a cache for iconv_t handles to hive_t
...v_cache[t].mutex, NULL); + h->iconv_cache[t].handle = NULL; + } + /* Last modified time. */ h->last_modified = le64toh ((int64_t) h->hdr->last_modified); if (h->msglvl >= 2) { - char *name = _hivex_windows_utf16_to_utf8 (h->hdr->name, 64); + char *name = _hivex_recode (h, utf16le_to_utf8, + h->hdr->name, 64, NULL); fprintf (stderr, "hivex_open: header fields:\n" @@ -424,6 +459,12 @@ hivex_close (hive_h *h) else r = 0; free (h->filename); + for (int t=0; t<3; t++) { + if (h-&...
2018 Feb 09
0
Re: [PATCH] Add a cache for iconv_t handles to hive_t
...v_cache[t].handle = NULL; > + } > + > /* Last modified time. */ > h->last_modified = le64toh ((int64_t) h->hdr->last_modified); > > if (h->msglvl >= 2) { > - char *name = _hivex_windows_utf16_to_utf8 (h->hdr->name, 64); > + char *name = _hivex_recode (h, utf16le_to_utf8, > + h->hdr->name, 64, NULL); > > fprintf (stderr, > "hivex_open: header fields:\n" > @@ -424,6 +459,12 @@ hivex_close (hive_h *h) > else > r = 0; > free (h->filename); >...
2013 Dec 31
0
[PATCH 2/2] lib: utf16: Fix const-correctness issues in _hivex_recode function.
...nternal.h b/lib/hivex-internal.h index 7a548c0..6bc8638 100644 --- a/lib/hivex-internal.h +++ b/lib/hivex-internal.h @@ -268,9 +268,9 @@ extern size_t * _hivex_return_offset_list (offset_list *list); extern void _hivex_print_offset_list (offset_list *list, FILE *fp); /* utf16.c */ -extern char* _hivex_recode (char *input_encoding, - const char *input, size_t input_len, - char *output_encoding, size_t *output_len); +extern char * _hivex_recode (const char *input_encoding, + const char *input, size_t input_len, +...
2018 Feb 09
2
[PATCH] Add a cache for iconv_t handles to hive_t
...t;iconv_cache[t].mutex); + h->iconv_cache[t].handle = NULL; + } + /* Last modified time. */ h->last_modified = le64toh ((int64_t) h->hdr->last_modified); if (h->msglvl >= 2) { - char *name = _hivex_windows_utf16_to_utf8 (h->hdr->name, 64); + char *name = _hivex_recode (h, utf16le_to_utf8, + h->hdr->name, 64, NULL); fprintf (stderr, "hivex_open: header fields:\n" @@ -424,6 +458,12 @@ hivex_close (hive_h *h) else r = 0; free (h->filename); + for (int t=0; t<3; t++) { + if (h-&...
2014 Jan 06
1
Re: [PATCH 2/2] lib: utf16: Fix const-correctness issues in _hivex_recode function.
On Tuesday 31 December 2013 14:27:11 Richard W.M. Jones wrote: > This patch assumes that iconv doesn't actually modify the > input buffer, even though it is declared as char *. > --- > [...] > @@ -51,10 +51,11 @@ _hivex_recode (char *input_encoding, const char > *input, size_t input_len, errno = err; > return NULL; > } > - char *inp = input; > + const char *inp = input; > char *outp = out; > > - size_t r = iconv (ic, &inp, &inlen, &outp, &outlen); > + /* Surely i...
2013 Dec 31
2
[PATCH 1/2] lib: write: Remove unused variable.
--- lib/write.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/write.c b/lib/write.c index 8c4dd8e..384c6b2 100644 --- a/lib/write.c +++ b/lib/write.c @@ -954,7 +954,6 @@ hivex_node_set_values (hive_h *h, hive_node_h node, for (i = 0; i < nr_values; ++i) { /* Allocate vk record to store this (key, value) pair. */ static const char vk_id[2] = { 'v', 'k' }; -
2013 Nov 24
4
[PATCH 1/3] lib: Further generalize iconv wrapper function.
...+ b/lib/hivex-internal.h @@ -268,11 +268,13 @@ extern size_t * _hivex_return_offset_list (offset_list *list); extern void _hivex_print_offset_list (offset_list *list, FILE *fp); /* utf16.c */ -extern char* _hivex_to_utf8 (/* const */ char *input, size_t len, char* input_encoding); +extern char* _hivex_recode (char *input_encoding, + const char *input, size_t input_len, + char *output_encoding, size_t *output_len); #define _hivex_windows_utf16_to_utf8(_input, _len) \ - _hivex_to_utf8 (_input, _len, "UTF-16LE") + _hivex_recode ("UTF-...
2014 Jan 08
0
[PATCH 1/3] lib: Add internal function to calculate strlen for strings encoded in Latin1 or UTF-16LE
--- lib/hivex-internal.h | 1 + lib/utf16.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/hivex-internal.h b/lib/hivex-internal.h index 6bc8638..7f4cc3c 100644 --- a/lib/hivex-internal.h +++ b/lib/hivex-internal.h @@ -277,6 +277,7 @@ extern char * _hivex_recode (const char *input_encoding, _hivex_recode ("LATIN1", _input, _len, "UTF-8", NULL) extern char* _hivex_encode_string(const char *str, size_t *size, int *utf16); extern size_t _hivex_utf16_string_len_in_bytes_max (const char *str, size_t len); +extern size_t _hivex_utf8_strl...
2019 Jan 22
2
[PATCH] lib: Reset errno to zero to avoid erroneously returning E2BIG
This line was accidentally removed in 77fe74fc, causing bug #1145056 (Bugzilla) to resurface. --- lib/utf16.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/utf16.c b/lib/utf16.c index e099548..67fa996 100644 --- a/lib/utf16.c +++ b/lib/utf16.c @@ -58,6 +58,7 @@ _hivex_recode (hive_h *h, recode_type t, /* Reset errno here because we don't want to accidentally * return E2BIG to a library caller. */ + errno = 0; size_t prev = outalloc; /* Try again with a larger output buffer. */ free (out); -- 2.7.4
2014 Jan 08
5
hivex: Make node names and value names with embedded null characters accessible
On Windows, there exist at least two APIs for dealing with the Registry: The Win32 API (RegCreateKeyA, RegCreateKeyW, etc.) works with null-terminated ASCII or UTF-16 strings. The native API (ZwCreateKey, etc.), on the other hand works with UTF-16 strings that are stored as buffers+length and may contain null characters. Malware authors have been relying on the Win32 API's inability to
2019 Jan 22
0
Re: [PATCH] lib: Reset errno to zero to avoid erroneously returning E2BIG
...lly removed in 77fe74fc, causing > bug #1145056 (Bugzilla) to resurface. > --- > lib/utf16.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/utf16.c b/lib/utf16.c > index e099548..67fa996 100644 > --- a/lib/utf16.c > +++ b/lib/utf16.c > @@ -58,6 +58,7 @@ _hivex_recode (hive_h *h, recode_type t, > /* Reset errno here because we don't want to accidentally > * return E2BIG to a library caller. > */ > + errno = 0; > size_t prev = outalloc; > /* Try again with a larger output buffer. */ > free...
2019 Jan 22
2
Re: [PATCH] lib: Reset errno to zero to avoid erroneously returning E2BIG
...145056 (Bugzilla) to resurface. > > --- > > lib/utf16.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/lib/utf16.c b/lib/utf16.c > > index e099548..67fa996 100644 > > --- a/lib/utf16.c > > +++ b/lib/utf16.c > > @@ -58,6 +58,7 @@ _hivex_recode (hive_h *h, recode_type t, > > /* Reset errno here because we don't want to accidentally > > * return E2BIG to a library caller. > > */ > > + errno = 0; > > size_t prev = outalloc; > > /* Try again with a larger outpu...
2014 Nov 06
3
[PATCH 0/2] hivex: small portability fixes
Hi, this small series cherry-picks a couple of the portability fixes recently done in libguestfs to hivex. There should be no actual change on Linux. Thanks, -- Pino Pino Toscano (2): normalize iconv handling ruby: fix detection of ruby library bootstrap | 1 + configure.ac | 8 +++++++- lib/utf16.c | 3 +-- 3 files changed, 9 insertions(+), 3 deletions(-) -- 1.9.3
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