Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled with JetBrains decompiler
- // Type: #2b.#rd
- // Assembly: osu!, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- // MVID: 10148CFD-FC95-4E89-8CEB-E7D9576A739C
- // Assembly location: C:\Program Files (x86)\osu\osu!.exe
- using \u00232b;
- using \u0023c;
- using \u0023lb;
- using \u0023T;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- using System.Security.Cryptography;
- using System.Text;
- using System.Threading;
- namespace \u00232b
- {
- internal sealed class \u0023rd : IDisposable
- {
- private bool \u0023b = true;
- private object \u0023a = new object();
- private static readonly MD5CryptoServiceProvider \u0023a = new MD5CryptoServiceProvider();
- private static byte[] \u0023a = new byte[32]
- {
- (byte) 216,
- (byte) 98,
- (byte) 163,
- (byte) 48,
- (byte) 2,
- (byte) 109,
- (byte) 118,
- (byte) 89,
- (byte) 244,
- (byte) 247,
- (byte) 37,
- (byte) 194,
- (byte) 235,
- (byte) 70,
- (byte) 174,
- (byte) 52,
- (byte) 13,
- (byte) 106,
- (byte) 97,
- (byte) 84,
- (byte) 242,
- (byte) 62,
- (byte) 186,
- (byte) 48,
- (byte) 25,
- (byte) 66,
- (byte) 72,
- (byte) 85,
- (byte) 242,
- (byte) 22,
- (byte) 15,
- (byte) 92
- };
- private static readonly byte[] \u0023c = new byte[64];
- private byte[] \u0023b;
- private string \u0023a;
- private Dictionary<string, \u00231b> \u0023a;
- private Dictionary<string, byte[]> \u0023a;
- private long \u0023a;
- private byte[] \u0023d;
- private SortedDictionary<string, int> \u0023a;
- private Dictionary<string, DateTime> \u0023a;
- private Dictionary<string, DateTime> \u0023b;
- private Dictionary<string, bool> \u0023a;
- private List<\u0023td> \u0023a;
- private Dictionary<\u00233b, string> \u0023a;
- private Stream \u0023a;
- internal bool \u0023a;
- private bool \u0023c;
- private bool \u0023d;
- private bool \u0023e;
- private int \u0023a;
- private int \u0023b;
- private long \u0023b;
- static \u0023rd()
- {
- new \u00232(1990).\u0023Cr(\u0023rd.\u0023c);
- }
- public \u0023rd([In] string obj0)
- : this(obj0, (byte[]) null, false, false)
- {
- }
- public \u0023rd([In] Stream obj0, [In] bool obj1)
- {
- this.\u0023a = obj0;
- try
- {
- this.\u0023js(obj1);
- }
- catch (Exception ex)
- {
- this.Close();
- throw;
- }
- }
- public \u0023rd([In] string obj0, [In] byte[] obj1, [In] bool obj2, [In] bool obj3)
- {
- this.\u0023e = !File.Exists(obj0);
- if (this.\u0023e && !obj2)
- throw new IOException(\u0023b.Get(40631) + obj0 + \u0023b.Get(40660));
- if (obj1 != null)
- this.\u0023b = obj1;
- try
- {
- this.\u0023a = obj0;
- if (!this.\u0023e)
- this.\u0023a = (Stream) File.Open(obj0, FileMode.Open, FileAccess.Read, FileShare.Read);
- this.\u0023js(false);
- }
- catch (Exception ex)
- {
- this.Close();
- throw;
- }
- }
- ~\u0023rd()
- {
- this.Dispose(false);
- }
- [SpecialName]
- public int \u0023qC()
- {
- return this.\u0023a;
- }
- private void \u0023js([In] bool obj0)
- {
- this.\u0023a = new Dictionary<\u00233b, string>();
- this.\u0023a = new Dictionary<string, \u00231b>((IEqualityComparer<string>) StringComparer.CurrentCultureIgnoreCase);
- this.\u0023a = new SortedDictionary<string, int>();
- this.\u0023a = new Dictionary<string, DateTime>();
- this.\u0023b = new Dictionary<string, DateTime>();
- this.\u0023a = new Dictionary<string, bool>();
- this.\u0023a = new List<\u0023td>();
- this.\u0023a = new Dictionary<string, byte[]>((IEqualityComparer<string>) StringComparer.CurrentCultureIgnoreCase);
- this.\u0023d = false;
- this.\u0023c = false;
- this.\u0023a = false;
- if (this.\u0023e)
- {
- this.\u0023a = 0;
- this.\u0023b = 0;
- using (\u0023kb kb = (\u0023kb) new \u0023mb())
- {
- kb.GenerateIV();
- this.\u0023d = new byte[kb.IV.Length];
- Array.Copy((Array) kb.IV, (Array) this.\u0023d, this.\u0023d.Length);
- kb.Clear();
- }
- }
- else
- {
- BinaryReader binaryReader = new BinaryReader(this.\u0023a);
- byte[] numArray = binaryReader.ReadBytes(3);
- if (numArray.Length < 3 || (int) numArray[0] != 236 || ((int) numArray[1] != 72 || (int) numArray[2] != 79))
- throw new IOException(\u0023b.Get(40665));
- int num1 = (int) binaryReader.ReadByte();
- this.\u0023d = binaryReader.ReadBytes(16);
- // ISSUE: reference to a compiler-generated method
- this.\u0023lC(binaryReader.ReadBytes(16));
- // ISSUE: reference to a compiler-generated method
- this.\u0023nC(binaryReader.ReadBytes(16));
- // ISSUE: reference to a compiler-generated method
- this.\u0023pC(binaryReader.ReadBytes(16));
- using (MemoryStream memoryStream = new MemoryStream())
- {
- using (BinaryWriter binaryWriter = new BinaryWriter((Stream) memoryStream))
- {
- int num2 = binaryReader.ReadInt32();
- binaryWriter.Write(num2);
- for (int index = 0; index < num2; ++index)
- {
- short num3 = binaryReader.ReadInt16();
- string str = binaryReader.ReadString();
- if (Enum.IsDefined(typeof (\u00233b), (object) (int) num3))
- this.\u0023a.Add((\u00233b) num3, str);
- binaryWriter.Write(num3);
- binaryWriter.Write(str);
- }
- binaryWriter.Flush();
- // ISSUE: reference to a compiler-generated method
- if (!\u00237.\u0023cs(\u0023rd.\u0023yC(memoryStream.ToArray(), num2 * 3, (byte) 167), this.\u0023kC()))
- throw new IOException(\u0023b.Get(40686));
- binaryWriter.Close();
- }
- }
- int num4 = binaryReader.ReadInt32();
- for (int index = 0; index < num4; ++index)
- this.\u0023a.Add(binaryReader.ReadString(), binaryReader.ReadInt32());
- if (this.\u0023b == null)
- this.\u0023b = \u0023rd.\u0023AC(Encoding.ASCII.GetBytes(this.\u0023a[\u00233b.\u0023c] + \u0023b.Get(40727) + this.\u0023a[\u00233b.\u0023j]));
- if (obj0)
- this.\u0023b = binaryReader.BaseStream.Position;
- else
- this.\u0023tC(binaryReader);
- }
- }
- private void \u0023tC([In] BinaryReader obj0)
- {
- // ISSUE: reference to a compiler-generated method
- this.\u0023GC(true);
- using (\u00231 obj = new \u00231(obj0.BaseStream, \u0023Z.\u0023a, this.\u0023b))
- {
- byte[] buffer = new byte[64];
- obj.Read(buffer, 0, 64);
- if (!\u00237.\u0023cs(buffer, \u0023rd.\u0023c))
- throw new Exception(\u0023b.Get(40740));
- }
- this.\u0023b = (int) obj0.BaseStream.Position;
- int count = obj0.ReadInt32();
- int index1 = 0;
- while (index1 < 16)
- {
- // ISSUE: reference to a compiler-generated method
- // ISSUE: reference to a compiler-generated method
- count -= (int) this.\u0023mC()[index1] | (int) this.\u0023mC()[index1 + 1] << 17;
- index1 += 2;
- }
- byte[] buffer1 = obj0.ReadBytes(count);
- this.\u0023a = (int) obj0.BaseStream.Position;
- for (int index2 = 0; index2 < this.\u0023d.Length; ++index2)
- {
- // ISSUE: reference to a compiler-generated method
- this.\u0023d[index2] ^= this.\u0023oC()[index2 % 16];
- }
- using (\u0023kb kb = (\u0023kb) new \u0023mb())
- {
- kb.IV = this.\u0023d;
- kb.Key = this.\u0023b;
- using (MemoryStream memoryStream = new MemoryStream(buffer1))
- {
- using (Stream input = (Stream) new \u00231((Stream) memoryStream, \u0023Z.\u0023b, this.\u0023b))
- {
- using (BinaryReader binaryReader = new BinaryReader(input))
- {
- int num1 = binaryReader.ReadInt32();
- // ISSUE: reference to a compiler-generated method
- if (!\u00237.\u0023cs(\u0023rd.\u0023yC(buffer1, num1 * 4, (byte) 209), this.\u0023mC()))
- throw new IOException(\u0023b.Get(40686));
- int num2 = binaryReader.ReadInt32();
- for (int index2 = 0; index2 < num1; ++index2)
- {
- string key = binaryReader.ReadString();
- byte[] numArray = binaryReader.ReadBytes(16);
- DateTime dateTime1 = DateTime.FromBinary(binaryReader.ReadInt64());
- DateTime dateTime2 = DateTime.FromBinary(binaryReader.ReadInt64());
- int num3 = index2 + 1 >= num1 ? (int) obj0.BaseStream.Length - this.\u0023a : binaryReader.ReadInt32();
- int num4 = num3 - num2;
- if (\u0023rd.\u0023EC(key))
- {
- long position = obj0.BaseStream.Position;
- bool flag;
- if ((long) (this.\u0023a + num2 + num4 / 2 - 512 + 4) >= obj0.BaseStream.Length || num4 < 1024)
- {
- flag = true;
- }
- else
- {
- byte[] buffer2 = new byte[1024];
- using (\u0023td td = new \u0023td(this.\u0023hw(), this.\u0023a + num2, num4 - 4, this.\u0023d, this.\u0023b))
- {
- int num5 = (num4 - 4) / 2;
- td.Seek((long) (num5 - num5 % 16 - 512 + 16), SeekOrigin.Begin);
- td.Read(buffer2, 0, 1024);
- obj0.BaseStream.Position = position;
- }
- flag = !BitConverter.ToString(\u0023rd.\u0023a.ComputeHash(buffer2)).Replace(\u0023b.Get(6336), \u0023b.Get(32761)).Equals(this.\u0023a[\u00233b.\u0023i]);
- }
- if (flag)
- {
- this.\u0023b = false;
- // ISSUE: reference to a compiler-generated method
- this.\u0023sC(true);
- num2 = num3;
- continue;
- }
- }
- this.\u0023a.Add(key, new \u00231b(key, num2, num4, numArray, dateTime1, dateTime2));
- num2 = num3;
- }
- binaryReader.Close();
- }
- }
- }
- kb.Clear();
- }
- this.\u0023a.Seek(0L, SeekOrigin.Begin);
- }
- private void \u0023uC([In] Dictionary<string, byte[]> obj0, [In] ICryptoTransform obj1)
- {
- string[] array = new string[obj0.Keys.Count];
- obj0.Keys.CopyTo(array, 0);
- foreach (string index in array)
- {
- using (MemoryStream memoryStream = new MemoryStream())
- {
- using (Stream output = (Stream) new \u00231((Stream) memoryStream, \u0023Z.\u0023b, this.\u0023b))
- {
- using (BinaryWriter binaryWriter = new BinaryWriter(output))
- {
- binaryWriter.Write(obj0[index].Length);
- if (!this.\u0023a[index])
- binaryWriter.Write(obj0[index]);
- else
- memoryStream.Write(obj0[index], 0, obj0[index].Length);
- output.Flush();
- obj0[index] = memoryStream.ToArray();
- binaryWriter.Close();
- }
- }
- }
- }
- }
- private static byte[] \u0023vC([In] SortedDictionary<string, byte[]> obj0)
- {
- using (MemoryStream memoryStream = new MemoryStream())
- {
- using (BinaryWriter binaryWriter = new BinaryWriter((Stream) memoryStream))
- {
- foreach (byte[] buffer in obj0.Values)
- binaryWriter.Write(buffer);
- binaryWriter.Flush();
- byte[] numArray = memoryStream.ToArray();
- binaryWriter.Close();
- return numArray;
- }
- }
- }
- private byte[] \u0023wC([In] SortedDictionary<string, byte[]> obj0, [In] Dictionary<string, byte[]> obj1, [In] Dictionary<string, DateTime> obj2, [In] Dictionary<string, DateTime> obj3, [In] ICryptoTransform obj4)
- {
- using (MemoryStream memoryStream = new MemoryStream())
- {
- using (\u00231 obj5 = new \u00231((Stream) memoryStream, \u0023Z.\u0023b, this.\u0023b))
- {
- using (BinaryWriter binaryWriter = new BinaryWriter((Stream) obj5))
- {
- binaryWriter.Write(obj0.Count);
- int num = 0;
- foreach (KeyValuePair<string, byte[]> keyValuePair in obj0)
- {
- binaryWriter.Write(num);
- binaryWriter.Write(keyValuePair.Key);
- using (\u00231 obj6 = new \u00231((Stream) new MemoryStream(keyValuePair.Value, false), \u0023Z.\u0023b, this.\u0023b))
- {
- byte[] buffer = new byte[keyValuePair.Value.Length];
- obj6.Read(buffer, 0, keyValuePair.Value.Length);
- byte[] hash = \u0023rd.\u0023a.ComputeHash(buffer, 4, keyValuePair.Value.Length - 4);
- binaryWriter.Write(hash);
- binaryWriter.Write(obj2[keyValuePair.Key].ToBinary());
- binaryWriter.Write(obj3[keyValuePair.Key].ToBinary());
- obj1[keyValuePair.Key] = hash;
- }
- num += keyValuePair.Value.Length;
- }
- obj5.Flush();
- binaryWriter.Flush();
- byte[] numArray = memoryStream.ToArray();
- obj5.Close();
- binaryWriter.Close();
- return numArray;
- }
- }
- }
- }
- private static byte[] \u0023xC([In] Dictionary<\u00233b, string> obj0)
- {
- using (MemoryStream memoryStream = new MemoryStream())
- {
- using (BinaryWriter binaryWriter = new BinaryWriter((Stream) memoryStream))
- {
- binaryWriter.Write(obj0.Count);
- foreach (KeyValuePair<\u00233b, string> keyValuePair in obj0)
- {
- binaryWriter.Write((ushort) keyValuePair.Key);
- binaryWriter.Write(keyValuePair.Value ?? string.Empty);
- }
- binaryWriter.Close();
- return memoryStream.ToArray();
- }
- }
- }
- private static byte[] \u0023yC([In] byte[] obj0, [In] int obj1, [In] byte obj2)
- {
- try
- {
- obj0[obj1] ^= obj2;
- byte[] hash = \u0023rd.\u0023a.ComputeHash(obj0);
- obj0[obj1] ^= obj2;
- for (int index = 0; index < 8; ++index)
- {
- byte num = hash[index];
- hash[index] = hash[index + 8];
- hash[index + 8] = num;
- }
- hash[5] ^= (byte) 45;
- return hash;
- }
- catch (Exception ex)
- {
- throw new IOException(\u0023b.Get(40686));
- }
- }
- private byte[] \u0023zC([In] Stream obj0, [In] int obj1, [In] byte obj2)
- {
- long position = obj0.Position;
- long length = obj0.Length - position;
- string str = this.\u0023LC(\u00233b.\u0023g);
- byte[] buffer;
- if (!string.IsNullOrEmpty(str))
- {
- long num1 = Convert.ToInt64(str);
- long num2 = Convert.ToInt64(this.\u0023LC(\u00233b.\u0023h));
- buffer = new byte[length - num2];
- obj0.Read(buffer, 0, (int) num1);
- long num3 = obj0.Position + num2;
- if (num3 >= obj0.Length)
- {
- obj0.Position = num3;
- obj0.Read(buffer, (int) (obj0.Position - position - num2), (int) (obj0.Length - obj0.Position));
- }
- obj1 %= (int) (length - num2);
- }
- else
- {
- buffer = new byte[length];
- obj0.Read(buffer, 0, buffer.Length);
- }
- return \u0023rd.\u0023yC(buffer, obj1, obj2);
- }
- public static byte[] \u0023AC([In] byte[] obj0)
- {
- return \u0023rd.\u0023a.ComputeHash(obj0);
- }
- public static bool \u0023BC([In] string obj0)
- {
- string str = Path.GetExtension(obj0).ToLower();
- if (!(str == \u0023b.Get(40757)))
- return str == \u0023b.Get(40766);
- return true;
- }
- public static bool \u0023CC([In] string obj0)
- {
- string str = Path.GetExtension(obj0).ToLower();
- if (!(str == \u0023b.Get(40775)))
- return str == \u0023b.Get(40784);
- return true;
- }
- public static bool \u0023DC([In] string obj0)
- {
- if (!(Path.GetExtension(obj0).ToLower() == \u0023b.Get(40793)))
- return Path.GetExtension(obj0).ToLower() == \u0023b.Get(40802);
- return true;
- }
- public static bool \u0023EC([In] string obj0)
- {
- string str = Path.GetExtension(obj0).ToLower();
- if (!(str == \u0023b.Get(40807)) && !(str == \u0023b.Get(40816)))
- return str == \u0023b.Get(40825);
- return true;
- }
- [SpecialName]
- public string \u0023hw()
- {
- return this.\u0023a;
- }
- [SpecialName]
- public string[] \u0023HC()
- {
- this.\u0023XC();
- string[] array = new string[this.\u0023a.Count];
- this.\u0023a.Keys.CopyTo(array, 0);
- return array;
- }
- public int \u0023IC([In] string obj0)
- {
- if (!this.\u0023a.ContainsKey(obj0))
- return -2;
- return this.\u0023a[obj0];
- }
- public void \u0023JC([In] string obj0, [In] int obj1)
- {
- if (!this.\u0023a.ContainsKey(obj0))
- throw new Exception(\u0023b.Get(40834));
- if (this.\u0023a.ContainsValue(obj1) && obj1 != -1 && this.\u0023IC(obj0) != obj1)
- throw new Exception(\u0023b.Get(40887));
- this.\u0023a[obj0] = obj1;
- }
- public bool \u0023KC([In] string obj0)
- {
- if (!this.\u0023a.ContainsKey(obj0))
- return this.\u0023a.ContainsKey(obj0);
- return true;
- }
- public string \u0023LC([In] \u00233b obj0)
- {
- this.\u0023XC();
- string str;
- this.\u0023a.TryGetValue(obj0, out str);
- return str;
- }
- public Stream \u0023MC([In] string obj0)
- {
- return this.\u0023MC(obj0, false);
- }
- public Stream \u0023MC([In] string obj0, [In] bool obj1)
- {
- this.\u0023XC();
- Stream stream = (Stream) null;
- if (this.\u0023a.ContainsKey(obj0))
- {
- if (!obj1)
- {
- // ISSUE: reference to a compiler-generated method
- // ISSUE: reference to a compiler-generated method
- \u0023td td = new \u0023td(this.\u0023a, this.\u0023a + this.\u0023a[obj0].\u0023kw(), this.\u0023a[obj0].get_Length(), this.\u0023d, this.\u0023b);
- this.\u0023a.Add(td);
- td.\u00232C(new \u0023td.\u0023ud(this.\u0023NC));
- stream = (Stream) td;
- }
- else
- {
- // ISSUE: reference to a compiler-generated method
- byte[] buffer = new byte[this.\u0023a[obj0].get_Length() - 4];
- FileStream fileStream = File.Open(this.\u0023a, FileMode.Open, FileAccess.Read, FileShare.Read);
- // ISSUE: reference to a compiler-generated method
- fileStream.Seek((long) (this.\u0023a + this.\u0023a[obj0].\u0023kw() + 4), SeekOrigin.Begin);
- fileStream.Read(buffer, 0, buffer.Length);
- stream = (Stream) new MemoryStream(buffer, false);
- }
- }
- else if (this.\u0023a.ContainsKey(obj0))
- stream = (Stream) new MemoryStream(this.\u0023a[obj0], false);
- return stream;
- }
- private void \u0023NC([In] \u0023td obj0)
- {
- if (this.\u0023a || !this.\u0023a.Contains(obj0))
- return;
- this.\u0023a.Remove(obj0);
- }
- public void \u0023OC([In] \u00233b obj0, [In] string obj1)
- {
- this.\u0023XC();
- this.\u0023a[obj0] = obj1;
- this.\u0023d = true;
- switch (obj0)
- {
- case \u00233b.\u0023c:
- case \u00233b.\u0023j:
- string str1;
- this.\u0023a.TryGetValue(\u00233b.\u0023c, out str1);
- string str2;
- this.\u0023a.TryGetValue(\u00233b.\u0023j, out str2);
- if (str1 == null || str2 == null || this.\u0023b != null && this.\u0023b != \u0023rd.\u0023a)
- break;
- this.\u0023b = \u0023rd.\u0023AC(Encoding.ASCII.GetBytes(str1 + \u0023b.Get(40727) + str2));
- break;
- }
- }
- public void \u0023PC([In] string obj0, [In] bool obj1)
- {
- this.\u0023XC();
- obj0 = \u00237.\u0023pac(obj0);
- string[] strArray;
- if (!obj1)
- {
- strArray = Directory.GetFiles(obj0);
- }
- else
- {
- List<string> list = new List<string>();
- Stack<string> stack = new Stack<string>();
- stack.Push(obj0);
- while (stack.Count > 0)
- {
- string path = stack.Pop();
- foreach (string str in Directory.GetFiles(path))
- list.Add(str);
- foreach (string str in Directory.GetDirectories(path))
- stack.Push(str);
- }
- strArray = list.ToArray();
- }
- foreach (string path in strArray)
- {
- if (!\u0023rd.\u0023DC(path))
- this.\u0023QC(\u00237.\u0023Wdc(path, obj0), path, File.GetCreationTimeUtc(path), File.GetLastWriteTimeUtc(path));
- }
- this.\u0023c = true;
- }
- public void \u0023QC([In] string obj0, [In] string obj1, [In] DateTime obj2, [In] DateTime obj3)
- {
- this.\u0023XC();
- if (\u0023rd.\u0023DC(obj0))
- throw new IOException(\u0023b.Get(40936));
- byte[] buffer;
- using (FileStream fileStream = File.OpenRead(obj1))
- {
- buffer = new byte[fileStream.Length];
- fileStream.Read(buffer, 0, (int) fileStream.Length);
- fileStream.Close();
- }
- this.\u0023QC(obj0, buffer, obj2, obj3);
- this.\u0023c = true;
- }
- public void \u0023QC([In] string obj0, [In] byte[] obj1, [In] DateTime obj2, [In] DateTime obj3)
- {
- this.\u0023QC(obj0, obj1, obj2, obj3, false);
- }
- public void \u0023QC([In] string obj0, [In] byte[] obj1, [In] DateTime obj2, [In] DateTime obj3, [In] bool obj4)
- {
- this.\u0023XC();
- if (\u0023rd.\u0023DC(obj0))
- throw new IOException(\u0023b.Get(40936));
- if (\u0023rd.\u0023BC(obj0) && !this.\u0023a.ContainsKey(obj0))
- this.\u0023a.Add(obj0, -1);
- if (\u0023rd.\u0023EC(obj0))
- {
- if (obj1.Length < 1024)
- throw new IOException(\u0023b.Get(41001));
- long num = this.\u0023a;
- foreach (KeyValuePair<string, \u00231b> keyValuePair in this.\u0023a)
- {
- // ISSUE: reference to a compiler-generated method
- num += (long) keyValuePair.Value.get_Length();
- }
- byte[] buffer = new byte[1024];
- Array.Copy((Array) obj1, obj1.LongLength / 2L - obj1.LongLength / 2L % 16L - 512L + 16L, (Array) buffer, 0L, 1024L);
- byte[] hash = \u0023rd.\u0023a.ComputeHash(buffer);
- this.\u0023OC(\u00233b.\u0023g, Convert.ToString(num));
- this.\u0023OC(\u00233b.\u0023h, Convert.ToString(obj1.Length));
- this.\u0023OC(\u00233b.\u0023i, BitConverter.ToString(hash).Replace(\u0023b.Get(6336), \u0023b.Get(32761)));
- this.\u0023d = true;
- }
- this.\u0023a[obj0] = obj1;
- this.\u0023a[obj0] = obj2;
- this.\u0023b[obj0] = obj3;
- this.\u0023a[obj0] = obj4;
- this.\u0023a += obj1.LongLength;
- if (this.\u0023a.ContainsKey(obj0))
- this.\u0023a.Remove(obj0);
- this.\u0023c = true;
- }
- public void \u0023RC([In] string obj0)
- {
- this.\u0023XC();
- bool flag = false;
- if (this.\u0023a.ContainsKey(obj0))
- {
- this.\u0023a.Remove(obj0);
- flag = true;
- }
- if (this.\u0023a.ContainsKey(obj0))
- {
- this.\u0023a.Remove(obj0);
- this.\u0023a.Remove(obj0);
- this.\u0023b.Remove(obj0);
- this.\u0023a.Remove(obj0);
- flag = true;
- }
- if (!flag)
- return;
- this.\u0023c = true;
- if (!this.\u0023a.ContainsKey(obj0))
- return;
- this.\u0023a.Remove(obj0);
- }
- public static void \u0023SC([In] string obj0, [In] List<\u00231b> obj1, [In] int obj2, [In] long obj3)
- {
- // ISSUE: reference to a compiler-generated method
- // ISSUE: reference to a compiler-generated method
- obj1_1.Sort((Comparison<\u00231b>) ((obj0_2, obj1_2) => obj0_2.\u0023kw() - obj1_2.\u0023kw()));
- using (BinaryWriter binaryWriter = new BinaryWriter((Stream) new MemoryStream()))
- {
- binaryWriter.Write(new byte[obj2]);
- using (\u0023rd rd = new \u0023rd(obj0_1))
- {
- using (FileStream fileStream = File.OpenRead(obj0_1))
- {
- int num = rd.\u0023qC();
- foreach (\u00231b obj1 in obj1_1)
- {
- // ISSUE: reference to a compiler-generated method
- if (rd.\u0023a.ContainsKey(obj1.\u0023hw()))
- {
- // ISSUE: reference to a compiler-generated method
- \u00231b obj4 = rd.\u0023a[obj1.\u0023hw()];
- // ISSUE: reference to a compiler-generated method
- long length = (long) obj1.\u0023kw() - binaryWriter.BaseStream.Position;
- if (length > 0L)
- binaryWriter.Write(new byte[length]);
- // ISSUE: reference to a compiler-generated method
- byte[] buffer = new byte[obj1.get_Length()];
- // ISSUE: reference to a compiler-generated method
- binaryWriter.Seek(obj1.\u0023kw() + obj2, SeekOrigin.Begin);
- // ISSUE: reference to a compiler-generated method
- fileStream.Seek((long) (obj4.\u0023kw() + num), SeekOrigin.Begin);
- fileStream.Read(buffer, 0, buffer.Length);
- binaryWriter.Write(buffer);
- }
- }
- }
- }
- binaryWriter.Seek(0, SeekOrigin.Begin);
- using (FileStream fileStream = File.Open(obj0_1, FileMode.Create))
- {
- byte[] buffer = new byte[524288];
- Stream baseStream = binaryWriter.BaseStream;
- int count;
- while ((count = baseStream.Read(buffer, 0, 524288)) > 0)
- fileStream.Write(buffer, 0, count);
- long position = fileStream.Position;
- }
- }
- }
- public List<\u00231b> \u0023TC()
- {
- List<\u00231b> list = new List<\u00231b>();
- foreach (\u00231b obj in this.\u0023a.Values)
- list.Add(obj);
- return list;
- }
- public bool \u0023UC()
- {
- return this.\u0023UC(false);
- }
- public bool \u0023UC([In] bool obj0)
- {
- this.\u0023XC();
- if (!this.\u0023b && !obj0)
- throw new Exception(\u0023b.Get(41058));
- if (!this.\u0023c && !this.\u0023d)
- return false;
- if (this.\u0023a.Count != 0)
- throw new IOException(\u0023b.Get(41179));
- if (this.\u0023a.Count + this.\u0023a.Count == 0)
- throw new IOException(\u0023b.Get(41228));
- if (this.\u0023a != null)
- this.\u0023a.Close();
- byte[] numArray1 = (byte[]) null;
- if (this.\u0023e)
- {
- this.\u0023c = true;
- this.\u0023d = true;
- }
- else
- numArray1 = File.ReadAllBytes(this.\u0023a);
- using (\u0023kb kb = (\u0023kb) new \u0023mb())
- {
- using (BinaryWriter binaryWriter = new BinaryWriter((Stream) new MemoryStream()))
- {
- kb.IV = this.\u0023d;
- kb.Key = this.\u0023b;
- binaryWriter.Write(new byte[3]
- {
- (byte) 236,
- (byte) 72,
- (byte) 79
- });
- binaryWriter.Write((byte) 0);
- SortedDictionary<string, byte[]> sortedDictionary = new SortedDictionary<string, byte[]>((IComparer<string>) new \u0023rd.\u0023sd());
- Dictionary<string, byte[]> dictionary1 = new Dictionary<string, byte[]>();
- Dictionary<string, DateTime> dictionary2 = new Dictionary<string, DateTime>();
- Dictionary<string, DateTime> dictionary3 = new Dictionary<string, DateTime>();
- byte[] buffer1;
- if (this.\u0023c)
- {
- foreach (KeyValuePair<string, \u00231b> keyValuePair in this.\u0023a)
- {
- // ISSUE: reference to a compiler-generated method
- byte[] numArray2 = new byte[keyValuePair.Value.get_Length()];
- // ISSUE: reference to a compiler-generated method
- Array.Copy((Array) numArray1, this.\u0023a + keyValuePair.Value.\u0023kw(), (Array) numArray2, 0, numArray2.Length);
- sortedDictionary.Add(keyValuePair.Key, numArray2);
- // ISSUE: reference to a compiler-generated method
- dictionary2[keyValuePair.Key] = keyValuePair.Value.\u0023ow();
- // ISSUE: reference to a compiler-generated method
- dictionary3[keyValuePair.Key] = keyValuePair.Value.\u0023qw();
- }
- this.\u0023uC(this.\u0023a, kb.CreateEncryptor());
- foreach (KeyValuePair<string, byte[]> keyValuePair in this.\u0023a)
- {
- sortedDictionary.Add(keyValuePair.Key, keyValuePair.Value);
- dictionary2[keyValuePair.Key] = this.\u0023a[keyValuePair.Key];
- dictionary3[keyValuePair.Key] = this.\u0023b[keyValuePair.Key];
- }
- buffer1 = \u0023rd.\u0023vC(sortedDictionary);
- }
- else
- {
- buffer1 = new byte[numArray1.Length - this.\u0023a];
- Array.Copy((Array) numArray1, this.\u0023a, (Array) buffer1, 0, buffer1.Length);
- }
- byte[] buffer2 = new byte[this.\u0023d.Length];
- for (int index = 0; index < buffer2.Length; ++index)
- buffer2[index] = (byte) ((uint) this.\u0023d[index] ^ (uint) buffer1[index]);
- binaryWriter.Write(buffer2);
- byte[] buffer3;
- if (this.\u0023d || this.\u0023c)
- {
- buffer3 = \u0023rd.\u0023xC(this.\u0023a);
- binaryWriter.Write(buffer3);
- binaryWriter.Write(this.\u0023a.Count);
- foreach (KeyValuePair<string, int> keyValuePair in this.\u0023a)
- {
- binaryWriter.Write(keyValuePair.Key);
- binaryWriter.Write(keyValuePair.Value);
- }
- using (\u00231 obj = new \u00231(binaryWriter.BaseStream, \u0023Z.\u0023a, this.\u0023b))
- obj.Write(\u0023rd.\u0023c, 0, 64);
- }
- else
- {
- buffer3 = new byte[this.\u0023b - 68];
- Array.Copy((Array) numArray1, 68, (Array) buffer3, 0, buffer3.Length);
- binaryWriter.Write(buffer3);
- }
- int num1 = (int) binaryWriter.BaseStream.Position;
- if (this.\u0023c)
- {
- byte[] buffer4 = this.\u0023wC(sortedDictionary, dictionary1, dictionary2, dictionary3, kb.CreateEncryptor());
- // ISSUE: reference to a compiler-generated method
- this.\u0023nC(\u0023rd.\u0023yC(buffer4, sortedDictionary.Count * 4, (byte) 209));
- int length = buffer4.Length;
- int index = 0;
- while (index < 16)
- {
- // ISSUE: reference to a compiler-generated method
- // ISSUE: reference to a compiler-generated method
- length += (int) this.\u0023mC()[index] | (int) this.\u0023mC()[index + 1] << 17;
- index += 2;
- }
- binaryWriter.Write(length);
- binaryWriter.Write(buffer4);
- }
- else
- {
- byte[] buffer4 = new byte[this.\u0023a - this.\u0023b];
- Array.Copy((Array) numArray1, this.\u0023b, (Array) buffer4, 0, buffer4.Length);
- binaryWriter.Write(buffer4);
- }
- int num2 = (int) binaryWriter.BaseStream.Position;
- binaryWriter.Write(buffer1);
- if (!obj0)
- {
- // ISSUE: reference to a compiler-generated method
- this.\u0023lC(\u0023rd.\u0023yC(buffer3, this.\u0023a.Count * 3, (byte) 167));
- // ISSUE: reference to a compiler-generated method
- this.\u0023pC(this.\u0023zC((Stream) new MemoryStream(buffer1, false), buffer1.Length / 2, (byte) 159));
- }
- using (FileStream fileStream = File.Open(this.\u0023a, FileMode.Create, FileAccess.Write, FileShare.None))
- {
- byte[] buffer4 = new byte[524288];
- binaryWriter.Seek(0, SeekOrigin.Begin);
- Stream baseStream = binaryWriter.BaseStream;
- baseStream.Read(buffer4, 0, 20);
- fileStream.Write(buffer4, 0, 20);
- // ISSUE: reference to a compiler-generated method
- fileStream.Write(this.\u0023kC(), 0, 16);
- // ISSUE: reference to a compiler-generated method
- fileStream.Write(this.\u0023mC(), 0, 16);
- // ISSUE: reference to a compiler-generated method
- fileStream.Write(this.\u0023oC(), 0, 16);
- int count;
- while ((count = baseStream.Read(buffer4, 0, 524288)) > 0)
- fileStream.Write(buffer4, 0, count);
- }
- binaryWriter.Close();
- kb.Clear();
- if (this.\u0023c)
- {
- this.\u0023a.Clear();
- int num3 = 0;
- foreach (KeyValuePair<string, byte[]> keyValuePair in sortedDictionary)
- {
- this.\u0023a.Add(keyValuePair.Key, new \u00231b(keyValuePair.Key, num3, keyValuePair.Value.Length, dictionary1[keyValuePair.Key], dictionary2[keyValuePair.Key], dictionary3[keyValuePair.Key]));
- num3 += keyValuePair.Value.Length;
- }
- }
- this.\u0023b = num1;
- this.\u0023a = num2;
- this.\u0023e = false;
- this.\u0023d = false;
- this.\u0023c = false;
- this.\u0023a.Clear();
- this.\u0023b.Clear();
- this.\u0023a.Clear();
- }
- }
- this.\u0023a = (Stream) File.Open(this.\u0023a, FileMode.Open, FileAccess.Read, FileShare.Read);
- return true;
- }
- public void Close()
- {
- if (this.\u0023a)
- return;
- if (this.\u0023a != null)
- this.\u0023a.ForEach((Action<\u0023td>) (obj0 => obj0.Close()));
- if (this.\u0023d != null)
- Array.Clear((Array) this.\u0023d, 0, this.\u0023d.Length);
- if (this.\u0023a != null)
- this.\u0023a.Clear();
- if (this.\u0023a != null)
- this.\u0023a.Clear();
- if (this.\u0023a != null)
- this.\u0023a.Clear();
- if (this.\u0023b != null)
- this.\u0023b.Clear();
- if (this.\u0023a != null)
- this.\u0023a.Clear();
- if (this.\u0023a != null)
- this.\u0023a.Clear();
- if (this.\u0023a != null)
- {
- this.\u0023a.Close();
- this.\u0023a.Dispose();
- }
- this.\u0023a = true;
- }
- public bool \u0023VC([In] int obj0, [In] bool obj1)
- {
- try
- {
- lock (this.\u0023a)
- {
- if (!Monitor.TryEnter(this.\u0023a, obj0))
- return false;
- }
- }
- catch
- {
- return false;
- }
- if (obj1 && this.\u0023a != null)
- {
- this.\u0023a.Close();
- this.\u0023a = (Stream) null;
- }
- return true;
- }
- public void \u0023WC()
- {
- if (this.\u0023a == null)
- this.\u0023a = (Stream) File.Open(this.\u0023a, FileMode.Open, FileAccess.Read, FileShare.Read);
- lock (this.\u0023a)
- Monitor.Exit(this.\u0023a);
- }
- public void Dispose()
- {
- this.Dispose(true);
- GC.SuppressFinalize((object) this);
- }
- private void Dispose([In] bool obj0)
- {
- this.Close();
- }
- private void \u0023XC()
- {
- if (this.\u0023a)
- throw new Exception(\u0023b.Get(41269));
- }
- internal sealed class \u0023sd : IComparer<string>
- {
- public int Compare([In] string obj0, [In] string obj1)
- {
- if (object.ReferenceEquals((object) obj0, (object) obj1))
- return 0;
- if (\u0023rd.\u0023EC(obj0))
- return 1;
- if (\u0023rd.\u0023EC(obj1))
- return -1;
- return obj0.CompareTo(obj1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement