Displaying 2 results from an estimated 2 matches for "hivex_major_version".
2011 Dec 13
1
[hivex] [PATCH 1/2] hivex: Expose hive major and minor version
...*/
uint32_t unknown6; /* 1 */
uint32_t offset; /* offset of root key record - 4KB */
@@ -303,7 +303,7 @@ hivex_open (const char *filename, int flags)
}
/* Check major version. */
- uint32_t major_ver = le32toh (h->hdr->major_ver);
+ int32_t major_ver = hivex_major_version (h);
if (major_ver != 1) {
fprintf (stderr,
"hivex: %s: hive file major version %" PRIu32 " (expected 1)\n",
@@ -312,6 +312,16 @@ hivex_open (const char *filename, int flags)
goto error;
}
+ /* Check minor version; if unable to decode, terminate....
2011 Dec 13
1
[hivex] [PATCH 2/2] hivex: Expose embedded hive file name
...9 100644
--- a/lib/hivex.c
+++ b/lib/hivex.c
@@ -634,6 +634,12 @@ hivex_last_modified (hive_h *h)
return timestamp_check (h, 0, h->last_modified);
}
+char *
+hivex_name (hive_h *h)
+{
+ return (h && h->hdr) ? windows_utf16_to_utf8 (h->hdr->name, 64) : NULL;
+}
+
int32_t
hivex_major_version (hive_h *h)
{
diff --git a/xml/hivexml.c b/xml/hivexml.c
index 3a4d9b7..059da56 100644
--- a/xml/hivexml.c
+++ b/xml/hivexml.c
@@ -160,6 +160,15 @@ main (int argc, char *argv[])
}
}
+ char *hive_name = hivex_name (h);
+ if (hive_name) {
+ XML_CHECK (xmlTextWriterStartAttribute, (wri...