timestamps
Tool
tools/formats/timestamps.py(program, Formats). Decode a number as every common kind of timestamp, or find timestamps inside a file.
Run it with ./gameframe run timestamps ARGS or python3 tools/formats/timestamps.py. Source on GitHub.
Its own help
This is the help text in the tool itself, as ./gameframe tool timestamps prints it.
text
Decode a number as every common kind of timestamp, or find timestamps inside a file.
Usage: timestamps.py VALUE a number (decimal, or hex with 0x), every reading
timestamps.py --bytes HEX raw bytes, read little-endian and big-endian
timestamps.py --scan FILE [--from YEAR] [--to YEAR] [--kinds K,K] [--max N]
Kinds:
unix seconds since 1970-01-01 (C time_t; also the PE header's TimeDateStamp)
unix-ms milliseconds since 1970
dos a FAT date and time packed in 32 bits: date in the high word, time in the low
word (directory entries, ZIP headers, INT 21h AX=5700h), 2-second steps
dos-swap the same with the words the other way round
filetime Windows FILETIME: 100-nanosecond steps since 1601-01-01
hfs Mac OS classic: seconds since 1904-01-01 (local time)
ole an OLE automation date: a double, days since 1899-12-30 (Visual Basic, Excel)
cocoa seconds since 2001-01-01 (later Mac and iOS games)
A save game usually records when it was saved, and the executable records when it was
linked. Finding these fields helps to decode a save format (one field fewer to explain, and
a known value to check against), and to date a release. --scan reads every offset, so most
readings are noise: keep the year range narrow (the game's release years), and trust a hit
when a second save, written later, has a later value at the same offset. Standard library only.Named by
Skills: re-format.