Reverse Engineering EPOCH time

I am trying to reverse engineer some code regarding EPOCH time.

I know the hex input is 0xf1, 0xad, 0x42, 0x55, 0x60, 0x7c, 0x01, 0x00 which is in32_t.

This gives an EPOCH time of 1035480334336

In order to generate live EPOCH time from GPS, it needs to be converted into HEX, so I need to know how the HEX values shown above are being used to give that current static output.

Can any one assist please?

1 Like

HEX is just a human-readable representation of a binary number. Please explain why you think any conversion is needed, and for what particular application.

Its for a simulator. So for parts of the other code, some of the HEX values are actually converted into BIN and then ASCII.

For example, 0x31, 0x39, 0x35, 0x37, 0x34, 0x31 actually equates to 195741, not its normal DEC value.

However, I am struggling to see the correlation between 1035480334336 and the HEX values 0xf1, 0xad, 0x42, 0x55, 0x60, 0x7c, 0x01, 0x00, so was hoping a fresh pair of eyes may see it.

Where did the number 1035480334336 come from?

If that is decimal, it is too large to fit into 32 bits.

0xf1, 0xad, 0x42, 0x55, 0x60, 0x7c, 0x01, 0x00 is 8 bytes, or 64 bits.

0x31, 0x39, 0x35, 0x37, 0x34, 0x31 is 6 bytes, and also won't fit into 32 bits.

Does 1035480334336 fit into 64bits? I'm not too up on my Bits and Bytes.

An int32_t has only 4 bytes. There are 8 such bytes here…

The decimal number you show is 0xF117700000

If that is a decimal number, its HEX representation is F117700000 in "Big Endian" byte order (five bytes).

Play around a bit with this hex-decimal converter to get a feel for these numbers.

Where does your input come from, and why do you believe it represents an epoch time?

https://www.epochconverter.com/

epoch is in seconds. 1035480334336 is far in the future

1 Like

Sorry, I should have clarified, that time is EPOCH time is in ms.

So 1035480334336 = Thu Oct 24 2002 17:25:34

still 1035480334336 is 0xF117700000 which does not match the bytes you shared

could you answer the previous questions?

It is not a HEX, it looks like some character coding
0x31 =1
0x39 =9
0x35 =5
0x37 =7
0x34 =4
0x31 =1
= 195741

it is HEX... (ASCII codes for the chars in hexadecimal) but not the case for 0xf1, 0xad, 0x42, 0x55, 0x60, 0x7c, 0x01, 0x00

1 Like

of course it HEX too :slight_smile:
I meant that it is not a 195741 in HEX representation

pulling your leg :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.