// Decompiled with JetBrains decompiler
// Type: A.A
// Assembly: RansomGuard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 37652FF6-4FF5-4E76-944D-E6CA5073036F
// Assembly location: RansomGuard.dll inside C:\Users\WDAGUtilityAccount\Desktop\RansomGuard.exe)

using \u003CPrivateImplementationDetails\u003E\u007B29195D03\u002D3E0A\u002D468D\u002DA5D2\u002D1BA9D027086D\u007D;
using RansomGuard;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

#nullable enable
namespace A;

public class A : IDisposable
{
  private readonly A.a A;
  private readonly A.l a;
  private readonly RansomGuardConfig B;
  private readonly int b;
  private readonly ConcurrentDictionary<string, string> C = new ConcurrentDictionary<string, string>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
  private readonly Dictionary<string, string> c = new Dictionary<string, string>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
  private readonly Dictionary<string, string> D = new Dictionary<string, string>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
  private readonly object d = new object();
  private DateTime E = DateTime.MinValue;
  private readonly object e = new object();
  private readonly Dictionary<string, DateTime> F = new Dictionary<string, DateTime>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
  private readonly Dictionary<string, DateTime> f = new Dictionary<string, DateTime>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
  private Timer? G;
  private readonly object g = new object();
  private readonly Dictionary<int, DateTime> H = new Dictionary<int, DateTime>();
  private static readonly TimeSpan h = TimeSpan.FromMinutes(30.0);
  private readonly HashSet<string> I = new HashSet<string>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
  private readonly HashSet<string> i = new HashSet<string>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
  private readonly HashSet<string> J = new HashSet<string>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
  private readonly HashSet<string> j = new HashSet<string>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
  private readonly HashSet<string> K = new HashSet<string>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
  private readonly ConcurrentDictionary<string, bool> k = new ConcurrentDictionary<string, bool>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);

  public event EventHandler<A.e>? FileOperationDetected;

  public event EventHandler<A.f>? ThreatDetected;

  public A([In] RansomGuardConfig obj0)
  {
    this.B = obj0 ?? new RansomGuardConfig();
    this.A = new A.a();
    this.a = new A.l(this.B, this);
    this.a.ThreatDetected += new EventHandler<A.f>(this.A);
    this.b = Process.GetCurrentProcess().Id;
    this.A.FileEvent += new EventHandler<A.d>(this.A);
    this.A.FileRenameEvent += new EventHandler<A.E>(this.A);
    this.D();
    this.C();
    this.c();
    this.b();
    this.G = new Timer((TimerCallback) delegate
    {
      this.B();
    }, (object) null, 30000, 300000);
  }

  public void A() => this.A.A();

  public void a() => this.A.a();

  public void Dispose()
  {
    try
    {
      this.G?.Dispose();
    }
    catch
    {
    }
    try
    {
      this.A?.Dispose();
    }
    catch
    {
    }
  }

  private static void A([In] string obj0, [In] Exception obj1)
  {
    try
    {
      string str1 = Path.Combine(Environment.GetFolderPath((Environment.SpecialFolder) 35), F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.A());
      Directory.CreateDirectory(str1);
      string str2 = Path.Combine(str1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.a());
      DefaultInterpolatedStringHandler interpolatedStringHandler = new DefaultInterpolatedStringHandler(5, 3);
      interpolatedStringHandler.AppendFormatted<DateTime>(DateTime.Now, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.B());
      interpolatedStringHandler.AppendLiteral(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.b());
      interpolatedStringHandler.AppendFormatted(obj0);
      interpolatedStringHandler.AppendLiteral(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.C());
      interpolatedStringHandler.AppendFormatted<Exception>(obj1);
      interpolatedStringHandler.AppendLiteral(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.c());
      string stringAndClear = interpolatedStringHandler.ToStringAndClear();
      File.AppendAllText(str2, stringAndClear);
    }
    catch
    {
    }
  }

  private void B()
  {
    try
    {
      this.a.A();
      this.A.b();
      DateTime dateTime = DateTime.UtcNow.AddSeconds(-60.0);
      lock (this.e)
      {
        List<string> stringList = new List<string>();
        foreach (KeyValuePair<string, DateTime> keyValuePair in this.F)
        {
          if (DateTime.op_LessThan(keyValuePair.Value, dateTime))
            stringList.Add(keyValuePair.Key);
        }
        foreach (string str in stringList)
          this.F.Remove(str);
        stringList.Clear();
        foreach (KeyValuePair<string, DateTime> keyValuePair in this.f)
        {
          if (DateTime.op_LessThan(keyValuePair.Value, dateTime))
            stringList.Add(keyValuePair.Key);
        }
        foreach (string str in stringList)
          this.f.Remove(str);
      }
      lock (this.g)
      {
        // ISSUE: object of a compiler-generated type is created
        // ISSUE: reference to a compiler-generated method
        foreach (int num in Enumerable.ToList<int>(Enumerable.Select<KeyValuePair<int, DateTime>, int>(Enumerable.Where<KeyValuePair<int, DateTime>>((IEnumerable<KeyValuePair<int, DateTime>>) this.H, new Func<KeyValuePair<int, DateTime>, bool>(new A.A.a()
        {
          Di = DateTime.op_Subtraction(DateTime.UtcNow, A.A.h)
        }.A)), (Func<KeyValuePair<int, DateTime>, int>) (([In] obj0) => obj0.Key))))
          this.H.Remove(num);
      }
      if (this.C.Count > 1000)
        this.C.Clear();
      n.C();
    }
    catch
    {
    }
  }

  private void b()
  {
    try
    {
      string folderPath1 = Environment.GetFolderPath((Environment.SpecialFolder) 40);
      if (!string.IsNullOrEmpty(folderPath1))
      {
        this.K.Add(Path.Combine(folderPath1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.D()));
        this.K.Add(Path.Combine(folderPath1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.d()));
        this.K.Add(Path.Combine(folderPath1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.E()));
        this.K.Add(Path.Combine(folderPath1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.e()));
        this.K.Add(Path.Combine(folderPath1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.F()));
        this.K.Add(Path.Combine(folderPath1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.f()));
        this.K.Add(Path.Combine(folderPath1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.G()));
        this.K.Add(Path.Combine(folderPath1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.g()));
        this.K.Add(Path.Combine(folderPath1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.H()));
      }
      string folderPath2 = Environment.GetFolderPath((Environment.SpecialFolder) 46);
      if (string.IsNullOrEmpty(folderPath2))
        return;
      string directoryName = Path.GetDirectoryName(folderPath2);
      if (string.IsNullOrEmpty(directoryName))
        return;
      this.K.Add(Path.Combine(directoryName, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.D()));
      this.K.Add(Path.Combine(directoryName, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.d()));
      this.K.Add(Path.Combine(directoryName, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.E()));
      this.K.Add(Path.Combine(directoryName, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.e()));
      this.K.Add(Path.Combine(directoryName, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.F()));
    }
    catch
    {
    }
  }

  private bool A([In] string obj0, [In] string obj1, [In] string obj2, [In] string obj3)
  {
    try
    {
      if (string.IsNullOrWhiteSpace(obj0) || string.IsNullOrWhiteSpace(obj1))
        return false;
      string str = A.A.D(obj0);
      Path.GetDirectoryName(obj0);
      if (obj1.Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.h(), (StringComparison) 5) || obj1.Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.I(), (StringComparison) 5) || obj1.Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.i(), (StringComparison) 5) || obj1.Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.J(), (StringComparison) 5))
        return true;
      if (this.a(obj0))
        return false;
      if (A.h.bq.Contains(str))
        return true;
      return obj1.Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.j(), (StringComparison) 5) || obj1.Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.K(), (StringComparison) 5) || obj1.Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.k(), (StringComparison) 5) || obj1.Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.L(), (StringComparison) 5) ? this.b(obj2) || A.h.bQ.Contains(str) || this.A(obj0) : !obj1.Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.l(), (StringComparison) 5) || this.b(obj2) || this.A(obj0) && A.h.bQ.Contains(str);
    }
    catch
    {
      return true;
    }
  }

  private bool A([In] string obj0)
  {
    if (string.IsNullOrEmpty(obj0))
      return false;
    string str1 = Path.GetDirectoryName(obj0);
    if (string.IsNullOrEmpty(str1))
      str1 = !obj0.Contains('\\') ? obj0 : Path.GetPathRoot(obj0);
    if (string.IsNullOrEmpty(str1))
      return false;
    string str2 = str1.TrimEnd('\\') + F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.M();
    bool flag1;
    if (this.k.TryGetValue(str2, ref flag1))
      return flag1;
    bool flag2 = false;
    foreach (string str3 in this.K)
    {
      if (str2.StartsWith(str3, (StringComparison) 5))
      {
        flag2 = true;
        break;
      }
    }
    if (this.k.Count < 5000)
      this.k[str2] = flag2;
    return flag2;
  }

  private bool a([In] string obj0)
  {
    if (string.IsNullOrEmpty(obj0))
      return false;
    string str = A.A.D(obj0);
    return A.h.bR.Contains(str);
  }

  private bool B([In] string obj0) => !string.IsNullOrEmpty(obj0) && A.h.br.Contains(obj0);

  private bool b([In] string obj0) => !string.IsNullOrEmpty(obj0) && A.h.bS.Contains(obj0);

  private async void A(object? sender, [In] A.f obj1)
  {
    A.A a = this;
    if (obj1 == null)
      return;
    lock (a.g)
    {
      DateTime utcNow = DateTime.UtcNow;
      List<int> intList = (List<int>) null;
      foreach (KeyValuePair<int, DateTime> keyValuePair in a.H)
      {
        if (TimeSpan.op_GreaterThan(DateTime.op_Subtraction(utcNow, keyValuePair.Value), A.A.h))
          (intList ?? (intList = new List<int>())).Add(keyValuePair.Key);
      }
      if (intList != null)
      {
        foreach (int num in intList)
          a.H.Remove(num);
      }
      if (a.H.ContainsKey(obj1.A()))
        return;
      a.H[obj1.A()] = utcNow;
    }
    try
    {
      await A.c.A(obj1).ConfigureAwait(false);
    }
    catch
    {
    }
    try
    {
      if (string.Equals(obj1.ff, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.gt(), (StringComparison) 5))
        A.L.A(obj1.A());
    }
    catch
    {
    }
    // ISSUE: reference to a compiler-generated field
    EventHandler<A.f> l = a.l;
    if (l == null)
      return;
    l((object) a, obj1);
  }

  private void A(object? sender, [In] A.d obj1)
  {
    string text = this.d(obj1.B()) ?? obj1.B();
    try
    {
      if (obj1.A() <= 4 || obj1.A() == this.b || text.IndexOf(':', 2) > 0)
        return;
      string str1 = obj1.Fz ?? F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.m();
      if (this.B.b(str1) || this.c(text) || !A.A.a(text.AsSpan()) || this.A(text.AsSpan()))
        return;
      string str2 = obj1.FZ ?? (!string.IsNullOrWhiteSpace(obj1.Fz) ? Path.GetFileName(obj1.Fz) : (string) null) ?? F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.m();
      if (!this.A(text, obj1.C(), str2, str1))
        return;
      this.a.A(obj1.A(), str2, str1, text, obj1.C());
      bool flag = obj1.C().Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.h(), (StringComparison) 5) || obj1.C().Equals(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.I(), (StringComparison) 5);
      if (!flag && this.A(obj1.A(), obj1.C(), text) || flag && this.C(text))
        return;
      // ISSUE: reference to a compiler-generated field
      EventHandler<A.e> l = this.L;
      if (l == null)
        return;
      A.e e = new A.e();
      e.A(text);
      e.a(A.I.A(obj1.C()));
      e.A(obj1.A());
      e.fb = A.I.A(str2);
      e.fB = A.I.A(str1);
      e.A(DateTime.Now);
      e.C(Path.GetExtension(text)?.ToLowerInvariant() ?? string.Empty);
      l((object) this, e);
    }
    catch
    {
    }
  }

  private void A(object? sender, [In] A.E obj1)
  {
    if (obj1.B() <= 4 || obj1.B() == this.b)
      return;
    string str1 = this.d(obj1.a());
    string str2 = this.d(obj1.A());
    if (string.IsNullOrWhiteSpace(str1))
      return;
    if (string.IsNullOrWhiteSpace(str2))
      return;
    try
    {
      string str3 = obj1.fa ?? F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.m();
      if (this.B.b(str3) || this.c(str1) || this.c(str2))
        return;
      string str4 = obj1.fA ?? F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.m();
      if (this.a(str1) && this.a(str2))
        return;
      this.a.A(obj1.B(), str4, str3, str1, F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.i());
      if (this.A(obj1.B(), F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.i(), str1))
        return;
      // ISSUE: reference to a compiler-generated field
      EventHandler<A.e> l = this.L;
      if (l == null)
        return;
      A.e e = new A.e();
      e.A(str2 + F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.N() + str1);
      e.a(A.I.A(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.i()));
      e.A(obj1.B());
      e.fb = A.I.A(str4);
      e.fB = A.I.A(str3);
      e.A(DateTime.Now);
      e.C(Path.GetExtension(str1)?.ToLowerInvariant() ?? string.Empty);
      l((object) this, e);
    }
    catch
    {
    }
  }

  private bool A([In] int obj0, [In] string obj1, [In] string obj2)
  {
    DefaultInterpolatedStringHandler interpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 3);
    interpolatedStringHandler.AppendFormatted<int>(obj0);
    interpolatedStringHandler.AppendLiteral(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.n());
    interpolatedStringHandler.AppendFormatted(obj1);
    interpolatedStringHandler.AppendLiteral(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.n());
    interpolatedStringHandler.AppendFormatted(obj2);
    string stringAndClear = interpolatedStringHandler.ToStringAndClear();
    DateTime utcNow = DateTime.UtcNow;
    lock (this.e)
    {
      DateTime dateTime;
      if (this.F.TryGetValue(stringAndClear, ref dateTime))
      {
        if (DateTime.op_Subtraction(utcNow, dateTime).TotalMilliseconds < 500.0)
          return true;
        this.F[stringAndClear] = utcNow;
        return false;
      }
      this.F[stringAndClear] = utcNow;
      return false;
    }
  }

  private bool C([In] string obj0)
  {
    DateTime utcNow = DateTime.UtcNow;
    lock (this.e)
    {
      DateTime dateTime;
      if (this.f.TryGetValue(obj0, ref dateTime))
      {
        if (DateTime.op_Subtraction(utcNow, dateTime).TotalSeconds < 5.0)
          return true;
        this.f[obj0] = utcNow;
        return false;
      }
      this.f[obj0] = utcNow;
      return false;
    }
  }

  public void C()
  {
    this.I.Clear();
    this.i.Clear();
    foreach (string ignoredExtension in this.B.IgnoredExtensions)
    {
      if (!string.IsNullOrWhiteSpace(ignoredExtension))
      {
        string str = ignoredExtension.Trim();
        if (!str.StartsWith(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.O()))
          str = F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.O() + str;
        this.I.Add(str.ToLowerInvariant());
      }
    }
    foreach (string str1 in A.C.aO)
    {
      if (!string.IsNullOrWhiteSpace(str1))
      {
        string str2 = str1.Trim();
        if (!str2.StartsWith(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.O()))
          str2 = F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.O() + str2;
        this.i.Add(str2.ToLowerInvariant());
      }
    }
  }

  public void c()
  {
    this.J.Clear();
    this.j.Clear();
    foreach (string ignoredDirectory in this.B.IgnoredDirectories)
    {
      if (!string.IsNullOrWhiteSpace(ignoredDirectory))
      {
        string str = ignoredDirectory.Trim().ToLowerInvariant().Replace(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.o(), F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.M());
        if (str.Length > 0 && str[str.Length - 1] != '\\')
          str += F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.M();
        this.J.Add(str);
      }
    }
    foreach (string str1 in A.C.ao)
    {
      if (!string.IsNullOrWhiteSpace(str1))
      {
        string str2 = str1.Trim().Replace(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.o(), F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.M());
        if (str2.EndsWith(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.M()))
          str2 = str2.Substring(0, str2.Length - 1);
        this.j.Add(str2);
      }
    }
  }

  private bool c([In] string? obj0)
  {
    if (string.IsNullOrWhiteSpace(obj0))
      return false;
    string lowerInvariant = new string(A.A.B(obj0.AsSpan())).ToLowerInvariant();
    foreach (string str in this.J)
    {
      if (lowerInvariant.StartsWith(str, (StringComparison) 4))
        return true;
    }
    int length = lowerInvariant.LastIndexOfAny(new char[2]
    {
      '\\',
      '/'
    });
    if (length >= 0)
    {
      string str1 = new string(lowerInvariant.AsSpan(0, length));
      foreach (string str2 in this.j)
      {
        if (str1.Equals(str2, (StringComparison) 5))
          return true;
      }
    }
    return false;
  }

  private bool A([In] ReadOnlySpan<char> obj0)
  {
    int num1 = obj0.LastIndexOfAny<char>('\\', '/');
    int num2 = obj0.LastIndexOf<char>('.');
    if (num2 <= num1 || num2 < 0)
      return false;
    ref ReadOnlySpan<char> local = ref obj0;
    int num3 = num2;
    string lowerInvariant = new string(local.Slice(num3, local.Length - num3)).ToLowerInvariant();
    return this.i.Contains(lowerInvariant) || this.I.Contains(lowerInvariant);
  }

  private static bool a([In] ReadOnlySpan<char> obj0)
  {
    int num1 = obj0.LastIndexOfAny<char>('\\', '/');
    int num2 = obj0.LastIndexOf<char>('.');
    return num2 > num1 && num2 >= 0;
  }

  private static string D([In] string obj0)
  {
    ReadOnlySpan<char> span = obj0.AsSpan();
    int num1 = span.LastIndexOfAny<char>('\\', '/');
    int num2 = span.LastIndexOf<char>('.');
    if (num2 <= num1 || num2 < 0)
      return string.Empty;
    ref ReadOnlySpan<char> local = ref span;
    int num3 = num2;
    return new string(local.Slice(num3, local.Length - num3)).ToLowerInvariant();
  }

  private static ReadOnlySpan<char> B([In] ReadOnlySpan<char> obj0)
  {
    int length = obj0.Length;
    while (length > 0 && (obj0[length - 1] == '\\' || obj0[length - 1] == '/'))
      --length;
    return obj0.Slice(0, length);
  }

  public void A([In] int obj0)
  {
    lock (this.g)
      this.H.Remove(obj0);
    this.a.A();
  }

  private void D()
  {
    try
    {
      lock (this.d)
      {
        this.c.Clear();
        this.D.Clear();
        foreach (string logicalDrive in Environment.GetLogicalDrives())
        {
          // ISSUE: object of a compiler-generated type is created
          // ISSUE: variable of a compiler-generated type
          A.A.B b = new A.A.B();
          // ISSUE: reference to a compiler-generated field
          b.DJ = logicalDrive.TrimEnd(new char[2]
          {
            '\\',
            '/'
          });
          // ISSUE: reference to a compiler-generated field
          b.Dj = new StringBuilder(260);
          try
          {
            // ISSUE: reference to a compiler-generated field
            b.DK = 0;
            // ISSUE: reference to a compiler-generated method
            if (Task.Run(new Action(b.A)).Wait(TimeSpan.FromSeconds(5.0)))
            {
              // ISSUE: reference to a compiler-generated field
              if (b.DK != 0)
              {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                this.c[b.Dj.ToString().TrimEnd(char.MinValue)] = b.DJ;
              }
            }
          }
          catch
          {
          }
        }
        foreach (string logicalDrive in Environment.GetLogicalDrives())
        {
          char[] chArray = new char[2]{ '\\', '/' };
          string str1 = logicalDrive.TrimEnd(chArray);
          StringBuilder stringBuilder1 = new StringBuilder(260);
          StringBuilder stringBuilder2 = new StringBuilder(260);
          if (A.G.A(str1 + F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.M(), stringBuilder1, stringBuilder1.Capacity, out uint _, out uint _, out uint _, stringBuilder2, stringBuilder2.Capacity))
          {
            string str2 = stringBuilder1.ToString().TrimEnd(char.MinValue);
            if (str2.StartsWith(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.P(), (StringComparison) 5))
              this.D[str2] = str1;
          }
        }
      }
    }
    catch
    {
    }
  }

  private string? d([In] string? obj0)
  {
    return string.IsNullOrWhiteSpace(obj0) ? (string) null : this.C.GetOrAdd(obj0, new Func<string, string>(this.E));
  }

  private string E([In] string obj0)
  {
    try
    {
      ReadOnlySpan<char> span = obj0.AsSpan();
      int num = span.Length < 3 || span[1] != ':' ? 0 : (span[2] == '\\' ? 1 : (span[2] == '/' ? 1 : 0));
      bool flag = span.StartsWith(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.p().AsSpan(), StringComparison.OrdinalIgnoreCase);
      if (num != 0)
      {
        if (obj0.IndexOf(':', 2) > 0)
          return obj0;
        try
        {
          return Path.GetFullPath(obj0);
        }
        catch
        {
          return obj0;
        }
      }
      else
      {
        if (flag)
        {
          string[] strArray = obj0.Split('\\', (StringSplitOptions) 0);
          if (strArray.Length >= 4 && !string.IsNullOrWhiteSpace(strArray[2]))
          {
            if (!string.IsNullOrWhiteSpace(strArray[3]))
            {
              try
              {
                return Path.GetFullPath(obj0);
              }
              catch
              {
                return obj0;
              }
            }
          }
          return obj0;
        }
        if (span.StartsWith(F5D1BF18\u002D5FBA\u002D43C1\u002DA4E0\u002D6D909C027158.Q().AsSpan(), StringComparison.OrdinalIgnoreCase))
        {
          string str = obj0;
          return str.Substring(4, str.Length - 4);
        }
        lock (this.d)
        {
          foreach (KeyValuePair<string, string> keyValuePair in this.D)
          {
            if (span.StartsWith(keyValuePair.Key.AsSpan(), StringComparison.OrdinalIgnoreCase))
            {
              string str = obj0.Substring(keyValuePair.Key.Length);
              return keyValuePair.Value + str;
            }
          }
          foreach (KeyValuePair<string, string> keyValuePair in this.c)
          {
            if (span.StartsWith(keyValuePair.Key.AsSpan(), StringComparison.OrdinalIgnoreCase))
            {
              string str = obj0.Substring(keyValuePair.Key.Length);
              return keyValuePair.Value + str;
            }
          }
        }
        if (TimeSpan.op_GreaterThan(DateTime.op_Subtraction(DateTime.UtcNow, this.E), TimeSpan.FromMinutes(5.0)))
        {
          this.E = DateTime.UtcNow;
          Task.Run(new Action(this.D));
        }
        return obj0;
      }
    }
    catch
    {
      return obj0;
    }
  }

  public double e([In] string obj0)
  {
    try
    {
      if (!File.Exists(obj0))
        return 0.0;
      using (FileStream fileStream = new FileStream(obj0, (FileMode) 3, (FileAccess) 1, (FileShare) 3))
      {
        long length = ((Stream) fileStream).Length;
        if (length <= 0L)
          return 0.0;
        if (length <= 4096L /*0x1000*/)
        {
          byte[] numArray = new byte[length];
          int num = ((Stream) fileStream).Read(numArray, 0, numArray.Length);
          return num <= 0 ? 0.0 : A.A.A(numArray, num);
        }
        byte[] numArray1 = new byte[24576 /*0x6000*/];
        int num1 = 0;
        ((Stream) fileStream).Position = 0L;
        int num2 = ((Stream) fileStream).Read(numArray1, 0, 8192 /*0x2000*/);
        int num3 = num1 + num2;
        long num4 = Math.Max(0L, length / 2L - 4096L /*0x1000*/);
        ((Stream) fileStream).Position = num4;
        int num5 = ((Stream) fileStream).Read(numArray1, num3, 8192 /*0x2000*/);
        int num6 = num3 + num5;
        long num7 = Math.Max(0L, length - 8192L /*0x2000*/);
        ((Stream) fileStream).Position = num7;
        int num8 = ((Stream) fileStream).Read(numArray1, num6, 8192 /*0x2000*/);
        int num9 = num6 + num8;
        return num9 <= 0 ? 0.0 : A.A.A(numArray1, num9);
      }
    }
    catch
    {
      return 0.0;
    }
  }

  private static double A([In] byte[] obj0, [In] int obj1)
  {
    Span<int> span = stackalloc int[256 /*0x0100*/];
    for (int index = 0; index < obj1; ++index)
      ++span[(int) obj0[index]];
    double num1 = 0.0;
    double num2 = (double) obj1;
    for (int index = 0; index < 256 /*0x0100*/; ++index)
    {
      if (span[index] != 0)
      {
        double num3 = (double) span[index] / num2;
        num1 -= num3 * Math.Log(num3, 2.0);
      }
    }
    return num1;
  }
}
