winedump: Avoid using DWORD in private definitions.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2022-04-22 16:33:11 +02:00
parent e1e6d18a61
commit af54377eb6
8 changed files with 171 additions and 178 deletions

View File

@ -73,7 +73,7 @@ typedef struct
typedef struct typedef struct
{ {
SHORT dfVersion; /* Version */ SHORT dfVersion; /* Version */
LONG dfSize; /* Total File Size */ int dfSize; /* Total File Size */
char dfCopyright[60]; /* Copyright notice */ char dfCopyright[60]; /* Copyright notice */
FONTINFO16 fi; /* FONTINFO structure */ FONTINFO16 fi; /* FONTINFO structure */
} WINFNT; } WINFNT;

View File

@ -38,9 +38,9 @@ static inline USHORT ushort_bswap(USHORT s)
return (s >> 8) | (s << 8); return (s >> 8) | (s << 8);
} }
static inline ULONG ulong_bswap(ULONG l) static inline UINT ulong_bswap(UINT l)
{ {
return ((ULONG)ushort_bswap((USHORT)l) << 16) | ushort_bswap((USHORT)(l >> 16)); return ((UINT)ushort_bswap((USHORT)l) << 16) | ushort_bswap(l >> 16);
} }
static void dump_import_object(const IMPORT_OBJECT_HEADER *ioh) static void dump_import_object(const IMPORT_OBJECT_HEADER *ioh)
@ -192,9 +192,9 @@ void lib_dump(void)
} }
else if (!strncmp((const char *)iamh->Name, IMAGE_ARCHIVE_LINKER_MEMBER, sizeof(iamh->Name))) else if (!strncmp((const char *)iamh->Name, IMAGE_ARCHIVE_LINKER_MEMBER, sizeof(iamh->Name)))
{ {
const DWORD *offset = (const DWORD *)ioh; const UINT *offset = (const UINT *)ioh;
const char *name; const char *name;
DWORD i, count; UINT i, count;
if (first_linker_member) /* 1st archive linker member, BE format */ if (first_linker_member) /* 1st archive linker member, BE format */
{ {

View File

@ -64,85 +64,85 @@ typedef enum {
typedef struct tagDATABLOCKHEADER typedef struct tagDATABLOCKHEADER
{ {
DWORD cbSize; UINT cbSize;
DWORD dwSignature; UINT dwSignature;
} DATABLOCK_HEADER; } DATABLOCK_HEADER;
typedef struct _LINK_HEADER typedef struct _LINK_HEADER
{ {
DWORD dwSize; /* 0x00 size of the header - 0x4c */ UINT dwSize; /* 0x00 size of the header - 0x4c */
GUID MagicGuid; /* 0x04 is CLSID_ShellLink */ GUID MagicGuid; /* 0x04 is CLSID_ShellLink */
DWORD dwFlags; /* 0x14 describes elements following */ UINT dwFlags; /* 0x14 describes elements following */
DWORD dwFileAttr; /* 0x18 attributes of the target file */ UINT dwFileAttr; /* 0x18 attributes of the target file */
FILETIME Time1; /* 0x1c */ FILETIME Time1; /* 0x1c */
FILETIME Time2; /* 0x24 */ FILETIME Time2; /* 0x24 */
FILETIME Time3; /* 0x2c */ FILETIME Time3; /* 0x2c */
DWORD dwFileLength; /* 0x34 File length */ UINT dwFileLength; /* 0x34 File length */
DWORD nIcon; /* 0x38 icon number */ UINT nIcon; /* 0x38 icon number */
DWORD fStartup; /* 0x3c startup type */ UINT fStartup; /* 0x3c startup type */
DWORD wHotKey; /* 0x40 hotkey */ UINT wHotKey; /* 0x40 hotkey */
DWORD Unknown5; /* 0x44 */ UINT Unknown5; /* 0x44 */
DWORD Unknown6; /* 0x48 */ UINT Unknown6; /* 0x48 */
} LINK_HEADER, * PLINK_HEADER; } LINK_HEADER, * PLINK_HEADER;
typedef struct tagLINK_SZ_BLOCK typedef struct tagLINK_SZ_BLOCK
{ {
DWORD size; UINT size;
DWORD magic; UINT magic;
CHAR bufA[MAX_PATH]; CHAR bufA[MAX_PATH];
WCHAR bufW[MAX_PATH]; WCHAR bufW[MAX_PATH];
} LINK_SZ_BLOCK; } LINK_SZ_BLOCK;
typedef struct tagLINK_PROPERTYSTORAGE_GUID typedef struct tagLINK_PROPERTYSTORAGE_GUID
{ {
DWORD size; UINT size;
DWORD magic; UINT magic;
GUID fmtid; GUID fmtid;
} LINK_PROPERTYSTORAGE_GUID; } LINK_PROPERTYSTORAGE_GUID;
typedef struct tagLINK_PROPERTYSTORAGE_VALUE typedef struct tagLINK_PROPERTYSTORAGE_VALUE
{ {
DWORD size; UINT size;
DWORD pid; UINT pid;
BYTE unknown8; BYTE unknown8;
DWORD vt; UINT vt;
DWORD unknown25; UINT unknown25;
} LINK_PROPERTYSTORAGE_VALUE; } LINK_PROPERTYSTORAGE_VALUE;
typedef struct _LOCATION_INFO typedef struct _LOCATION_INFO
{ {
DWORD dwTotalSize; UINT dwTotalSize;
DWORD dwHeaderSize; UINT dwHeaderSize;
DWORD dwFlags; UINT dwFlags;
DWORD dwVolTableOfs; UINT dwVolTableOfs;
DWORD dwLocalPathOfs; UINT dwLocalPathOfs;
DWORD dwNetworkVolTableOfs; UINT dwNetworkVolTableOfs;
DWORD dwFinalPathOfs; UINT dwFinalPathOfs;
} LOCATION_INFO; } LOCATION_INFO;
typedef struct _LOCAL_VOLUME_INFO typedef struct _LOCAL_VOLUME_INFO
{ {
DWORD dwSize; UINT dwSize;
DWORD dwType; UINT dwType;
DWORD dwVolSerial; UINT dwVolSerial;
DWORD dwVolLabelOfs; UINT dwVolLabelOfs;
} LOCAL_VOLUME_INFO; } LOCAL_VOLUME_INFO;
typedef struct _NETWORK_VOLUME_INFO typedef struct _NETWORK_VOLUME_INFO
{ {
DWORD dwSize; UINT dwSize;
DWORD dwUnknown1; UINT dwUnknown1;
DWORD dwShareNameOfs; UINT dwShareNameOfs;
DWORD dwReserved; UINT dwReserved;
DWORD dwUnknown2; UINT dwUnknown2;
} NETWORK_VOLUME_INFO; } NETWORK_VOLUME_INFO;
typedef struct typedef struct
{ {
DWORD cbSize; UINT cbSize;
DWORD dwSignature; UINT dwSignature;
DWORD idSpecialFolder; UINT idSpecialFolder;
DWORD cbOffset; UINT cbOffset;
} EXP_SPECIAL_FOLDER; } EXP_SPECIAL_FOLDER;
typedef struct lnk_string_tag typedef struct lnk_string_tag
@ -529,7 +529,7 @@ void lnk_dump(void)
{ {
const LINK_HEADER* hdr; const LINK_HEADER* hdr;
const DATABLOCK_HEADER* bhdr; const DATABLOCK_HEADER* bhdr;
DWORD dwFlags; UINT dwFlags;
offset = 0; offset = 0;
hdr = fetch_block(); hdr = fetch_block();

View File

@ -1750,7 +1750,7 @@ BOOL codeview_dump_symbols(const void* root, unsigned long start, unsigned long
pname = PSTRING(sym, length); pname = PSTRING(sym, length);
length += (pname->namelen + 1 + 3) & ~3; length += (pname->namelen + 1 + 3) & ~3;
printf("%08x %08x %08x '%s'\n", printf("%08x %08x %08x '%s'\n",
*(((const DWORD*)sym) + 1), *(((const DWORD*)sym) + 2), *(((const DWORD*)sym) + 3), ((const UINT *)sym)[1], ((const UINT *)sym)[2], ((const UINT *)sym)[3],
p_string(pname)); p_string(pname));
} }
break; break;
@ -2125,7 +2125,7 @@ void codeview_dump_linetab2(const char* linetab, DWORD size, const char* strimag
} }
break; break;
default: default:
printf("%sUnknown signature %x in INLINEELINES subsection\n", pfx, *(DWORD*)CV_RECORD_AFTER(hdr)); printf("%sUnknown signature %x in INLINEELINES subsection\n", pfx, *(UINT *)CV_RECORD_AFTER(hdr));
break; break;
} }
break; break;

View File

@ -472,11 +472,11 @@ static void dump_norm(void)
struct sortguid struct sortguid
{ {
GUID id; /* sort GUID */ GUID id; /* sort GUID */
DWORD flags; /* flags */ UINT flags; /* flags */
DWORD compr; /* offset to compression table */ UINT compr; /* offset to compression table */
DWORD except; /* exception table offset in sortkey table */ UINT except; /* exception table offset in sortkey table */
DWORD ling_except; /* exception table offset for linguistic casing */ UINT ling_except; /* exception table offset for linguistic casing */
DWORD casemap; /* linguistic casemap table offset */ UINT casemap; /* linguistic casemap table offset */
}; };
#define FLAG_HAS_3_BYTE_WEIGHTS 0x01 #define FLAG_HAS_3_BYTE_WEIGHTS 0x01
@ -486,13 +486,13 @@ struct sortguid
struct language_id struct language_id
{ {
DWORD offset; UINT offset;
WCHAR name[32]; WCHAR name[32];
}; };
struct compression struct compression
{ {
DWORD offset; UINT offset;
WCHAR minchar, maxchar; WCHAR minchar, maxchar;
WORD len[8]; WORD len[8];
}; };
@ -503,7 +503,7 @@ struct comprlang
WCHAR name[32]; WCHAR name[32];
}; };
static const char *get_sortkey( DWORD key ) static const char *get_sortkey( UINT key )
{ {
static char buffer[16]; static char buffer[16];
if (!key) return "...."; if (!key) return "....";
@ -514,9 +514,9 @@ static const char *get_sortkey( DWORD key )
return buffer; return buffer;
} }
static const void *dump_expansions( const DWORD *ptr ) static const void *dump_expansions( const UINT *ptr )
{ {
DWORD i, count = *ptr++; UINT i, count = *ptr++;
printf( "\nExpansions: (count=%04x)\n\n", count ); printf( "\nExpansions: (count=%04x)\n\n", count );
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
@ -527,10 +527,10 @@ static const void *dump_expansions( const DWORD *ptr )
return ptr + count; return ptr + count;
} }
static void dump_exceptions( const DWORD *sortkeys, DWORD offset ) static void dump_exceptions( const UINT *sortkeys, DWORD offset )
{ {
int i, j; int i, j;
const DWORD *table = sortkeys + offset; const UINT *table = sortkeys + offset;
for (i = 0; i < 0x100; i++) for (i = 0; i < 0x100; i++)
{ {
@ -566,9 +566,9 @@ static const void *dump_compression( const struct compression *compr, const WCHA
return p; return p;
} }
static const void *dump_multiple_weights( const DWORD *ptr ) static const void *dump_multiple_weights( const UINT *ptr )
{ {
int i, count = *ptr++; UINT i, count = *ptr++;
const WCHAR *p; const WCHAR *p;
printf( "\nMultiple weights: (count=%u)\n\n", count ); printf( "\nMultiple weights: (count=%u)\n\n", count );
@ -586,10 +586,10 @@ static void dump_sort( int old_version )
{ {
const struct const struct
{ {
DWORD sortkeys; UINT sortkeys;
DWORD casemaps; UINT casemaps;
DWORD ctypes; UINT ctypes;
DWORD sortids; UINT sortids;
} *header; } *header;
const struct compression *compr; const struct compression *compr;
@ -597,7 +597,7 @@ static void dump_sort( int old_version )
const struct comprlang *comprlangs; const struct comprlang *comprlangs;
const struct language_id *language_ids = NULL; const struct language_id *language_ids = NULL;
const WORD *casemaps, *map; const WORD *casemaps, *map;
const DWORD *sortkeys, *ptr; const UINT *sortkeys, *ptr;
const WCHAR *p = NULL; const WCHAR *p = NULL;
int i, j, size, len; int i, j, size, len;
int nb_casemaps = 0, casemap_offsets[16]; int nb_casemaps = 0, casemap_offsets[16];
@ -618,7 +618,7 @@ static void dump_sort( int old_version )
len = 0; len = 0;
if (old_version) if (old_version)
{ {
ptr = (const DWORD *)casemaps; ptr = (const UINT *)casemaps;
len = *ptr++; len = *ptr++;
language_ids = (const struct language_id *)ptr; language_ids = (const struct language_id *)ptr;
casemaps = (const WORD *)(language_ids + len); casemaps = (const WORD *)(language_ids + len);
@ -732,7 +732,7 @@ static void dump_sort( int old_version )
guids[i].flags, guids[i].compr, j < nb_casemaps ? j : -1 ); guids[i].flags, guids[i].compr, j < nb_casemaps ? j : -1 );
} }
ptr = dump_expansions( (const DWORD *)(guids + guid_count) ); ptr = dump_expansions( (const UINT *)(guids + guid_count) );
size = *ptr++; size = *ptr++;
printf( "\nCompressions:\n" ); printf( "\nCompressions:\n" );

View File

@ -134,9 +134,8 @@ static DWORD pdb_get_file_size(const struct pdb_reader* reader, unsigned idx)
static void pdb_exit(struct pdb_reader* reader) static void pdb_exit(struct pdb_reader* reader)
{ {
unsigned i; unsigned i, size;
unsigned char* file; unsigned char* file;
DWORD size;
for (i = 0; i < pdb_get_num_files(reader); i++) for (i = 0; i < pdb_get_num_files(reader); i++)
{ {
@ -218,8 +217,8 @@ static void *read_string_table(struct pdb_reader* reader)
if (stream_idx == -1) return NULL; if (stream_idx == -1) return NULL;
ret = reader->read_file(reader, stream_idx); ret = reader->read_file(reader, stream_idx);
if (!ret) return NULL; if (!ret) return NULL;
if(*(const DWORD*)ret == 0xeffeeffe) return ret; if(*(const UINT *)ret == 0xeffeeffe) return ret;
printf("wrong header %x expecting 0xeffeeffe\n", *(const DWORD*)ret); printf("wrong header %x expecting 0xeffeeffe\n", *(const UINT *)ret);
free( ret ); free( ret );
return NULL; return NULL;
} }
@ -766,14 +765,14 @@ static void pdb_dump_segments(struct pdb_reader* reader, unsigned stream_idx)
{ {
printf("Segment %s\n", ptr); printf("Segment %s\n", ptr);
ptr += (strlen(ptr) + 1 + 3) & ~3; ptr += (strlen(ptr) + 1 + 3) & ~3;
printf("\tdword[0]: %08x\n", *(DWORD*)ptr); ptr += 4; printf("\tdword[0]: %08x\n", *(UINT *)ptr); ptr += 4;
printf("\tdword[1]: %08x\n", *(DWORD*)ptr); ptr += 4; printf("\tdword[1]: %08x\n", *(UINT *)ptr); ptr += 4;
printf("\tdword[2]: %08x\n", *(DWORD*)ptr); ptr += 4; printf("\tdword[2]: %08x\n", *(UINT *)ptr); ptr += 4;
printf("\tdword[3]: %08x\n", *(DWORD*)ptr); ptr += 4; printf("\tdword[3]: %08x\n", *(UINT *)ptr); ptr += 4;
printf("\tdword[4]: %08x\n", *(DWORD*)ptr); ptr += 4; printf("\tdword[4]: %08x\n", *(UINT *)ptr); ptr += 4;
printf("\tdword[5]: %08x\n", *(DWORD*)ptr); ptr += 4; printf("\tdword[5]: %08x\n", *(UINT *)ptr); ptr += 4;
printf("\tdword[6]: %08x\n", *(DWORD*)ptr); ptr += 4; printf("\tdword[6]: %08x\n", *(UINT *)ptr); ptr += 4;
printf("\tdword[7]: %08x\n", *(DWORD*)ptr); ptr += 4; printf("\tdword[7]: %08x\n", *(UINT *)ptr); ptr += 4;
} }
free((char*)segs); free((char*)segs);
} else printf("nosdfsdffd\n"); } else printf("nosdfsdffd\n");
@ -804,10 +803,8 @@ static void pdb_jg_dump(void)
reader.u.jg.root = reader.read_file(&reader, 1); reader.u.jg.root = reader.read_file(&reader, 1);
if (reader.u.jg.root) if (reader.u.jg.root)
{ {
DWORD* pdw; UINT *pdw, *ok_bits;
DWORD* ok_bits; UINT i, numok, count;
DWORD numok, count;
unsigned i;
PDB_STREAM_INDEXES sidx; PDB_STREAM_INDEXES sidx;
printf("Root:\n" printf("Root:\n"
@ -820,7 +817,7 @@ static void pdb_jg_dump(void)
reader.u.jg.root->Age, reader.u.jg.root->Age,
(unsigned)reader.u.jg.root->cbNames); (unsigned)reader.u.jg.root->cbNames);
pdw = (DWORD*)(reader.u.jg.root->names + reader.u.jg.root->cbNames); pdw = (UINT *)(reader.u.jg.root->names + reader.u.jg.root->cbNames);
numok = *pdw++; numok = *pdw++;
count = *pdw++; count = *pdw++;
printf("\tStreams directory:\n" printf("\tStreams directory:\n"
@ -842,7 +839,7 @@ static void pdb_jg_dump(void)
{ {
if (ok_bits[i / 32] & (1 << (i % 32))) if (ok_bits[i / 32] & (1 << (i % 32)))
{ {
DWORD string_idx, stream_idx; UINT string_idx, stream_idx;
string_idx = *pdw++; string_idx = *pdw++;
stream_idx = *pdw++; stream_idx = *pdw++;
printf("\t\t\t%2d) %-20s => %x\n", i, &reader.u.jg.root->names[string_idx], stream_idx); printf("\t\t\t%2d) %-20s => %x\n", i, &reader.u.jg.root->names[string_idx], stream_idx);
@ -873,7 +870,7 @@ static void pdb_jg_dump(void)
pdb_exit(&reader); pdb_exit(&reader);
} }
static void* pdb_ds_read(const struct PDB_DS_HEADER* header, const DWORD* block_list, int size) static void* pdb_ds_read(const struct PDB_DS_HEADER* header, const UINT *block_list, int size)
{ {
int i, nBlocks; int i, nBlocks;
BYTE* buffer; BYTE* buffer;
@ -892,8 +889,8 @@ static void* pdb_ds_read(const struct PDB_DS_HEADER* header, const DWORD* block_
static void* pdb_ds_read_file(struct pdb_reader* reader, DWORD file_number) static void* pdb_ds_read_file(struct pdb_reader* reader, DWORD file_number)
{ {
const DWORD* block_list; const UINT *block_list;
DWORD i; UINT i;
if (!reader->u.ds.toc || file_number >= reader->u.ds.toc->num_files) return NULL; if (!reader->u.ds.toc || file_number >= reader->u.ds.toc->num_files) return NULL;
@ -914,8 +911,8 @@ static BOOL pdb_ds_init(struct pdb_reader* reader)
reader->u.ds.header = PRD(0, sizeof(*reader->u.ds.header)); reader->u.ds.header = PRD(0, sizeof(*reader->u.ds.header));
if (!reader->u.ds.header) return FALSE; if (!reader->u.ds.header) return FALSE;
reader->read_file = pdb_ds_read_file; reader->read_file = pdb_ds_read_file;
reader->u.ds.toc = pdb_ds_read(reader->u.ds.header, reader->u.ds.toc = pdb_ds_read(reader->u.ds.header,
(const DWORD*)((const char*)reader->u.ds.header + reader->u.ds.header->toc_page * reader->u.ds.header->block_size), (const UINT *)((const char*)reader->u.ds.header + reader->u.ds.header->toc_page * reader->u.ds.header->block_size),
reader->u.ds.header->toc_size); reader->u.ds.header->toc_size);
memset(reader->file_used, 0, sizeof(reader->file_used)); memset(reader->file_used, 0, sizeof(reader->file_used));
return TRUE; return TRUE;
@ -963,10 +960,8 @@ static void pdb_ds_dump(void)
reader.u.ds.root = reader.read_file(&reader, 1); reader.u.ds.root = reader.read_file(&reader, 1);
if (reader.u.ds.root) if (reader.u.ds.root)
{ {
DWORD* pdw; UINT *pdw, *ok_bits;
DWORD* ok_bits; UINT i, numok, count;
DWORD numok, count;
unsigned i;
PDB_STREAM_INDEXES sidx; PDB_STREAM_INDEXES sidx;
printf("Root:\n" printf("Root:\n"
@ -980,7 +975,7 @@ static void pdb_ds_dump(void)
reader.u.ds.root->Age, reader.u.ds.root->Age,
get_guid_str(&reader.u.ds.root->guid), get_guid_str(&reader.u.ds.root->guid),
reader.u.ds.root->cbNames); reader.u.ds.root->cbNames);
pdw = (DWORD*)(reader.u.ds.root->names + reader.u.ds.root->cbNames); pdw = (UINT *)(reader.u.ds.root->names + reader.u.ds.root->cbNames);
numok = *pdw++; numok = *pdw++;
count = *pdw++; count = *pdw++;
printf("\tStreams directory:\n" printf("\tStreams directory:\n"
@ -1002,7 +997,7 @@ static void pdb_ds_dump(void)
{ {
if (ok_bits[i / 32] & (1 << (i % 32))) if (ok_bits[i / 32] & (1 << (i % 32)))
{ {
DWORD string_idx, stream_idx; UINT string_idx, stream_idx;
string_idx = *pdw++; string_idx = *pdw++;
stream_idx = *pdw++; stream_idx = *pdw++;
printf("\t\t\t%2d) %-20s => %x\n", i, &reader.u.ds.root->names[string_idx], stream_idx); printf("\t\t\t%2d) %-20s => %x\n", i, &reader.u.ds.root->names[string_idx], stream_idx);

View File

@ -161,7 +161,7 @@ static inline void print_word(const char *title, WORD value)
printf(" %-34s 0x%-4X %u\n", title, value, value); printf(" %-34s 0x%-4X %u\n", title, value, value);
} }
static inline void print_dword(const char *title, DWORD value) static inline void print_dword(const char *title, UINT value)
{ {
printf(" %-34s 0x%-8x %u\n", title, value, value); printf(" %-34s 0x%-8x %u\n", title, value, value);
} }
@ -600,11 +600,10 @@ static void dump_dir_exported_functions(void)
{ {
unsigned int size = 0; unsigned int size = 0;
const IMAGE_EXPORT_DIRECTORY*exportDir = get_dir_and_size(IMAGE_FILE_EXPORT_DIRECTORY, &size); const IMAGE_EXPORT_DIRECTORY*exportDir = get_dir_and_size(IMAGE_FILE_EXPORT_DIRECTORY, &size);
unsigned int i; UINT i, *funcs;
const DWORD* pFunc; const UINT *pFunc;
const DWORD* pName; const UINT *pName;
const WORD* pOrdl; const WORD *pOrdl;
DWORD* funcs;
if (!exportDir) return; if (!exportDir) return;
@ -656,45 +655,45 @@ static void dump_dir_exported_functions(void)
struct runtime_function_x86_64 struct runtime_function_x86_64
{ {
DWORD BeginAddress; UINT BeginAddress;
DWORD EndAddress; UINT EndAddress;
DWORD UnwindData; UINT UnwindData;
}; };
struct runtime_function_armnt struct runtime_function_armnt
{ {
DWORD BeginAddress; UINT BeginAddress;
union { union {
DWORD UnwindData; UINT UnwindData;
struct { struct {
DWORD Flag : 2; UINT Flag : 2;
DWORD FunctionLength : 11; UINT FunctionLength : 11;
DWORD Ret : 2; UINT Ret : 2;
DWORD H : 1; UINT H : 1;
DWORD Reg : 3; UINT Reg : 3;
DWORD R : 1; UINT R : 1;
DWORD L : 1; UINT L : 1;
DWORD C : 1; UINT C : 1;
DWORD StackAdjust : 10; UINT StackAdjust : 10;
} DUMMYSTRUCTNAME; } DUMMYSTRUCTNAME;
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
}; };
struct runtime_function_arm64 struct runtime_function_arm64
{ {
DWORD BeginAddress; UINT BeginAddress;
union union
{ {
DWORD UnwindData; UINT UnwindData;
struct struct
{ {
DWORD Flag : 2; UINT Flag : 2;
DWORD FunctionLength : 11; UINT FunctionLength : 11;
DWORD RegF : 3; UINT RegF : 3;
DWORD RegI : 4; UINT RegI : 4;
DWORD H : 1; UINT H : 1;
DWORD CR : 2; UINT CR : 2;
DWORD FrameSize : 9; UINT FrameSize : 9;
} DUMMYSTRUCTNAME; } DUMMYSTRUCTNAME;
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
}; };
@ -702,7 +701,7 @@ struct runtime_function_arm64
union handler_data union handler_data
{ {
struct runtime_function_x86_64 chain; struct runtime_function_x86_64 chain;
DWORD handler; UINT handler;
}; };
struct opcode struct opcode
@ -726,13 +725,13 @@ struct unwind_info_x86_64
struct unwind_info_armnt struct unwind_info_armnt
{ {
DWORD function_length : 18; UINT function_length : 18;
DWORD version : 2; UINT version : 2;
DWORD x : 1; UINT x : 1;
DWORD e : 1; UINT e : 1;
DWORD f : 1; UINT f : 1;
DWORD count : 5; UINT count : 5;
DWORD words : 4; UINT words : 4;
}; };
struct unwind_info_ext_armnt struct unwind_info_ext_armnt
@ -744,10 +743,10 @@ struct unwind_info_ext_armnt
struct unwind_info_epilogue_armnt struct unwind_info_epilogue_armnt
{ {
DWORD offset : 18; UINT offset : 18;
DWORD res : 2; UINT res : 2;
DWORD cond : 4; UINT cond : 4;
DWORD index : 8; UINT index : 8;
}; };
#define UWOP_PUSH_NONVOL 0 #define UWOP_PUSH_NONVOL 0
@ -810,7 +809,7 @@ static void dump_x86_64_unwind_info( const struct runtime_function_x86_64 *funct
case UWOP_ALLOC_LARGE: case UWOP_ALLOC_LARGE:
if (info->opcodes[i].info) if (info->opcodes[i].info)
{ {
count = *(const DWORD *)&info->opcodes[i+1]; count = *(const UINT *)&info->opcodes[i+1];
i += 2; i += 2;
} }
else else
@ -834,7 +833,7 @@ static void dump_x86_64_unwind_info( const struct runtime_function_x86_64 *funct
i++; i++;
break; break;
case UWOP_SAVE_NONVOL_FAR: case UWOP_SAVE_NONVOL_FAR:
count = *(const DWORD *)&info->opcodes[i+1]; count = *(const UINT *)&info->opcodes[i+1];
printf( "mov %%%s,0x%x(%%rsp)\n", reg_names[info->opcodes[i].info], count ); printf( "mov %%%s,0x%x(%%rsp)\n", reg_names[info->opcodes[i].info], count );
i += 2; i += 2;
break; break;
@ -844,7 +843,7 @@ static void dump_x86_64_unwind_info( const struct runtime_function_x86_64 *funct
i++; i++;
break; break;
case UWOP_SAVE_XMM128_FAR: case UWOP_SAVE_XMM128_FAR:
count = *(const DWORD *)&info->opcodes[i+1]; count = *(const UINT *)&info->opcodes[i+1];
printf( "movaps %%xmm%u,0x%x(%%rsp)\n", info->opcodes[i].info, count ); printf( "movaps %%xmm%u,0x%x(%%rsp)\n", info->opcodes[i].info, count );
i += 2; i += 2;
break; break;
@ -866,7 +865,7 @@ static void dump_x86_64_unwind_info( const struct runtime_function_x86_64 *funct
} }
if (info->flags & (UNW_FLAG_EHANDLER | UNW_FLAG_UHANDLER)) if (info->flags & (UNW_FLAG_EHANDLER | UNW_FLAG_UHANDLER))
printf( " handler %08x data at %08x\n", handler_data->handler, printf( " handler %08x data at %08x\n", handler_data->handler,
(ULONG)(function->UnwindData + (const char *)(&handler_data->handler + 1) - (const char *)info )); (UINT)(function->UnwindData + (const char *)(&handler_data->handler + 1) - (const char *)info ));
} }
static const BYTE armnt_code_lengths[256] = static const BYTE armnt_code_lengths[256] =
@ -1281,12 +1280,12 @@ static void dump_armnt_unwind_info( const struct runtime_function_armnt *fnc )
struct unwind_info_arm64 struct unwind_info_arm64
{ {
DWORD function_length : 18; UINT function_length : 18;
DWORD version : 2; UINT version : 2;
DWORD x : 1; UINT x : 1;
DWORD e : 1; UINT e : 1;
DWORD epilog : 5; UINT epilog : 5;
DWORD codes : 5; UINT codes : 5;
}; };
struct unwind_info_ext_arm64 struct unwind_info_ext_arm64
@ -1298,9 +1297,9 @@ struct unwind_info_ext_arm64
struct unwind_info_epilog_arm64 struct unwind_info_epilog_arm64
{ {
DWORD offset : 18; UINT offset : 18;
DWORD res : 4; UINT res : 4;
DWORD index : 10; UINT index : 10;
}; };
static const BYTE code_lengths[256] = static const BYTE code_lengths[256] =
@ -1601,7 +1600,7 @@ static void dump_arm64_unwind_info( const struct runtime_function_arm64 *func )
rva += codes * 4; rva += codes * 4;
if (info->x) if (info->x)
{ {
const DWORD *handler = RVA( rva, sizeof(*handler) ); const UINT *handler = RVA( rva, sizeof(*handler) );
rva += sizeof(*handler); rva += sizeof(*handler);
printf( " handler: %08x data %08x\n", *handler, rva ); printf( " handler: %08x data %08x\n", *handler, rva );
} }
@ -1641,14 +1640,14 @@ static void dump_dir_exceptions(void)
} }
static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il, DWORD thunk_rva) static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il, UINT thunk_rva)
{ {
/* FIXME: This does not properly handle large images */ /* FIXME: This does not properly handle large images */
const IMAGE_IMPORT_BY_NAME* iibn; const IMAGE_IMPORT_BY_NAME* iibn;
for (; il->u1.Ordinal; il++, thunk_rva += sizeof(LONGLONG)) for (; il->u1.Ordinal; il++, thunk_rva += sizeof(LONGLONG))
{ {
if (IMAGE_SNAP_BY_ORDINAL64(il->u1.Ordinal)) if (IMAGE_SNAP_BY_ORDINAL64(il->u1.Ordinal))
printf(" %08x %4u <by ordinal>\n", thunk_rva, (DWORD)IMAGE_ORDINAL64(il->u1.Ordinal)); printf(" %08x %4u <by ordinal>\n", thunk_rva, (UINT)IMAGE_ORDINAL64(il->u1.Ordinal));
else else
{ {
iibn = RVA((DWORD)il->u1.AddressOfData, sizeof(DWORD)); iibn = RVA((DWORD)il->u1.AddressOfData, sizeof(DWORD));
@ -1660,10 +1659,10 @@ static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il, DWORD thunk_rv
} }
} }
static void dump_image_thunk_data32(const IMAGE_THUNK_DATA32 *il, int offset, DWORD thunk_rva) static void dump_image_thunk_data32(const IMAGE_THUNK_DATA32 *il, int offset, UINT thunk_rva)
{ {
const IMAGE_IMPORT_BY_NAME* iibn; const IMAGE_IMPORT_BY_NAME* iibn;
for (; il->u1.Ordinal; il++, thunk_rva += sizeof(DWORD)) for (; il->u1.Ordinal; il++, thunk_rva += sizeof(UINT))
{ {
if (IMAGE_SNAP_BY_ORDINAL32(il->u1.Ordinal)) if (IMAGE_SNAP_BY_ORDINAL32(il->u1.Ordinal))
printf(" %08x %4u <by ordinal>\n", thunk_rva, IMAGE_ORDINAL32(il->u1.Ordinal)); printf(" %08x %4u <by ordinal>\n", thunk_rva, IMAGE_ORDINAL32(il->u1.Ordinal));
@ -1694,11 +1693,11 @@ static void dump_dir_imported_functions(void)
if (!importDesc->Name || !importDesc->FirstThunk) break; if (!importDesc->Name || !importDesc->FirstThunk) break;
printf(" offset %08lx %s\n", Offset(importDesc), (const char*)RVA(importDesc->Name, sizeof(DWORD))); printf(" offset %08lx %s\n", Offset(importDesc), (const char*)RVA(importDesc->Name, sizeof(DWORD)));
printf(" Hint/Name Table: %08X\n", (DWORD)importDesc->u.OriginalFirstThunk); printf(" Hint/Name Table: %08X\n", (UINT)importDesc->u.OriginalFirstThunk);
printf(" TimeDateStamp: %08X (%s)\n", printf(" TimeDateStamp: %08X (%s)\n",
importDesc->TimeDateStamp, get_time_str(importDesc->TimeDateStamp)); importDesc->TimeDateStamp, get_time_str(importDesc->TimeDateStamp));
printf(" ForwarderChain: %08X\n", importDesc->ForwarderChain); printf(" ForwarderChain: %08X\n", importDesc->ForwarderChain);
printf(" First thunk RVA: %08X\n", (DWORD)importDesc->FirstThunk); printf(" First thunk RVA: %08X\n", (UINT)importDesc->FirstThunk);
printf(" Thunk Ordn Name\n"); printf(" Thunk Ordn Name\n");
@ -1893,7 +1892,7 @@ static void dump_dir_debug(void)
printf("\n"); printf("\n");
} }
static inline void print_clrflags(const char *title, DWORD value) static inline void print_clrflags(const char *title, UINT value)
{ {
printf(" %-34s 0x%X\n", title, value); printf(" %-34s 0x%X\n", title, value);
#define X(f,s) if (value & f) printf(" %s\n", s) #define X(f,s) if (value & f) printf(" %s\n", s)
@ -1983,7 +1982,7 @@ static void dump_dir_reloc(void)
static void dump_dir_tls(void) static void dump_dir_tls(void)
{ {
IMAGE_TLS_DIRECTORY64 dir; IMAGE_TLS_DIRECTORY64 dir;
const DWORD *callbacks; const UINT *callbacks;
const IMAGE_TLS_DIRECTORY32 *pdir = get_dir(IMAGE_FILE_THREAD_LOCAL_STORAGE); const IMAGE_TLS_DIRECTORY32 *pdir = get_dir(IMAGE_FILE_THREAD_LOCAL_STORAGE);
if (!pdir) return; if (!pdir) return;
@ -2003,19 +2002,19 @@ static void dump_dir_tls(void)
/* FIXME: This does not properly handle large images */ /* FIXME: This does not properly handle large images */
printf( "Thread Local Storage\n" ); printf( "Thread Local Storage\n" );
printf( " Raw data %08x-%08x (data size %x zero fill size %x)\n", printf( " Raw data %08x-%08x (data size %x zero fill size %x)\n",
(DWORD)dir.StartAddressOfRawData, (DWORD)dir.EndAddressOfRawData, (UINT)dir.StartAddressOfRawData, (UINT)dir.EndAddressOfRawData,
(DWORD)(dir.EndAddressOfRawData - dir.StartAddressOfRawData), (UINT)(dir.EndAddressOfRawData - dir.StartAddressOfRawData),
(DWORD)dir.SizeOfZeroFill ); (UINT)dir.SizeOfZeroFill );
printf( " Index address %08x\n", (DWORD)dir.AddressOfIndex ); printf( " Index address %08x\n", (UINT)dir.AddressOfIndex );
printf( " Characteristics %08x\n", dir.Characteristics ); printf( " Characteristics %08x\n", (UINT)dir.Characteristics );
printf( " Callbacks %08x -> {", (DWORD)dir.AddressOfCallBacks ); printf( " Callbacks %08x -> {", (UINT)dir.AddressOfCallBacks );
if (dir.AddressOfCallBacks) if (dir.AddressOfCallBacks)
{ {
DWORD addr = (DWORD)dir.AddressOfCallBacks - PE_nt_headers->OptionalHeader.ImageBase; UINT addr = (UINT)dir.AddressOfCallBacks - PE_nt_headers->OptionalHeader.ImageBase;
while ((callbacks = RVA(addr, sizeof(DWORD))) && *callbacks) while ((callbacks = RVA(addr, sizeof(UINT))) && *callbacks)
{ {
printf( " %08x", *callbacks ); printf( " %08x", *callbacks );
addr += sizeof(DWORD); addr += sizeof(UINT);
} }
} }
printf(" }\n\n"); printf(" }\n\n");
@ -2487,12 +2486,11 @@ static void dll_close (void)
static void do_grab_sym( void ) static void do_grab_sym( void )
{ {
const IMAGE_EXPORT_DIRECTORY*exportDir; const IMAGE_EXPORT_DIRECTORY*exportDir;
unsigned i, j; UINT i, j, *map;
const DWORD* pName; const UINT *pName;
const DWORD* pFunc; const UINT *pFunc;
const WORD* pOrdl; const WORD *pOrdl;
const char* ptr; const char *ptr;
DWORD* map;
PE_nt_headers = get_nt_header(); PE_nt_headers = get_nt_header();
if (!(exportDir = get_dir(IMAGE_FILE_EXPORT_DIRECTORY))) return; if (!(exportDir = get_dir(IMAGE_FILE_EXPORT_DIRECTORY))) return;

View File

@ -1171,7 +1171,7 @@ static const char *lookup_code(const BYTE *table, DWORD table_size, struct bitst
return NULL; return NULL;
} }
static const char *decode_string(const BYTE *table, const char *stream, DWORD stream_length, DWORD *read_bytes) static const char *decode_string(const BYTE *table, const char *stream, UINT stream_length, UINT *read_bytes)
{ {
char *buf; char *buf;
DWORD buf_size, table_size; DWORD buf_size, table_size;
@ -1655,7 +1655,7 @@ static void dump_type(int len, const char *hlp_strings)
if (value != -1) if (value != -1)
{ {
const char *str; const char *str;
DWORD hlpstr_maxlen; UINT hlpstr_maxlen;
printf("helpstring offset = %#x (+%#x=%#x)\n", printf("helpstring offset = %#x (+%#x=%#x)\n",
value, vars_start_offset, value + vars_start_offset); value, vars_start_offset, value + vars_start_offset);
@ -1761,7 +1761,7 @@ static void dump_type(int len, const char *hlp_strings)
if (value != -1) if (value != -1)
{ {
const char *str; const char *str;
DWORD hlpstr_maxlen; UINT hlpstr_maxlen;
printf("helpstring offset = %#x (+%#x=%#x)\n", printf("helpstring offset = %#x (+%#x=%#x)\n",
value, funcs_start_offset, value + funcs_start_offset); value, funcs_start_offset, value + funcs_start_offset);