MalwareSourceCode/MSIL/Trojan/Win32/F/Trojan.Win32.Fsysna.dljm-a7abcca3397d1344b43d53c1427609ca1808f1991c5d2b158fd67c1ea3e6f19a/InstanceUnique.cs
2022-08-18 06:28:56 -05:00

37 lines
944 B
C#

// Decompiled with JetBrains decompiler
// Type: Hearding_Bot.InstanceUnique
// Assembly: Hearding Bot, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 931E7B23-EA6E-4139-8BD0-1A4E0BF9E258
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Trojan.Win32.Fsysna.dljm-a7abcca3397d1344b43d53c1427609ca1808f1991c5d2b158fd67c1ea3e6f19a.exe
using System;
using System.Threading;
namespace Hearding_Bot
{
internal class InstanceUnique : IDisposable
{
private readonly Mutex mMutex;
private bool _mMutexOwned;
public InstanceUnique(string name)
{
this.mMutex = new Mutex(false, name);
this._mMutexOwned = false;
}
public void Dispose()
{
if (!this._mMutexOwned)
return;
this.mMutex.ReleaseMutex();
}
public bool IsRunning()
{
this._mMutexOwned = this.mMutex.WaitOne(0, true);
return !this._mMutexOwned;
}
}
}