search for: timestamp_buf_len

Displaying 4 results from an estimated 4 matches for "timestamp_buf_len".

2011 Oct 13
1
[hivex][PATCH] Increase filetime printing resolution to sub-second
...windows_ticks) char *ret; time_t t; struct tm *tm; + int64_t sub_seconds; + size_t ftd; /* # chars formatted so far. */ if (windows_ticks == 0LL) return NULL; @@ -194,16 +196,28 @@ filetime_to_8601 (int64_t windows_ticks) if (tm == NULL) return NULL; - ret = malloc (TIMESTAMP_BUF_LEN); + sub_seconds = windows_ticks % WINDOWS_TICK; + /* Trim trailing zeroes from fractional part. */ + while (sub_seconds % 10 == 0 && sub_seconds > 0) { + sub_seconds /= 10; + } + + ret = calloc (TIMESTAMP_BUF_LEN, sizeof (char)); if (ret == NULL) { - perror ("malloc&qu...
2011 Aug 13
2
[Hivex] [PATCH v3] Report last-modified time of hive root and nodes
...imitations with .Net's DateTime."; + "node_children", (RNodeList, [AHive; ANode "node"]), "return children of node", "\ @@ -708,6 +725,9 @@ typedef size_t hive_value_h; # define HIVEX_NO_KEY ENOENT #endif +#include <time.h> +#define TIMESTAMP_BUF_LEN 32 + /* Pre-defined types. */ enum hive_type { "; diff --git a/lib/hivex.c b/lib/hivex.c index fedbb6c..1e77831 100644 --- a/lib/hivex.c +++ b/lib/hivex.c @@ -93,6 +93,7 @@ struct hive_h { /* Fields from the header, extracted from little-endianness hell. */ size_t rootoffs;...
2011 Aug 10
1
[PATCH] Report last-modified time of hive root and nodes
...e_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 = filetime_to_8601(h->la...
2011 Aug 10
1
[Hivex][PATCH v2] Report last-modified time of hive root and nodes
...e_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 = filetime_to_8601(h->la...