// Decompiled with JetBrains decompiler
// Type: .
// Assembly: WindowsBC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9909ee17073e3364
// MVID: 658BFC85-36E1-493D-98E6-AE9127D73D60
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare.00004-msil\Trojan-Downloader.MSIL.BitCoinMiner.c-64f742a0b28b2c3d2a62ef6607fcfd5fa55b793a1aff3a6c11e014e3b119149e.exe

using \u0005;
using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.InteropServices;

namespace \u0005
{
  internal static class \u0004
  {
    private static ModuleHandle \u0001;
    private static char[] \u0002 = new char[58]
    {
      '\u0001',
      '\u0002',
      '\u0003',
      '\u0004',
      '\u0005',
      '\u0006',
      '\a',
      '\b',
      '\u000E',
      '\u000F',
      '\u0010',
      '\u0011',
      '\u0012',
      '\u0013',
      '\u0014',
      '\u0015',
      '\u0016',
      '\u0017',
      '\u0018',
      '\u0019',
      '\u001A',
      '\u001B',
      '\u001C',
      '\u001D',
      '\u001E',
      '\u001F',
      '\u007F',
      '\u0080',
      '\u0081',
      '\u0082',
      '\u0083',
      '\u0084',
      '\u0086',
      '\u0087',
      '\u0088',
      '\u0089',
      '\u008A',
      '\u008B',
      '\u008C',
      '\u008D',
      '\u008E',
      '\u008F',
      '\u0090',
      '\u0091',
      '\u0092',
      '\u0093',
      '\u0094',
      '\u0095',
      '\u0096',
      '\u0097',
      '\u0098',
      '\u0099',
      '\u009A',
      '\u009B',
      '\u009C',
      '\u009D',
      '\u009E',
      '\u009F'
    };

    public static void \u0008\u0003([In] int obj0)
    {
      Type typeFromHandle;
      try
      {
        typeFromHandle = Type.GetTypeFromHandle(\u0004.\u0001.ResolveTypeHandle(33554433 + obj0));
      }
      catch
      {
        return;
      }
      foreach (FieldInfo field in typeFromHandle.GetFields(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.GetField))
      {
        string name = field.Name;
        bool flag = false;
        int num = 0;
        for (int index1 = name.Length - 1; index1 >= 0; --index1)
        {
          char ch = name[index1];
          if (ch == '~')
          {
            flag = true;
            break;
          }
          for (int index2 = 0; index2 < 58; ++index2)
          {
            if ((int) \u0004.\u0002[index2] == (int) ch)
            {
              num = num * 58 + index2;
              break;
            }
          }
        }
        MethodInfo methodFromHandle;
        try
        {
          methodFromHandle = (MethodInfo) MethodBase.GetMethodFromHandle(\u0004.\u0001.ResolveMethodHandle(num + 167772161));
        }
        catch
        {
          continue;
        }
        Delegate @delegate;
        if (methodFromHandle.IsStatic)
        {
          try
          {
            @delegate = Delegate.CreateDelegate(field.FieldType, methodFromHandle);
          }
          catch (Exception ex)
          {
            continue;
          }
        }
        else
        {
          ParameterInfo[] parameters = methodFromHandle.GetParameters();
          int length = parameters.Length + 1;
          Type[] parameterTypes = new Type[length];
          parameterTypes[0] = typeof (object);
          for (int index = 1; index < length; ++index)
            parameterTypes[index] = parameters[index - 1].ParameterType;
          DynamicMethod dynamicMethod = new DynamicMethod(string.Empty, methodFromHandle.ReturnType, parameterTypes, typeFromHandle, true);
          ILGenerator ilGenerator = dynamicMethod.GetILGenerator();
          ilGenerator.Emit(OpCodes.Ldarg_0);
          if (length > 1)
            ilGenerator.Emit(OpCodes.Ldarg_1);
          if (length > 2)
            ilGenerator.Emit(OpCodes.Ldarg_2);
          if (length > 3)
            ilGenerator.Emit(OpCodes.Ldarg_3);
          if (length > 4)
          {
            for (int index = 4; index < length; ++index)
              ilGenerator.Emit(OpCodes.Ldarg_S, index);
          }
          ilGenerator.Emit(flag ? OpCodes.Callvirt : OpCodes.Call, methodFromHandle);
          ilGenerator.Emit(OpCodes.Ret);
          try
          {
            @delegate = dynamicMethod.CreateDelegate(typeFromHandle);
          }
          catch
          {
            continue;
          }
        }
        try
        {
          field.SetValue((object) null, (object) @delegate);
        }
        catch
        {
        }
      }
    }

    static \u0004()
    {
      if ((object) typeof (MulticastDelegate) == null)
        return;
      \u0004.\u0001 = Assembly.GetExecutingAssembly().GetModules()[0].ModuleHandle;
    }
  }
}
