Module: wine Branch: master Commit: f76d8ba6c611188015b169b0d64040155d0ecd06 URL: https://gitlab.winehq.org/wine/wine/-/commit/f76d8ba6c611188015b169b0d640401...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Jun 9 11:08:02 2023 +0200
winedump: Dump manifest resources in a more structured way.
---
tools/winedump/pe.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 82ecf12d910..fbcd9f5c6a5 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -2667,7 +2667,7 @@ static const char *get_resource_type( unsigned int id ) "ANICURSOR", "ANIICON", "HTML", - "RT_MANIFEST" + "MANIFEST" };
if ((size_t)id < ARRAY_SIZE(types)) return types[id]; @@ -2944,6 +2944,20 @@ static void dump_version_data( const void *ptr, unsigned int size, const char *p dump_version_children( info, prefix, 0 ); }
+/* dump data for a HTML/MANIFEST resource */ +static void dump_xml_data( const void *ptr, unsigned int size, const char *prefix ) +{ + const char *p = ptr, *end = p + size; + + while (p < end) + { + const char *start = p; + while (p < end && *p != '\r' && *p != '\n') p++; + printf( "%s%.*s\n", prefix, (int)(p - start), start ); + while (p < end && (*p == '\r' || *p == '\n')) p++; + } +} + static void dump_dir_resource(void) { const IMAGE_RESOURCE_DIRECTORY *root = get_dir(IMAGE_FILE_RESOURCE_DIRECTORY); @@ -3009,6 +3023,10 @@ static void dump_dir_resource(void) case 16: /* RT_VERSION */ dump_version_data( RVA( data->OffsetToData, data->Size ), data->Size, " | " ); break; + case 23: /* RT_HTML */ + case 24: /* RT_MANIFEST */ + dump_xml_data( RVA( data->OffsetToData, data->Size ), data->Size, " | " ); + break; default: dump_data( RVA( data->OffsetToData, data->Size ), data->Size, " " ); break;