// Decompiled with JetBrains decompiler
// Type: SmartAssembly.MemoryManagement.MemoryManager
// Assembly: CSPharm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=91f7ba0f4234404d
// MVID: E3EED34E-DEA0-448A-9147-166831419ACC
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00002-msil\Trojan-Downloader.Win32.Dapato.lnd-7f2f48002f973886553b938cc98149108eb2e39f2ac47324d3c731a4208c60fd.exe

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

namespace SmartAssembly.MemoryManagement
{
  public sealed class MemoryManager
  {
    internal 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
      {
      }
    }

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