Commit 8207bdfe authored by Alexandre Julliard's avatar Alexandre Julliard

winedump: Add dumping of sortkey NLS files.

parent 602f2082
......@@ -207,6 +207,34 @@ const char* get_guid_str(const GUID* guid)
return str;
}
const char *get_unicode_str( const WCHAR *str, int len )
{
char *buffer;
int i = 0;
if (len == -1) len = strlenW( str );
buffer = dump_want_n( len * 6 + 3);
buffer[i++] = '"';
while (len-- > 0 && *str)
{
WCHAR c = *str++;
switch (c)
{
case '\n': strcpy( buffer + i, "\\n" ); i += 2; break;
case '\r': strcpy( buffer + i, "\\r" ); i += 2; break;
case '\t': strcpy( buffer + i, "\\t" ); i += 2; break;
case '"': strcpy( buffer + i, "\\\"" ); i += 2; break;
case '\\': strcpy( buffer + i, "\\\\" ); i += 2; break;
default:
if (c >= ' ' && c <= 126) buffer[i++] = c;
else i += sprintf( buffer + i, "\\u%04x",c);
}
}
buffer[i++] = '"';
buffer[i] = 0;
return buffer;
}
const void* PRD(unsigned long prd, unsigned long len)
{
return (prd + len > dump_total_len) ? NULL : (const char*)dump_base + prd;
......
......@@ -229,6 +229,7 @@ const char* get_time_str( unsigned long );
unsigned int strlenW( const unsigned short *str );
void dump_unicode_str( const unsigned short *str, int len );
const char* get_guid_str(const GUID* guid);
const char* get_unicode_str( const WCHAR *str, int len );
const char* get_symbol_str(const char* symname);
void print_fake_dll(void);
void dump_file_header(const IMAGE_FILE_HEADER *);
......
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