myuponey jpg
(92.5 KB, 600x470)
>>/9883/
> What am I doing wrong here?
Messed up due to endianness. users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.html example:
> File modification time 0x7d1c = 0111110100011100
> second = 01111101000(11100) = 28 = 56 seconds [Bits 00-04]
> minute = 01111(101000)11100 = 40 [Bits 05-10]
> hour = (01111)10100011100 = 15 [Bits 11-15]
> 15:40:56
> File modification date 0x354b = 0011010101001011
> day = 00110101010(01011) = 11 [Bits 00-04]
> month = 0011010(1010)01011 = 10 [Bits 05-08]
> year = (0011010)101001011 = 26 [Bits 09-15]
> 2006-10-11
So, normal byte order on hex, "reverse" on binary:
> $ echo bd92 | xxd -p -r - | xxd -b -
> 00000000: 10111101 10010010
> $ echo 40fa | xxd -p -r - | xxd -b -
> 00000000: 01000000 11111010
Decode:
. seconds = 10111101100(10010) = 36 (18*2)
. minute = 10111(101100)10010 = 44
. hours = (10111)10110010010 = 23
. day = 01000000111(11010) = 26
. month = 0100000(0111)11010 = 7
. year = (0100000)011111010 = 2012 (1980+32)
which is
. 2012-07-26 23:44:36
Similar to diff. timestamp in HTTP:
> 2012-07-26 22:44:36.000000000 +0000
Image from
https://web.archive.org/web/20231002080524/https://unmeiwokowasu.pagesperso-orange.fr/original/stories/myuponey.html