aaOpenSource / aaLog

A library and example programs for reading the standard SMC log file format
MIT License
13 stars 15 forks source link

Odd 7 minute time shift #5

Closed arobinsongit closed 9 years ago

arobinsongit commented 9 years ago

For some, yet unknown, reason sometimes when the end up with an odd offset in the filetime of 4320550992. This translates to about 7 minutes and 12.055 seconds. The value is very oddly close to the value of a 32 bit integer but not quite.

Here is what the bit pattern looks like when you compare the value of 2^32 to this value of the offset.

image

If someone has a clue help out please. The biggest issue is that it only happens sometimes. By sometimes I mean during one debug session I have the offset. During other sessions it is dead on.

arobinsongit commented 9 years ago

Correction provided by Fabrizio Pattoneri: Need to integrate into code

     private long GetFileTimeFromByteArray(byte[] byteArray, long startingOffset)
    {

        long lDt;
        uint low = BitConverter.ToUInt32(byteArray, (int)startingOffset);
        uint high= BitConverter.ToUInt32(byteArray, checked((int)startingOffset + 4));

        unchecked
        {

            lDt = (((long)high) << 32) | low;

        }

        return lDt;
    }

Thanks Fabrizio