winedump: Add support for decoding data stored in offset in regf files.

This commit is contained in:
Piotr Caban 2023-08-01 14:00:46 +02:00 committed by Alexandre Julliard
parent 8885aea089
commit b17fed0255

View file

@ -193,6 +193,7 @@ static BOOL dump_subkeys(unsigned int hive_off, unsigned int off)
static BOOL dump_value(unsigned int hive_off, unsigned int off) static BOOL dump_value(unsigned int hive_off, unsigned int off)
{ {
const void *data = NULL; const void *data = NULL;
unsigned int data_size;
const value_key *val; const value_key *val;
const char *name; const char *name;
@ -219,9 +220,15 @@ static BOOL dump_value(unsigned int hive_off, unsigned int off)
printf("@="); printf("@=");
} }
if (val->data_size) data_size = val->data_size;
if (data_size & 0x80000000)
{ {
data = PRD(hive_off + val->data_off + sizeof(unsigned int), val->data_size); data = &val->data_off;
data_size &= ~0x80000000;
}
else if (data_size)
{
data = PRD(hive_off + val->data_off + sizeof(unsigned int), data_size);
if (!data) if (!data)
return FALSE; return FALSE;
} }
@ -230,7 +237,7 @@ static BOOL dump_value(unsigned int hive_off, unsigned int off)
{ {
case REG_SZ: case REG_SZ:
printf("%s", !data ? "" : printf("%s", !data ? "" :
get_unicode_str((const WCHAR *)data, val->data_size / sizeof(WCHAR))); get_unicode_str((const WCHAR *)data, data_size / sizeof(WCHAR)));
break; break;
default: default:
printf("unhandled data type %d", val->data_type); printf("unhandled data type %d", val->data_type);