This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
+156
View File
@@ -0,0 +1,156 @@
using System;
using System.IO;
namespace ICSharpCode.SharpZipLib.Zip
{
// Token: 0x0200005F RID: 95
public class NTTaggedData : ITaggedData
{
// Token: 0x170000D7 RID: 215
// (get) Token: 0x0600039A RID: 922 RVA: 0x00012993 File Offset: 0x00011993
public short TagID
{
get
{
return 10;
}
}
// Token: 0x0600039B RID: 923 RVA: 0x00012998 File Offset: 0x00011998
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 num3 = zipHelperStream.ReadLELong();
this._lastModificationTime = DateTime.FromFileTime(num3);
long num4 = zipHelperStream.ReadLELong();
this._lastAccessTime = DateTime.FromFileTime(num4);
long num5 = zipHelperStream.ReadLELong();
this._createTime = DateTime.FromFileTime(num5);
break;
}
break;
}
else
{
zipHelperStream.Seek((long)num2, SeekOrigin.Current);
}
}
}
}
}
// Token: 0x0600039C RID: 924 RVA: 0x00012A64 File Offset: 0x00011A64
public byte[] GetData()
{
byte[] array;
using (MemoryStream memoryStream = new MemoryStream())
{
using (ZipHelperStream zipHelperStream = new ZipHelperStream(memoryStream))
{
zipHelperStream.IsStreamOwner = false;
zipHelperStream.WriteLEInt(0);
zipHelperStream.WriteLEShort(1);
zipHelperStream.WriteLEShort(24);
zipHelperStream.WriteLELong(this._lastModificationTime.ToFileTime());
zipHelperStream.WriteLELong(this._lastAccessTime.ToFileTime());
zipHelperStream.WriteLELong(this._createTime.ToFileTime());
array = memoryStream.ToArray();
}
}
return array;
}
// Token: 0x0600039D RID: 925 RVA: 0x00012B08 File Offset: 0x00011B08
public static bool IsValidValue(DateTime value)
{
bool flag = true;
try
{
value.ToFileTimeUtc();
}
catch
{
flag = false;
}
return flag;
}
// Token: 0x170000D8 RID: 216
// (get) Token: 0x0600039E RID: 926 RVA: 0x00012B38 File Offset: 0x00011B38
// (set) Token: 0x0600039F RID: 927 RVA: 0x00012B40 File Offset: 0x00011B40
public DateTime LastModificationTime
{
get
{
return this._lastModificationTime;
}
set
{
if (!NTTaggedData.IsValidValue(value))
{
throw new ArgumentOutOfRangeException("value");
}
this._lastModificationTime = value;
}
}
// Token: 0x170000D9 RID: 217
// (get) Token: 0x060003A0 RID: 928 RVA: 0x00012B5C File Offset: 0x00011B5C
// (set) Token: 0x060003A1 RID: 929 RVA: 0x00012B64 File Offset: 0x00011B64
public DateTime CreateTime
{
get
{
return this._createTime;
}
set
{
if (!NTTaggedData.IsValidValue(value))
{
throw new ArgumentOutOfRangeException("value");
}
this._createTime = value;
}
}
// Token: 0x170000DA RID: 218
// (get) Token: 0x060003A2 RID: 930 RVA: 0x00012B80 File Offset: 0x00011B80
// (set) Token: 0x060003A3 RID: 931 RVA: 0x00012B88 File Offset: 0x00011B88
public DateTime LastAccessTime
{
get
{
return this._lastAccessTime;
}
set
{
if (!NTTaggedData.IsValidValue(value))
{
throw new ArgumentOutOfRangeException("value");
}
this._lastAccessTime = value;
}
}
// Token: 0x040002B8 RID: 696
private DateTime _lastAccessTime = DateTime.FromFileTime(0L);
// Token: 0x040002B9 RID: 697
private DateTime _lastModificationTime = DateTime.FromFileTime(0L);
// Token: 0x040002BA RID: 698
private DateTime _createTime = DateTime.FromFileTime(0L);
}
}