I’m reading a binary file using perl. In the file’s headers, there’s 4 bytes that represents MS-DOS time. How do I read this time? I’m not familiar with this format.
I’ve found this for reference: http://www.vsft.com/hal/dostime.htm but I’m still not sure how to read it.
Another approach:
This will work if
$msdos_timeis represented in little-endian format which (I believe) is how it would be laid out in memory.(Clearly the chained
map-s could be coalesced – I wrote it this way to make it easier to see what was going on.)Example: