search for: hivex_open_debug

Displaying 13 results from an estimated 13 matches for "hivex_open_debug".

2014 Nov 11
4
[libhivex] Memory leak in hivex_node_delete_child?
[This email is either empty or too large to be displayed at this time]
2017 Jul 11
0
[PATCH] hivexml: Add -u flag for HIVEX_OPEN_UNSAFE
...b/xml/hivexml.c @@ -95,7 +95,7 @@ main (int argc, char *argv[]) int open_flags = 0; int visit_flags = 0; - while ((c = getopt (argc, argv, "dk")) != EOF) { + while ((c = getopt (argc, argv, "dku")) != EOF) { switch (c) { case 'd': open_flags |= HIVEX_OPEN_DEBUG; @@ -103,6 +103,9 @@ main (int argc, char *argv[]) case 'k': visit_flags |= HIVEX_VISIT_SKIP_BAD; break; + case 'u': + open_flags |= HIVEX_OPEN_UNSAFE; + break; default: fprintf (stderr, "hivexml [-dk] regfile > output.xml\n")...
2014 Nov 11
0
Re: [libhivex] Memory leak in hivex_node_delete_child?
...children to not be freed properly? > > I know that if the return value of _hivex_get_children is -1, no free > is called; but from what I can see, -1 means there is nothing to be > freed/it’s been taken care of. > > I’ve attached the valgrind log together with the output of > HIVEX_OPEN_DEBUG, please let me know if there’s anything else I can > provide to make this easier. It seems like rather hivex_node_delete_child leaks the "blocks" array returned by _hivex_get_children every time. The patch should be easy, would you be able to give it a try to check whether it fixes...
2012 Dec 14
3
inspect_os error with Win7 image
The error message: hivex_close: do_hivex_close: you must call 'hivex-open' first to initialize the hivex handle This is the process flow: g = guestfs_create (); guestfs_add_drive_opts (g, diskFile,GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",-1); guestfs_launch (g) char **roots = guestfs_inspect_os (g); guestfs_inspect_os returns NULL, guestfs_last_error(g) returns
2018 Feb 09
3
[PATCH] Add a cache for iconv_t handles to hive_t
.../handle.c @@ -31,6 +31,9 @@ #include <errno.h> #include <assert.h> +#include <iconv.h> +#include <pthread.h> + #ifdef HAVE_MMAP #include <sys/mman.h> #else @@ -62,6 +65,32 @@ header_checksum (const hive_h *h) #define HIVEX_OPEN_MSGLVL_MASK (HIVEX_OPEN_VERBOSE|HIVEX_OPEN_DEBUG) +iconv_t * +_hivex_get_iconv (hive_h *h, recode_type t) +{ + pthread_mutex_lock (&h->iconv_cache[t].mutex); + if (h->iconv_cache[t].handle == NULL) { + if (t == utf8_to_latin1) + h->iconv_cache[t].handle = iconv_open ("LATIN1", "UTF-8"); + else if (t...
2011 Aug 10
1
[PATCH] Report last-modified time of hive root and nodes
...intf (stderr, "filetime_to_8601: Error running gmtime_r on timestamp (decimal hundreds of ns: %" PRIu64 ").\n", windows_ticks); + return -1; + } + strftime(buf, bufsize, "%FT%TZ", &time_tm); + return 0; +} + #define HIVEX_OPEN_MSGLVL_MASK (HIVEX_OPEN_VERBOSE|HIVEX_OPEN_DEBUG) +#define TIMESTAMP_BUF_LEN 32 hive_h * hivex_open (const char *filename, int flags) @@ -359,6 +348,15 @@ hivex_open (const char *filename, int flags) goto error; } + /* Last-modified time. */ + h->last_modified = (char *) calloc(1 + TIMESTAMP_BUF_LEN, sizeof(char)); + int ft_rc...
2018 Feb 09
0
Re: [PATCH] Add a cache for iconv_t handles to hive_t
...sary to check return codes, unless they need to be recursive in which case use gl_recursive_lock_* instead. > #ifdef HAVE_MMAP > #include <sys/mman.h> > #else > @@ -62,6 +65,32 @@ header_checksum (const hive_h *h) > > #define HIVEX_OPEN_MSGLVL_MASK (HIVEX_OPEN_VERBOSE|HIVEX_OPEN_DEBUG) > > +iconv_t * > +_hivex_get_iconv (hive_h *h, recode_type t) > +{ > + pthread_mutex_lock (&h->iconv_cache[t].mutex); > + if (h->iconv_cache[t].handle == NULL) { > + if (t == utf8_to_latin1) > + h->iconv_cache[t].handle = iconv_open ("LATIN1&qu...
2011 Aug 10
1
[Hivex][PATCH v2] Report last-modified time of hive root and nodes
...intf (stderr, "filetime_to_8601: Error running gmtime_r on timestamp (decimal hundreds of ns: %" PRIu64 ").\n", windows_ticks); + return -1; + } + strftime(buf, bufsize, "%FT%TZ", &time_tm); + return 0; +} + #define HIVEX_OPEN_MSGLVL_MASK (HIVEX_OPEN_VERBOSE|HIVEX_OPEN_DEBUG) +#define TIMESTAMP_BUF_LEN 32 hive_h * hivex_open (const char *filename, int flags) @@ -359,6 +388,15 @@ hivex_open (const char *filename, int flags) goto error; } + /* Last-modified time. */ + h->last_modified = (char *) calloc(1 + TIMESTAMP_BUF_LEN, sizeof(char)); + int ft_rc...
2018 Feb 09
2
[PATCH] Add a cache for iconv_t handles to hive_t
...@ #include <sys/stat.h> #include <errno.h> #include <assert.h> +#include <iconv.h> +#include <glthread/lock.h> #ifdef HAVE_MMAP #include <sys/mman.h> @@ -62,6 +64,32 @@ header_checksum (const hive_h *h) #define HIVEX_OPEN_MSGLVL_MASK (HIVEX_OPEN_VERBOSE|HIVEX_OPEN_DEBUG) +iconv_t * +_hivex_get_iconv (hive_h *h, recode_type t) +{ + glthread_lock_lock (&h->iconv_cache[t].mutex); + if (h->iconv_cache[t].handle == NULL) { + if (t == utf8_to_latin1) + h->iconv_cache[t].handle = iconv_open ("LATIN1", "UTF-8"); + else if (t...
2017 Feb 16
6
[PATCH v4 0/5] hivex: handle corrupted hives better.
The following patches address issues when dealing with hives that have corrupted data in them but are otherwise readable/writable. Those were found on some rather rare Windows installations that seem to work fine but current hivex fails to even open. Those patches change hivex to simply log and ignore such "corrupted" regions instead of aborting because the caller might be looking at
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...strncasecmp((a),(b),(n)) != 0) +#define STRPREFIX(a,b) (strncmp((a),(b),strlen((b))) == 0) + #endif /* GUESTFSD_DAEMON_H */ diff --git a/hivex/hivex.h b/hivex/hivex.h index 14bdcc5..be7feee 100644 --- a/hivex/hivex.h +++ b/hivex/hivex.h @@ -73,6 +73,16 @@ typedef enum hive_type hive_type; #define HIVEX_OPEN_DEBUG 2 #define HIVEX_OPEN_MSGLVL_MASK 3 +#define STREQ(a,b) (strcmp((a),(b)) == 0) +#define STRCASEEQ(a,b) (strcasecmp((a),(b)) == 0) +#define STRNEQ(a,b) (strcmp((a),(b)) != 0) +#define STRCASENEQ(a,b) (strcasecmp((a),(b)) != 0) +#define STREQLEN(a,b,n) (strncmp((a),(b),(n)) == 0) +#define ST...
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 Jul 25
19
[PATCH hivex 00/19] Fix read/write handling of li-records.
This is, hopefully, a full fix for handling of li-records. See: https://bugzilla.redhat.com/show_bug.cgi?id=717583 https://bugzilla.redhat.com/show_bug.cgi?id=987463 Rich.