Describe the bugDate/time stamp: line from the readpe output contains garbage / invalid values.
For example:
Date/time stamp: 1682449479 (Sun, 24 Feb 39791743 13:21:11 UTC)
Despite that timestamp stored in PE binary is just 32-bit number, year 39791743 is behind 32-bit limit.
This happens for 64-bit builds of readpe.
To Reproduce
Please provide us with:
pev version - latest master b0e8df06de08284f8eaf5fa43f21df64bd3e04df
OS version - Debian 10 64-bit
The file(s) you've analysed with pev - simple return 0 compiled by gcc int main() { return 0; }
The command you've used with the files, with all the flags - readpe a.exe
Expected behavior
readpe prints timestamp correctly. Not year 39791743.
Screenshots
Additional context
The issue is in timestamp processing. time_t type is 64-bit on 64-bit system but TimeDateStamp is always 32-bit. So casting TimeDateStamp pointer to time_t pointer cause reading garbage data.
Describe the bug
Date/time stamp:
line from thereadpe
output contains garbage / invalid values.For example:
Despite that timestamp stored in PE binary is just 32-bit number, year 39791743 is behind 32-bit limit.
This happens for 64-bit builds of
readpe
.To Reproduce Please provide us with:
int main() { return 0; }
Expected behavior readpe prints timestamp correctly. Not year 39791743.
Screenshots
Additional context The issue is in timestamp processing.
time_t
type is 64-bit on 64-bit system butTimeDateStamp
is always 32-bit. So casting TimeDateStamp pointer to time_t pointer cause reading garbage data.Simple fix for this issue: