Пример #1
0
 private void SetTimeStamp(DateTime dateTime, int timeOffset)
 {
     EnsureDataBlock();
     byte[] timeStampBytes = GetTimeStampBytes(dateTime);
     byte[] rawFileTimes   = HeaderCrypto.Decrypt(GetDataBlockBytesReference());
     Array.Copy(timeStampBytes, 0, rawFileTimes, timeOffset, timeStampBytes.Length);
     SetDataBlockBytesReference(HeaderCrypto.Encrypt(rawFileTimes));
 }
Пример #2
0
        private DateTime GetTimeStamp(int timeOffset)
        {
            EnsureDataBlock();
            byte[] rawFileTimes = HeaderCrypto.Decrypt(GetDataBlockBytesReference());
            uint   lowDateTime  = (uint)rawFileTimes.GetLittleEndianValue(timeOffset, 4);
            uint   hiDateTime   = (uint)rawFileTimes.GetLittleEndianValue(timeOffset + 4, 4);
            long   filetime     = ((long)hiDateTime << 32) | lowDateTime;

            DateTime timeStampUtc = new DateTime(WindowsTimeTicksStart + filetime, DateTimeKind.Utc);

            return(timeStampUtc);
        }