mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
Fix w32 build
This commit is contained in:
parent
788a7f998d
commit
c7a4b978d1
@ -21,7 +21,7 @@ R_API RAnalSwitchOp * r_anal_switch_op_new(ut64 addr, ut64 min_val, ut64 def_val
|
||||
}
|
||||
|
||||
R_API void r_anal_switch_op_free(RAnalSwitchOp * swop) {
|
||||
if ((((ut64)(size_t)swop)==UT64_MAX) || swop == NULL) return;
|
||||
if (!swop || (((ut32)(size_t)swop)==UT32_MAX)) return;
|
||||
if (swop->cases)
|
||||
r_list_free(swop->cases);
|
||||
free(swop);
|
||||
|
@ -817,7 +817,7 @@ static void free_StringFileInfo(StringFileInfo *stringFileInfo) {
|
||||
|
||||
#define align32(x) x = ((x & 0x3) == 0)? x: (x & ~0x3) + 0x4;
|
||||
|
||||
static void free_VS_VERSIONINFO(VS_VERSIONINFO *vs_VersionInfo) {
|
||||
static void free_VS_VERSIONINFO(PE_VS_VERSIONINFO *vs_VersionInfo) {
|
||||
if (vs_VersionInfo) {
|
||||
free(vs_VersionInfo->szKey);
|
||||
free(vs_VersionInfo->Value);
|
||||
@ -827,7 +827,7 @@ static void free_VS_VERSIONINFO(VS_VERSIONINFO *vs_VersionInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
void PE_(free_VS_VERSIONINFO)(VS_VERSIONINFO *vs_VersionInfo) {
|
||||
void PE_(free_VS_VERSIONINFO)(PE_VS_VERSIONINFO *vs_VersionInfo) {
|
||||
free_VS_VERSIONINFO(vs_VersionInfo);
|
||||
}
|
||||
|
||||
@ -1235,8 +1235,8 @@ static StringFileInfo *Pe_r_bin_pe_parse_string_file_info(struct PE_(r_bin_pe_ob
|
||||
return stringFileInfo;
|
||||
}
|
||||
|
||||
static VS_VERSIONINFO *Pe_r_bin_pe_parse_version_info(struct PE_(r_bin_pe_obj_t)* bin, PE_DWord version_info_paddr) {
|
||||
VS_VERSIONINFO *vs_VersionInfo = calloc (1, sizeof(*vs_VersionInfo));
|
||||
static PE_VS_VERSIONINFO *Pe_r_bin_pe_parse_version_info(struct PE_(r_bin_pe_obj_t)* bin, PE_DWord version_info_paddr) {
|
||||
PE_VS_VERSIONINFO *vs_VersionInfo = calloc (1, sizeof(*vs_VersionInfo));
|
||||
if (vs_VersionInfo == NULL) {
|
||||
eprintf ("Error: calloc (VS_VERSIONINFO)\n");
|
||||
return NULL;
|
||||
@ -1302,12 +1302,12 @@ static VS_VERSIONINFO *Pe_r_bin_pe_parse_version_info(struct PE_(r_bin_pe_obj_t)
|
||||
|
||||
if (vs_VersionInfo->wValueLength) {
|
||||
if (vs_VersionInfo->wValueLength != sizeof(*vs_VersionInfo->Value)) {
|
||||
eprintf ("Error: check (VS_VERSIONINFO wValueLength != sizeof VS_FIXEDFILEINFO)\n");
|
||||
eprintf ("Error: check (VS_VERSIONINFO wValueLength != sizeof PE_VS_FIXEDFILEINFO)\n");
|
||||
free_VS_VERSIONINFO(vs_VersionInfo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
vs_VersionInfo->Value = (VS_FIXEDFILEINFO *) malloc (sizeof(*vs_VersionInfo->Value));
|
||||
vs_VersionInfo->Value = (PE_VS_FIXEDFILEINFO *) malloc (sizeof(*vs_VersionInfo->Value));
|
||||
if (vs_VersionInfo->Value == NULL) {
|
||||
eprintf ("Error: malloc (VS_VERSIONINFO Value)\n");
|
||||
free_VS_VERSIONINFO(vs_VersionInfo);
|
||||
@ -1321,7 +1321,7 @@ static VS_VERSIONINFO *Pe_r_bin_pe_parse_version_info(struct PE_(r_bin_pe_obj_t)
|
||||
}
|
||||
|
||||
if (vs_VersionInfo->Value->dwSignature != 0xFEEF04BD) {
|
||||
eprintf ("Error: check (VS_FIXEDFILEINFO signature)\n");
|
||||
eprintf ("Error: check (PE_VS_FIXEDFILEINFO signature)\n");
|
||||
free_VS_VERSIONINFO(vs_VersionInfo);
|
||||
return NULL;
|
||||
}
|
||||
@ -1471,7 +1471,7 @@ static Sdb *Pe_r_bin_store_string_file_info(StringFileInfo *stringFileInfo) {
|
||||
return sdb;
|
||||
}
|
||||
|
||||
static Sdb *Pe_r_bin_store_fixed_file_info(VS_FIXEDFILEINFO *vs_fixedFileInfo) {
|
||||
static Sdb *Pe_r_bin_store_fixed_file_info(PE_VS_FIXEDFILEINFO *vs_fixedFileInfo) {
|
||||
if (vs_fixedFileInfo == NULL)
|
||||
return NULL;
|
||||
Sdb *sdb = sdb_new0();
|
||||
@ -1493,7 +1493,7 @@ static Sdb *Pe_r_bin_store_fixed_file_info(VS_FIXEDFILEINFO *vs_fixedFileInfo) {
|
||||
return sdb;
|
||||
}
|
||||
|
||||
static Sdb *Pe_r_bin_store_resource_version_info(VS_VERSIONINFO *vs_VersionInfo) {
|
||||
static Sdb *Pe_r_bin_store_resource_version_info(PE_VS_VERSIONINFO *vs_VersionInfo) {
|
||||
if (vs_VersionInfo == NULL)
|
||||
return NULL;
|
||||
Sdb *sdb = sdb_new0();
|
||||
@ -1579,7 +1579,7 @@ void PE_(r_bin_store_all_resource_version_info)(struct PE_(r_bin_pe_obj_t)* bin)
|
||||
continue;
|
||||
}
|
||||
while(cur_paddr < data_paddr + data.Size) {
|
||||
VS_VERSIONINFO *vs_VersionInfo = Pe_r_bin_pe_parse_version_info(bin, cur_paddr);
|
||||
PE_VS_VERSIONINFO *vs_VersionInfo = Pe_r_bin_pe_parse_version_info(bin, cur_paddr);
|
||||
if (vs_VersionInfo) {
|
||||
snprintf(key, 30, "VS_VERSIONINFO%d", counter++);
|
||||
sdb_ns_set (sdb, key, Pe_r_bin_store_resource_version_info(vs_VersionInfo));
|
||||
|
@ -457,56 +457,56 @@ typedef struct {
|
||||
Var **Children; //Typically contains a list of languages that the application or DLL supports.
|
||||
} VarFileInfo;
|
||||
|
||||
#define VS_FF_DEBUG 0x00000001L
|
||||
#define VS_FF_PRERELEASE 0x00000002L
|
||||
#define VS_FF_PATCHED 0x00000004L
|
||||
#define VS_FF_PRIVATEBUILD 0x00000008L
|
||||
#define VS_FF_INFOINFERRED 0x00000010L
|
||||
#define VS_FF_SPECIALBUILD 0x00000020L
|
||||
#define PE_VS_FF_DEBUG 0x00000001L
|
||||
#define PE_VS_FF_PRERELEASE 0x00000002L
|
||||
#define PE_VS_FF_PATCHED 0x00000004L
|
||||
#define PE_VS_FF_PRIVATEBUILD 0x00000008L
|
||||
#define PE_VS_FF_INFOINFERRED 0x00000010L
|
||||
#define PE_VS_FF_SPECIALBUILD 0x00000020L
|
||||
|
||||
#define VOS_DOS 0x00010000L
|
||||
#define VOS_NT 0x00040000L
|
||||
#define VOS__WINDOWS16 0x00000001L
|
||||
#define VOS__WINDOWS32 0x00000004L
|
||||
#define VOS_OS216 0x00020000L
|
||||
#define VOS_OS232 0x00030000L
|
||||
#define VOS__PM16 0x00000002L
|
||||
#define VOS__PM32 0x00000003L
|
||||
#define VOS_UNKNOWN 0x00000000L
|
||||
#define PE_VOS_DOS 0x00010000L
|
||||
#define PE_VOS_NT 0x00040000L
|
||||
#define PE_VOS__WINDOWS16 0x00000001L
|
||||
#define PE_VOS__WINDOWS32 0x00000004L
|
||||
#define PE_VOS_OS216 0x00020000L
|
||||
#define PE_VOS_OS232 0x00030000L
|
||||
#define PE_VOS__PM16 0x00000002L
|
||||
#define PE_VOS__PM32 0x00000003L
|
||||
#define PE_VOS_UNKNOWN 0x00000000L
|
||||
|
||||
#define VOS_DOS_WINDOWS16 0x00010001L
|
||||
#define VOS_DOS_WINDOWS32 0x00010004L
|
||||
#define VOS_NT_WINDOWS32 0x00040004L
|
||||
#define VOS_OS216_PM16 0x00020002L
|
||||
#define VOS_OS232_PM32 0x00030003L
|
||||
#define PE_VOS_DOS_WINDOWS16 0x00010001L
|
||||
#define PE_VOS_DOS_WINDOWS32 0x00010004L
|
||||
#define PE_VOS_NT_WINDOWS32 0x00040004L
|
||||
#define PE_VOS_OS216_PM16 0x00020002L
|
||||
#define PE_VOS_OS232_PM32 0x00030003L
|
||||
|
||||
#define VFT_APP 0x00000001L
|
||||
#define VFT_DLL 0x00000002L
|
||||
#define VFT_DRV 0x00000003L
|
||||
#define VFT_FONT 0x00000004L
|
||||
#define VFT_STATIC_LIB 0x00000007L
|
||||
#define VFT_UNKNOWN 0x00000000L
|
||||
#define VFT_VXD 0x00000005L
|
||||
#define PE_VFT_APP 0x00000001L
|
||||
#define PE_VFT_DLL 0x00000002L
|
||||
#define PE_VFT_DRV 0x00000003L
|
||||
#define PE_VFT_FONT 0x00000004L
|
||||
#define PE_VFT_STATIC_LIB 0x00000007L
|
||||
#define PE_VFT_UNKNOWN 0x00000000L
|
||||
#define PE_VFT_VXD 0x00000005L
|
||||
|
||||
#define VFT2_DRV_COMM 0x0000000AL
|
||||
#define VFT2_DRV_DISPLAY 0x00000004L
|
||||
#define VFT2_DRV_INSTALLABLE 0x00000008L
|
||||
#define VFT2_DRV_KEYBOARD 0x00000002L
|
||||
#define VFT2_DRV_LANGUAGE 0x00000003L
|
||||
#define VFT2_DRV_MOUSE 0x00000005L
|
||||
#define VFT2_DRV_NETWORK 0x00000006L
|
||||
#define VFT2_DRV_PRINTER 0x00000001L
|
||||
#define VFT2_DRV_SOUND 0x00000009L
|
||||
#define VFT2_DRV_SYSTEM 0x00000007L
|
||||
#define VFT2_DRV_VERSIONED_PRINTER 0x0000000CL
|
||||
#define VFT2_UNKNOWN 0x00000000L
|
||||
#define PE_VFT2_DRV_COMM 0x0000000AL
|
||||
#define PE_VFT2_DRV_DISPLAY 0x00000004L
|
||||
#define PE_VFT2_DRV_INSTALLABLE 0x00000008L
|
||||
#define PE_VFT2_DRV_KEYBOARD 0x00000002L
|
||||
#define PE_VFT2_DRV_LANGUAGE 0x00000003L
|
||||
#define PE_VFT2_DRV_MOUSE 0x00000005L
|
||||
#define PE_VFT2_DRV_NETWORK 0x00000006L
|
||||
#define PE_VFT2_DRV_PRINTER 0x00000001L
|
||||
#define PE_VFT2_DRV_SOUND 0x00000009L
|
||||
#define PE_VFT2_DRV_SYSTEM 0x00000007L
|
||||
#define PE_VFT2_DRV_VERSIONED_PRINTER 0x0000000CL
|
||||
#define PE_VFT2_UNKNOWN 0x00000000L
|
||||
|
||||
#define VFT2_FONT_RASTER 0x00000001L
|
||||
#define VFT2_FONT_TRUETYPE 0x00000003L
|
||||
#define VFT2_FONT_VECTOR 0x00000002L
|
||||
#define VFT2_UNKNOWN 0x00000000L
|
||||
#define PE_VFT2_FONT_RASTER 0x00000001L
|
||||
#define PE_VFT2_FONT_TRUETYPE 0x00000003L
|
||||
#define PE_VFT2_FONT_VECTOR 0x00000002L
|
||||
#define PE_VFT2_UNKNOWN 0x00000000L
|
||||
|
||||
typedef struct tagVS_FIXEDFILEINFO {
|
||||
typedef struct {
|
||||
ut32 dwSignature; //Contains the value 0xFEEF04BD
|
||||
ut32 dwStrucVersion;
|
||||
ut32 dwFileVersionMS;
|
||||
@ -520,7 +520,7 @@ typedef struct tagVS_FIXEDFILEINFO {
|
||||
ut32 dwFileSubtype;
|
||||
ut32 dwFileDateMS;
|
||||
ut32 dwFileDateLS;
|
||||
} VS_FIXEDFILEINFO;
|
||||
} PE_VS_FIXEDFILEINFO;
|
||||
|
||||
typedef struct {
|
||||
ut16 wLength; //whole structure size (padding not included (in case of multiply version info structures))
|
||||
@ -528,10 +528,10 @@ typedef struct {
|
||||
ut16 wType; //1 text; 0 binary
|
||||
ut16 *szKey; //L"VS_VERSION_INFO"
|
||||
//ut16 Padding1; //pad for 32 boundary
|
||||
VS_FIXEDFILEINFO *Value;
|
||||
PE_VS_FIXEDFILEINFO *Value;
|
||||
//ut16 Padding2; //pad for 32 boundary
|
||||
VarFileInfo *varFileInfo; //0 or 1 elements
|
||||
StringFileInfo *stringFileInfo; //0 or 1 elements
|
||||
} VS_VERSIONINFO;
|
||||
} PE_VS_VERSIONINFO;
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user