Locale/language bug fix in pe module
A change introduced in commit
silently broke language check due to integer size and signedness.
Tested using pe.language(0x04) on file
@@ -2448,7 +2448,7 @@ define_function(locale)
for (i = 0; i < n; i++)
{
uint64_t rsrc_language = get_integer(
- module, "resources[%" PRId64 "].language", i);
+ module, "resources[%" PRIi32 "].language", (int32_t)i);
if ((rsrc_language & 0xFFFF) == locale)
return_integer(1);
@@ -2479,7 +2479,7 @@ define_function(language)
for (i = 0; i < n; i++)
{
uint64_t rsrc_language = get_integer(
- module, "resources[%" PRId64 "].language", i);
+ module, "resources[%" PRIi32 "].language", (int32_t)i);
if ((rsrc_language & 0xFF) == language)
return_integer(1);
