Commit 3c2d6128 authored by Alexandre Julliard's avatar Alexandre Julliard

winedump: Dump registry scripts resources as text.

parent da387a9b
......@@ -3025,7 +3025,7 @@ static void dump_version_data( const void *ptr, unsigned int size, const char *p
}
/* dump data for a HTML/MANIFEST resource */
static void dump_xml_data( const void *ptr, unsigned int size, const char *prefix )
static void dump_text_data( const void *ptr, unsigned int size, const char *prefix )
{
const char *p = ptr, *end = p + size;
......@@ -3038,6 +3038,18 @@ static void dump_xml_data( const void *ptr, unsigned int size, const char *prefi
}
}
static int cmp_resource_name( const IMAGE_RESOURCE_DIR_STRING_U *str_res, const char *str )
{
unsigned int i;
for (i = 0; i < str_res->Length; i++)
{
int res = str_res->NameString[i] - (WCHAR)str[i];
if (res || !str[i]) return res;
}
return -(WCHAR)str[i];
}
static void dump_dir_resource(void)
{
const IMAGE_RESOURCE_DIRECTORY *root = get_dir(IMAGE_FILE_RESOURCE_DIRECTORY);
......@@ -3090,6 +3102,10 @@ static void dump_dir_resource(void)
data = (const IMAGE_RESOURCE_DATA_ENTRY *)((const char *)root + e3->OffsetToData);
if (e1->NameIsString)
{
string = (const IMAGE_RESOURCE_DIR_STRING_U*)((const char *)root + e1->NameOffset);
if (!cmp_resource_name( string, "WINE_REGISTRY" ))
dump_text_data( RVA( data->OffsetToData, data->Size ), data->Size, " | " );
else
dump_data( RVA( data->OffsetToData, data->Size ), data->Size, " " );
}
else switch(e1->Id)
......@@ -3105,7 +3121,7 @@ static void dump_dir_resource(void)
break;
case 23: /* RT_HTML */
case 24: /* RT_MANIFEST */
dump_xml_data( RVA( data->OffsetToData, data->Size ), data->Size, " | " );
dump_text_data( RVA( data->OffsetToData, data->Size ), data->Size, " | " );
break;
default:
dump_data( RVA( data->OffsetToData, data->Size ), data->Size, " " );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment