ReadLELong() public method

Read a long in little endian byte order.
public ReadLELong ( ) : long
return long
        /// <summary>
        /// Set the data from the raw values provided.
        /// </summary>
        /// <param name="data">The raw data to extract values from.</param>
        /// <param name="index">The index to start extracting values from.</param>
        /// <param name="count">The number of bytes available.</param>
        public void SetData(byte[] data, int index, int count)
        {
            using (MemoryStream ms = new MemoryStream(data, index, count, false))
                using (ZipHelperStream helperStream = new ZipHelperStream(ms))
                {
                    helperStream.ReadLEInt();             // Reserved
                    while (helperStream.Position < helperStream.Length)
                    {
                        int ntfsTag    = helperStream.ReadLEShort();
                        int ntfsLength = helperStream.ReadLEShort();
                        if (ntfsTag == 1)
                        {
                            if (ntfsLength >= 24)
                            {
                                long lastModificationTicks = helperStream.ReadLELong();
                                _lastModificationTime = DateTime.FromFileTime(lastModificationTicks);

                                long lastAccessTicks = helperStream.ReadLELong();
                                _lastAccessTime = DateTime.FromFileTime(lastAccessTicks);

                                long createTimeTicks = helperStream.ReadLELong();
                                _createTime = DateTime.FromFileTime(createTimeTicks);
                            }
                            break;
                        }
                        else
                        {
                            // An unknown NTFS tag so simply skip it.
                            helperStream.Seek(ntfsLength, SeekOrigin.Current);
                        }
                    }
                }
        }
Exemplo n.º 2
0
 public void SetData(byte[] data, int index, int count)
 {
     using (MemoryStream memoryStream = new MemoryStream(data, index, count, false))
     {
         using (ZipHelperStream zipHelperStream = new ZipHelperStream(memoryStream))
         {
             zipHelperStream.ReadLEInt();
             while (zipHelperStream.Position < zipHelperStream.Length)
             {
                 int num  = zipHelperStream.ReadLEShort();
                 int num2 = zipHelperStream.ReadLEShort();
                 if (num == 1)
                 {
                     if (num2 >= 24)
                     {
                         long fileTime = zipHelperStream.ReadLELong();
                         this._lastModificationTime = DateTime.FromFileTime(fileTime);
                         long fileTime2 = zipHelperStream.ReadLELong();
                         this._lastAccessTime = DateTime.FromFileTime(fileTime2);
                         long fileTime3 = zipHelperStream.ReadLELong();
                         this._createTime = DateTime.FromFileTime(fileTime3);
                     }
                     break;
                 }
                 zipHelperStream.Seek((long)num2, SeekOrigin.Current);
             }
         }
     }
 }
Exemplo n.º 3
0
 public void SetData(byte[] data, int index, int count)
 {
     using (MemoryStream stream = new MemoryStream(data, index, count, writable: false))
     {
         using (ZipHelperStream zipHelperStream = new ZipHelperStream(stream))
         {
             zipHelperStream.ReadLEInt();
             int num2;
             while (true)
             {
                 if (zipHelperStream.Position >= zipHelperStream.Length)
                 {
                     return;
                 }
                 int num = zipHelperStream.ReadLEShort();
                 num2 = zipHelperStream.ReadLEShort();
                 if (num == 1)
                 {
                     break;
                 }
                 zipHelperStream.Seek(num2, SeekOrigin.Current);
             }
             if (num2 >= 24)
             {
                 long fileTime = zipHelperStream.ReadLELong();
                 _lastModificationTime = DateTime.FromFileTime(fileTime);
                 long fileTime2 = zipHelperStream.ReadLELong();
                 _lastAccessTime = DateTime.FromFileTime(fileTime2);
                 long fileTime3 = zipHelperStream.ReadLELong();
                 _createTime = DateTime.FromFileTime(fileTime3);
             }
         }
     }
 }
Exemplo n.º 4
0
 public void SetData(byte[] data, int index, int count)
 {
     using (MemoryStream stream = new MemoryStream(data, index, count, false))
     {
         using (ZipHelperStream stream2 = new ZipHelperStream(stream))
         {
             stream2.ReadLEInt();
             while (stream2.Position < stream2.Length)
             {
                 int num = stream2.ReadLEShort();
                 int num2 = stream2.ReadLEShort();
                 if (num == 1)
                 {
                     if (num2 >= 0x18)
                     {
                         long fileTime = stream2.ReadLELong();
                         this._lastModificationTime = DateTime.FromFileTime(fileTime);
                         long num4 = stream2.ReadLELong();
                         this._lastAccessTime = DateTime.FromFileTime(num4);
                         long num5 = stream2.ReadLELong();
                         this._createTime = DateTime.FromFileTime(num5);
                     }
                     return;
                 }
                 stream2.Seek((long) num2, SeekOrigin.Current);
             }
         }
     }
 }
Exemplo n.º 5
0
        public void SetData(byte[] data, int index, int count)
        {
            //IL_0004: Unknown result type (might be due to invalid IL or missing references)
            //IL_000a: Expected O, but got Unknown
            MemoryStream val = new MemoryStream(data, index, count, false);

            try
            {
                ZipHelperStream zipHelperStream = new ZipHelperStream((Stream)(object)val);
                try
                {
                    zipHelperStream.ReadLEInt();
                    while (((Stream)zipHelperStream).get_Position() < ((Stream)zipHelperStream).get_Length())
                    {
                        int num  = zipHelperStream.ReadLEShort();
                        int num2 = zipHelperStream.ReadLEShort();
                        if (num == 1)
                        {
                            if (num2 >= 24)
                            {
                                long num3 = zipHelperStream.ReadLELong();
                                _lastModificationTime = global::System.DateTime.FromFileTime(num3);
                                long num4 = zipHelperStream.ReadLELong();
                                _lastAccessTime = global::System.DateTime.FromFileTime(num4);
                                long num5 = zipHelperStream.ReadLELong();
                                _createTime = global::System.DateTime.FromFileTime(num5);
                            }
                            break;
                        }
                        ((Stream)zipHelperStream).Seek((long)num2, (SeekOrigin)1);
                    }
                }
                finally
                {
                    ((global::System.IDisposable)zipHelperStream)?.Dispose();
                }
            }
            finally
            {
                ((global::System.IDisposable)val)?.Dispose();
            }
        }
Exemplo n.º 6
0
		/// <summary>
		/// Set the data from the raw values provided.
		/// </summary>
		/// <param name="data">The raw data to extract values from.</param>
		/// <param name="index">The index to start extracting values from.</param>
		/// <param name="count">The number of bytes available.</param>
		public void SetData(byte[] data, int index, int count)
		{
			using (MemoryStream ms = new MemoryStream(data, index, count, false)) 
			using (ZipHelperStream helperStream = new ZipHelperStream(ms))
			{
				helperStream.ReadLEInt(); // Reserved
				while (helperStream.Position < helperStream.Length)
				{
					int ntfsTag = helperStream.ReadLEShort();
					int ntfsLength = helperStream.ReadLEShort();
					if (ntfsTag == 1)
					{
						if (ntfsLength >= 24)
						{
							long lastModificationTicks = helperStream.ReadLELong();
							lastModificationTime_ = DateTime.FromFileTime(lastModificationTicks);

							long lastAccessTicks = helperStream.ReadLELong();
							lastAccessTime_ = DateTime.FromFileTime(lastAccessTicks);

							long createTimeTicks = helperStream.ReadLELong();
							createTime_ = DateTime.FromFileTime(createTimeTicks);
						}
						break;
					}
					else
					{
						// An unknown NTFS tag so simply skip it.
						helperStream.Seek(ntfsLength, SeekOrigin.Current);
					}
				}
			}
		}
Exemplo n.º 7
0
 public void SetData(byte[] data, int index, int count)
 {
     using (MemoryStream memoryStream = new MemoryStream(data, index, count, false))
     {
         using (ZipHelperStream zipHelperStream = new ZipHelperStream(memoryStream))
         {
             zipHelperStream.ReadLEInt();
             while (zipHelperStream.Position < zipHelperStream.Length)
             {
                 int num = zipHelperStream.ReadLEShort();
                 int num2 = zipHelperStream.ReadLEShort();
                 if (num == 1)
                 {
                     if (num2 >= 24)
                     {
                         long fileTime = zipHelperStream.ReadLELong();
                         this._lastModificationTime = DateTime.FromFileTime(fileTime);
                         long fileTime2 = zipHelperStream.ReadLELong();
                         this._lastAccessTime = DateTime.FromFileTime(fileTime2);
                         long fileTime3 = zipHelperStream.ReadLELong();
                         this._createTime = DateTime.FromFileTime(fileTime3);
                     }
                     break;
                 }
                 zipHelperStream.Seek((long)num2, SeekOrigin.Current);
             }
         }
     }
 }