search for: xml_check

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

2012 Mar 31
2
[PATCH v6] hivexml: Add byte run reporting functions
...errno = 0; + size_t node_struct_length = hivex_node_struct_length (h, node); + if (errno) { + if (errno == EINVAL) { + fprintf (stderr, "node_byte_runs: Invoked on what does not seem to be a node (%zu).\n", node); + } + return -1; + } + /* A node has one byte run. */ + XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "byte_runs")); + XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "byte_run")); + memset (buf, 0, 1+BYTE_RUN_BUF_LEN); + snprintf (buf, 1+BYTE_RUN_BUF_LEN, "%zu", node); + XML_CHECK (xmlTextWriterWriteAttribute,...
2011 Sep 17
3
[PATCH 1/1] hivexml: Base64-encode non-printable data
...int ret = 0; + char *encoding_to_use = NULL; + if (attr_name && attr_data && attr_encoding) { + xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; + encoding_to_use = encoding_recommendation (attr_data); + + if (strcmp (encoding_to_use, "none") == 0) + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST attr_name, BAD_CAST attr_data)); + else if (strcmp (encoding_to_use, "base64") == 0) { + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST attr_encoding, BAD_CAST "base64")); + XML_CHECK (xmlTextWriterStartAttr...
2011 Dec 08
1
[hivex] [PATCH 8/8] hivexml: Add byte run reporting functions
...errno = 0; + size_t node_struct_length = hivex_node_struct_length (h, node); + if (errno) { + if (errno == EINVAL) { + fprintf (stderr, "node_byte_runs: Invoked on what does not seem to be a node (%zu).\n", node); + } + return -1; + } + /* A node has one byte run. */ + XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "byte_runs")); + XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "byte_run")); + memset (buf, 0, 1+BYTE_RUN_BUF_LEN); + snprintf (buf, 1+BYTE_RUN_BUF_LEN, "%d", node); + XML_CHECK (xmlTextWriterWriteAttribute, (...
2011 Sep 02
1
[PATCH 6/7] hivexml: Report attributes in values instead of text.
...ivexml.c index f29c80c..4789dbc 100644 --- a/xml/hivexml.c +++ b/xml/hivexml.c @@ -199,6 +199,7 @@ node_start (hive_h *h, void *writer_v, hive_node_h node, const char *name) { int64_t last_modified; char *timebuf; + int ret = 0; xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "node")); @@ -278,7 +279,9 @@ value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value, } start_value (writer, key, type, NULL); - XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST str)); + XML_CHECK (xmlTex...
2012 Feb 01
1
[PATCH] hivexml
...pos += charlen; > + charlen = len - pos; > + } > + return 1; > +} > + > +static int > node_start (hive_h *h, void *writer_v, hive_node_h node, const char *name) > { > int64_t last_modified; > @@ -265,6 +282,20 @@ end_value (xmlTextWriterPtr writer) > XML_CHECK (xmlTextWriterEndElement, (writer)); > } > > +static void > +start_string(xmlTextWriterPtr writer, const char *encoding) > +{ > + XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "string")); > + if (encoding) > + XML_CHECK (xmlTextWriterWriteAttribute...
2011 Dec 13
1
[hivex] [PATCH 1/1] hivexml: Change value type output to standard names
...ar *key, const char *type, const char *encoding) @@ -294,7 +320,7 @@ value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value, type = "unknown"; } - start_value (writer, key, type, NULL); + start_value (writer, key, value_type_windows_string (t), NULL); XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value")); XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST str)); XML_CHECK (xmlTextWriterEndAttribute, (writer)); @@ -308,7 +334,7 @@ value_multiple_strings (hive_h *h, void *writer_v, hive_node_h node,...
2011 Aug 31
1
[PATCH] hivex: Add byte runs for nodes and values
...N_BUF_LEN]; + size_t node_struct_length = hivex_node_struct_length (h, node); + if (errno) { + if (errno == EINVAL) { + fprintf (stderr, "node_byte_runs: Invoked on what does not seem to be a node (%zu).\n", node); + } + return -1; + } + /* A node has one byte run. */ + XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "byte_runs")); + XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "byte_run")); + memset (buf, 0, 1+BYTE_RUN_BUF_LEN); + snprintf (buf, 1+BYTE_RUN_BUF_LEN, "%d", node); + XML_CHECK (xmlTextWriterWriteAttribute, (...
2011 Aug 13
2
[Hivex] [PATCH v3] Report last-modified time of hive root and nodes
...kept sorted. If you just add a diff --git a/xml/hivexml.c b/xml/hivexml.c index 90cb22b..c68a3d2 100644 --- a/xml/hivexml.c +++ b/xml/hivexml.c @@ -64,6 +64,8 @@ static struct hivex_visitor visitor = { .value_other = value_other }; +char * filetime_to_8601 (int64_t windows_ticks); + #define XML_CHECK(proc, args) \ do { \ if ((proc args) == -1) { \ @@ -124,6 +126,20 @@ main (int argc, char *argv[]) XML_CHECK (xmlTextWriterStartDocument,...
2011 Dec 13
1
[hivex] [PATCH 1/2] hivex: Expose hive major and minor version
...h->hdr) ? (int32_t) le32toh (h->hdr->minor_ver) : -1; +} + int64_t hivex_node_timestamp (hive_h *h, hive_node_h node) { diff --git a/xml/hivexml.c b/xml/hivexml.c index d38e9d4..3a4d9b7 100644 --- a/xml/hivexml.c +++ b/xml/hivexml.c @@ -136,6 +136,30 @@ main (int argc, char *argv[]) XML_CHECK (xmlTextWriterStartDocument, (writer, NULL, "utf-8", NULL)); XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "hive")); + /* Report the version. */ + int32_t hive_major_version = hivex_major_version (h); + int32_t hive_minor_version = hivex_minor_version (h); + i...
2011 Aug 10
1
[PATCH] Report last-modified time of hive root and nodes
...g (hive_h *, void *, hive_node_h, hive_value_h, hive_type t, size_t len, const char *key, const char *str); static int value_multiple_strings (hive_h *, void *, hive_node_h, hive_value_h, hive_type t, size_t len, const char *key, char **argv); @@ -123,6 +123,8 @@ main (int argc, char *argv[]) XML_CHECK (xmlTextWriterStartDocument, (writer, NULL, "utf-8", NULL)); XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "hive")); + if (h->last_modified) + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST "mtime", BAD_CAST (h->last_modified)));...
2011 Aug 16
1
[PATCH] hivexml: Add root attribute to the root node
...u> --- xml/hivexml.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/xml/hivexml.c b/xml/hivexml.c index 2967ac9..f29c80c 100644 --- a/xml/hivexml.c +++ b/xml/hivexml.c @@ -204,6 +204,10 @@ node_start (hive_h *h, void *writer_v, hive_node_h node, const char *name) XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "node")); XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST "name", BAD_CAST name)); + if (node == hivex_root (h)) { + XML_CHECK (xmlTextWriterWriteAttribute, (writer, BAD_CAST "root", BAD_CAST "1&quot...
2011 Dec 13
1
[hivex] [PATCH 2/2] hivex: Expose embedded hive file name
...) : 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, (writer, BAD_CAST "name")); + XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST hive_name)); + XML_CHECK (xmlTextWriterEndAttribute, (writer)); + free (hive_name); + hive_name = NULL; + } + int64_t hive_mtime = hivex_last_modified (h);...
2011 Aug 10
1
[Hivex][PATCH v2] Report last-modified time of hive root and nodes
...tor visitor = { .node_start = node_start, @@ -61,7 +62,8 @@ static struct hivex_visitor visitor = { .value_qword = value_qword, .value_binary = value_binary, .value_none = value_none, - .value_other = value_other + .value_other = value_other, + .node_mtime = node_mtime }; #define XML_CHECK(proc, args) \ @@ -142,6 +144,20 @@ main (int argc, char *argv[]) } static int +node_mtime (hive_h *h, void *writer_v, hive_node_h node, const char *last_modified) +{ + if (!last_modified) { + fprintf(stderr, "node_mtime: last_modified came acr...
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...memory. There @@ -105,7 +105,7 @@ main (int argc, char *argv[]) writer = xmlNewTextWriterFilename ("/dev/stdout", 0); if (writer == NULL) { fprintf (stderr, "xmlNewTextWriterFilename: failed to create XML writer\n"); - exit (1); + exit (EXIT_FAILURE); } XML_CHECK (xmlTextWriterStartDocument, (writer, NULL, "utf-8", NULL)); @@ -113,19 +113,19 @@ main (int argc, char *argv[]) if (hivex_visit (h, &visitor, sizeof visitor, writer, visit_flags) == -1) { perror (argv[optind]); - exit (1); + exit (EXIT_FAILURE); } if (hivex_clos...