// Decompiled with JetBrains decompiler
// Type: SmartAssembly.MemoryManagement.MemoryManager
// Assembly: WinData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 162322D2-FE3A-45B9-99E4-3519564A1D4D
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare.00004-msil\Trojan-Ransom.Win32.Blocker.kkro-82cd479bb60c59525668e5016b400a8cc48f04b14a5c6cad5e2c6046b301e79d.exe

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace SmartAssembly.MemoryManagement
{
  public sealed class MemoryManager
  {
    private static MemoryManager \u0001;
    private long \u0001 = DateTime.Now.Ticks;

    [DllImport("kernel32", EntryPoint = "SetProcessWorkingSetSize")]
    private static extern int \u0001(
      IntPtr process,
      int minimumWorkingSetSize,
      int maximumWorkingSetSize);

    private void \u0001()
    {
      try
      {
        using (Process currentProcess = Process.GetCurrentProcess())
          MemoryManager.\u0001(currentProcess.Handle, -1, -1);
      }
      catch
      {
      }
    }

    private void \u0001(object sender, EventArgs e)
    {
      try
      {
        long ticks = DateTime.Now.Ticks;
        if (ticks - this.\u0001 <= 10000000L)
          return;
        this.\u0001 = ticks;
        this.\u0001();
      }
      catch
      {
      }
    }

    private MemoryManager()
    {
      Application.Idle += new EventHandler(this.\u0001);
      this.\u0001();
    }

    public static void AttachApp()
    {
      try
      {
        if (Environment.OSVersion.Platform != PlatformID.Win32NT)
          return;
        MemoryManager.\u0001 = new MemoryManager();
      }
      catch
      {
      }
    }
  }
}
