├── Protection ├── InvalidMD │ ├── MindLated.png.cs │ └── InvalidMDPhase.cs ├── Arithmetic │ ├── iFunction.cs │ ├── Value.cs │ ├── ArithmeticTypes.cs │ ├── Token.cs │ ├── ArithmeticVT.cs │ ├── Generator │ │ └── Generator.cs │ ├── Functions │ │ ├── Add.cs │ │ ├── Div.cs │ │ ├── Mul.cs │ │ ├── Sub.cs │ │ ├── Xor.cs │ │ └── Maths │ │ │ ├── Cos.cs │ │ │ ├── Log.cs │ │ │ ├── Sin.cs │ │ │ ├── Sqrt.cs │ │ │ ├── Tan.cs │ │ │ ├── Tanh.cs │ │ │ ├── Abs.cs │ │ │ ├── Floor.cs │ │ │ ├── Log10.cs │ │ │ ├── Round.cs │ │ │ ├── Ceiling.cs │ │ │ └── Truncate.cs │ ├── Utils │ │ └── ArithmeticUtils.cs │ ├── ArithmeticEmulator.cs │ └── Arithmetic.cs ├── StringOnline │ ├── Decoder.php │ ├── OnlineStringClass.cs │ └── OnlinePhase.cs ├── CtrlFlow │ ├── Block.cs │ ├── JumpCFlow.cs │ ├── BlockParser.cs │ └── ControlFlowObfuscation.cs ├── Anti │ ├── AntiDe4dot.cs │ ├── Anti Dump.cs │ ├── Anti Debug.cs │ ├── Antimanything.cs │ ├── Runtime │ │ ├── EOFAntiTamper.cs │ │ ├── AntiDebug.Safe.cs │ │ ├── SelfDeleteClass.cs │ │ └── AntiDumpRun.cs │ └── Anti Tamper.cs ├── Other │ ├── Watermark.cs │ ├── StackUnfConfusion.cs │ └── Calli.cs ├── Proxy │ ├── ProxyString.cs │ ├── ProxyINT.cs │ └── ProxyMeth.cs ├── LocalF │ ├── L2FV2.cs │ └── L2F.cs ├── String │ ├── EncryptionHelper.cs │ └── StringEncPhase.cs ├── INT │ └── AddIntPhase.cs └── Renamer │ └── RenamerPhase.cs ├── .gitignore ├── MindLated.csproj.user ├── .github ├── dependabot.yml └── FUNDING.yml ├── Program.cs ├── GlobalSuppressions.cs ├── MindLated.csproj ├── LICENSE ├── MindLated.sln ├── README.md ├── Properties ├── Resources.Designer.cs └── Resources.resx ├── Services └── InjectHelper.cs ├── Form1.cs └── Form1.Designer.cs /Protection/InvalidMD/MindLated.png.cs: -------------------------------------------------------------------------------- 1 | namespace MindLated.Protection.InvalidMD 2 | { 3 | public static class MindLatedPng 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/bin/* 2 | **/obj/* 3 | .vs/MindLated/v16/.suo 4 | /.vs/MindLated/v17 5 | *.vsidx 6 | *.lock 7 | MindLated.sln.DotSettings.user 8 | .vs/MindLated/DesignTimeBuild/.dtbcache.v2 9 | -------------------------------------------------------------------------------- /Protection/Arithmetic/iFunction.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | 4 | namespace MindLated.Protection.Arithmetic 5 | { 6 | public abstract class Function 7 | { 8 | public abstract ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module); 9 | } 10 | } -------------------------------------------------------------------------------- /MindLated.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Form 7 | 8 | 9 | -------------------------------------------------------------------------------- /Protection/StringOnline/Decoder.php: -------------------------------------------------------------------------------- 1 | _x; 15 | 16 | public double GetY() => _y; 17 | } 18 | } -------------------------------------------------------------------------------- /Protection/CtrlFlow/Block.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet.Emit; 2 | using System.Collections.Generic; 3 | 4 | namespace MindLated.Protection.CtrlFlow 5 | { 6 | public class Block 7 | { 8 | public Block() 9 | { 10 | Instructions = new List(); 11 | } 12 | 13 | public List Instructions { get; set; } 14 | 15 | public int Number { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/ArithmeticTypes.cs: -------------------------------------------------------------------------------- 1 | namespace MindLated.Protection.Arithmetic 2 | { 3 | public enum ArithmeticTypes 4 | { 5 | Add, // + 6 | Sub, // - 7 | Div, // / 8 | Mul, // * 9 | Xor, // ^ 10 | Abs, // -1 11 | Log, // 12 | Log10, 13 | Sin, 14 | Cos, 15 | Round, 16 | Sqrt, 17 | Ceiling, 18 | Floor, 19 | Tan, 20 | Tanh, 21 | Truncate 22 | } 23 | } -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "nuget" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace MindLated 5 | { 6 | internal static class Program 7 | { 8 | /// 9 | /// The main entry point for the application. 10 | /// 11 | [STAThread] 12 | private static void Main() 13 | { 14 | Application.SetHighDpiMode(HighDpiMode.SystemAware); 15 | Application.EnableVisualStyles(); 16 | Application.SetCompatibleTextRenderingDefault(false); 17 | Application.Run(new Form1()); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/StringOnline/OnlineStringClass.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Reflection; 3 | 4 | namespace MindLated.Protection.StringOnline 5 | { 6 | internal class OnlineString 7 | { 8 | public static string Decoder(string encrypted) 9 | { 10 | if (Assembly.GetExecutingAssembly() != Assembly.GetCallingAssembly()) return "MindLated.png"; 11 | var webClient = new WebClient(); 12 | return webClient.DownloadString($"https://communitykeyv1.000webhostapp.com/Decoder4.php?string={encrypted}"); //this host don't work anymore you need to have your proper host 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Token.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet.Emit; 2 | 3 | namespace MindLated.Protection.Arithmetic 4 | { 5 | public class Token 6 | { 7 | private readonly OpCode? _opCode; 8 | private readonly object _operand; 9 | 10 | public Token(OpCode? opCode, object operand) 11 | { 12 | _opCode = opCode; 13 | _operand = operand; 14 | } 15 | 16 | public Token(OpCode? opCode) 17 | { 18 | _opCode = opCode; 19 | _operand = null!; 20 | } 21 | 22 | public OpCode? GetOpCode() => _opCode; 23 | 24 | public object GetOperand() => _operand; 25 | } 26 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/ArithmeticVT.cs: -------------------------------------------------------------------------------- 1 | namespace MindLated.Protection.Arithmetic 2 | { 3 | public class ArithmeticVt 4 | { 5 | private readonly Value _value; 6 | private readonly Token _token; 7 | private readonly ArithmeticTypes _arithmeticTypes; 8 | 9 | public ArithmeticVt(Value value, Token token, ArithmeticTypes arithmeticTypes) 10 | { 11 | _value = value; 12 | _token = token; 13 | _arithmeticTypes = arithmeticTypes; 14 | } 15 | 16 | public Value GetValue() => _value; 17 | 18 | public Token GetToken() => _token; 19 | 20 | public ArithmeticTypes GetArithmetic() => _arithmeticTypes; 21 | } 22 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Generator/Generator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MindLated.Protection.Arithmetic.Generator 4 | { 5 | public class Generator 6 | { 7 | private readonly Random _random; 8 | 9 | public Generator() 10 | { 11 | _random = new Random(Guid.NewGuid().GetHashCode()); 12 | } 13 | 14 | public int Next() 15 | { 16 | return _random.Next(int.MaxValue); 17 | } 18 | 19 | public int Next(int value) 20 | { 21 | return _random.Next(value); 22 | } 23 | 24 | public int Next(int min, int max) 25 | { 26 | return _random.Next(min, max); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Add.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | 5 | namespace MindLated.Protection.Arithmetic.Functions 6 | { 7 | public class Add : Function 8 | { 9 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Add; 10 | 11 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 12 | { 13 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 14 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 15 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(), arithmeticEmulator.GetY()), new Token(OpCodes.Add), ArithmeticTypes); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Div.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | 5 | namespace MindLated.Protection.Arithmetic.Functions 6 | { 7 | public class Div : Function 8 | { 9 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Div; 10 | 11 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 12 | { 13 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 14 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 15 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(), arithmeticEmulator.GetY()), new Token(OpCodes.Div), ArithmeticTypes); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Mul.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | 5 | namespace MindLated.Protection.Arithmetic.Functions 6 | { 7 | public class Mul : Function 8 | { 9 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Mul; 10 | 11 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 12 | { 13 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 14 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 15 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(), arithmeticEmulator.GetY()), new Token(OpCodes.Mul), ArithmeticTypes); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Sub.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | 5 | namespace MindLated.Protection.Arithmetic.Functions 6 | { 7 | public class Sub : Function 8 | { 9 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Sub; 10 | 11 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 12 | { 13 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 14 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 15 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(), arithmeticEmulator.GetY()), new Token(OpCodes.Sub), ArithmeticTypes); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Protection/Anti/AntiDe4dot.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | 3 | namespace MindLated.Protection.Anti 4 | { 5 | internal class AntiDe4dot 6 | { 7 | public static void Execute(AssemblyDef mod) 8 | { 9 | foreach (var module in mod.Modules) 10 | { 11 | var interfaceM = new InterfaceImplUser(module.GlobalType); 12 | for (var i = 0; i < 1; i++) 13 | { 14 | var typeDef1 = new TypeDefUser(string.Empty, $"Form{i}", module.CorLibTypes.GetTypeRef("System", "Attribute")); 15 | var interface1 = new InterfaceImplUser(typeDef1); 16 | module.Types.Add(typeDef1); 17 | typeDef1.Interfaces.Add(interface1); 18 | typeDef1.Interfaces.Add(interfaceM); 19 | } 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Xor.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | 5 | namespace MindLated.Protection.Arithmetic.Functions 6 | { 7 | public class Xor : Function 8 | { 9 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Xor; 10 | 11 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 12 | { 13 | var generator = new Generator.Generator(); 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), generator.Next(), ArithmeticTypes); 16 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(), arithmeticEmulator.GetY()), new Token(OpCodes.Xor), ArithmeticTypes); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // This file is used by Code Analysis to maintain SuppressMessage 2 | // attributes that are applied to this project. 3 | // Project-level suppressions either have no target or are given 4 | // a specific target and scoped to a namespace, type, member, etc. 5 | 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | [assembly: SuppressMessage("Usage", "CA2211:Les champs non constants ne doivent pas être visibles", Justification = "", Scope = "member", Target = "~F:MindLated.Form1.Init")] 9 | [assembly: SuppressMessage("Usage", "CA2211:Les champs non constants ne doivent pas être visibles", Justification = "", Scope = "member", Target = "~F:MindLated.Form1.Init2")] 10 | [assembly: SuppressMessage("CodeQuality", "IDE0051:Supprimer les membres privés non utilisés", Justification = "", Scope = "member", Target = "~M:MindLated.Protection.Anti.Runtime.AntiDebugSafe.Initialize")] 11 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: mindlated 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | polar: # Replace with a single Polar username 13 | buy_me_a_coffee: # Replace with a single Buy Me a Coffee username 14 | thanks_dev: # Replace with a single thanks.dev username 15 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 16 | -------------------------------------------------------------------------------- /MindLated.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net7.0-windows 6 | enable 7 | true 8 | 9 | true 10 | latest 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | True 20 | True 21 | Resources.resx 22 | 23 | 24 | 25 | 26 | 27 | ResXFileCodeGenerator 28 | Resources.Designer.cs 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Protection/Anti/Anti Dump.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Anti.Runtime; 4 | using MindLated.Services; 5 | using System.Linq; 6 | 7 | namespace MindLated.Protection.Anti 8 | { 9 | internal class AntiDump 10 | { 11 | public static void Execute(ModuleDef mod) 12 | { 13 | var typeModule = ModuleDefMD.Load(typeof(AntiDumpRun).Module); 14 | var cctor = mod.GlobalType.FindOrCreateStaticConstructor(); 15 | var typeDef = typeModule.ResolveTypeDef(MDToken.ToRID(typeof(AntiDumpRun).MetadataToken)); 16 | var members = InjectHelper.Inject(typeDef, mod.GlobalType, mod); 17 | var init = (MethodDef)members.Single(method => method.Name == "Initialize"); 18 | cctor.Body.Instructions.Insert(0, Instruction.Create(OpCodes.Call, init)); 19 | foreach (var md in mod.GlobalType.Methods) 20 | { 21 | if (md.Name != ".ctor") continue; 22 | mod.GlobalType.Remove(md); 23 | break; 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Cos.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Cos : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Cos; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Log.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Log : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Log; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Sin.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Sin : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Sin; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Sqrt.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Sqrt : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Sqrt; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Tan.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Tan : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Tan; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Tanh.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Tanh : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Tanh; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/Anti/Anti Debug.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Anti.Runtime; 4 | using MindLated.Services; 5 | using System.Linq; 6 | 7 | namespace MindLated.Protection.Anti 8 | { 9 | public static class AntiDebug 10 | { 11 | public static void Execute(ModuleDef module) 12 | { 13 | var typeModule = ModuleDefMD.Load(typeof(AntiDebugSafe).Module); 14 | var cctor = module.GlobalType.FindOrCreateStaticConstructor(); 15 | var typeDef = typeModule.ResolveTypeDef(MDToken.ToRID(typeof(AntiDebugSafe).MetadataToken)); 16 | var members = InjectHelper.Inject(typeDef, module.GlobalType, module); 17 | var init = (MethodDef)members.Single(method => method.Name == "Initialize"); 18 | cctor.Body.Instructions.Insert(0, Instruction.Create(OpCodes.Call, init)); 19 | foreach (var md in module.GlobalType.Methods) 20 | { 21 | if (md.Name != ".ctor") continue; 22 | module.GlobalType.Remove(md); 23 | break; 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Protection/Anti/Antimanything.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Anti.Runtime; 4 | using MindLated.Services; 5 | using System.Linq; 6 | 7 | namespace MindLated.Protection.Anti 8 | { 9 | internal class Antimanything 10 | { 11 | public static void Execute(ModuleDef module) 12 | { 13 | var typeModule = ModuleDefMD.Load(typeof(SelfDeleteClass).Module); 14 | var cctor = module.GlobalType.FindOrCreateStaticConstructor(); 15 | var typeDef = typeModule.ResolveTypeDef(MDToken.ToRID(typeof(SelfDeleteClass).MetadataToken)); 16 | var members = InjectHelper.Inject(typeDef, module.GlobalType, module); 17 | var init = (MethodDef)members.Single(method => method.Name == "Init"); 18 | cctor.Body.Instructions.Insert(0, Instruction.Create(OpCodes.Call, init)); 19 | foreach (var md in module.GlobalType.Methods) 20 | { 21 | if (md.Name != ".ctor") continue; 22 | module.GlobalType.Remove(md); 23 | break; 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Abs.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public sealed class Abs : Function 9 | { 10 | private static ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Abs; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Floor.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Floor : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Floor; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Log10.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Log10 : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Log10; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Round.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Round : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Round; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Protection/CtrlFlow/JumpCFlow.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using System.Linq; 4 | 5 | namespace MindLated.Protection.CtrlFlow 6 | { 7 | public static class JumpCFlow 8 | { 9 | public static void Execute(ModuleDefMD module) 10 | { 11 | foreach (var type in module.Types) 12 | { 13 | foreach (var meth in type.Methods.ToArray()) 14 | { 15 | if (!meth.HasBody || !meth.Body.HasInstructions || meth.Body.HasExceptionHandlers) continue; 16 | for (var i = 0; i < meth.Body.Instructions.Count - 2; i++) 17 | { 18 | var inst = meth.Body.Instructions[i + 1]; 19 | meth.Body.Instructions.Insert(i + 1, Instruction.Create(OpCodes.Ldstr, Renamer.RenamerPhase.GenerateString(Renamer.RenamerPhase.RenameMode.Ascii))); 20 | meth.Body.Instructions.Insert(i + 1, Instruction.Create(OpCodes.Br_S, inst)); 21 | i += 2; 22 | } 23 | } 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Ceiling.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Ceiling : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Ceiling; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Sato-Isolated 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Protection/Arithmetic/Functions/Maths/Truncate.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Utils; 4 | using System.Collections.Generic; 5 | 6 | namespace MindLated.Protection.Arithmetic.Functions.Maths 7 | { 8 | public class Truncate : Function 9 | { 10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Truncate; 11 | 12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module) 13 | { 14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null!; 15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub }; 16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes); 17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /MindLated.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MindLated", "MindLated.csproj", "{3E763D0C-4063-44F2-A7A2-8D1F3A8A4C9D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3E763D0C-4063-44F2-A7A2-8D1F3A8A4C9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {3E763D0C-4063-44F2-A7A2-8D1F3A8A4C9D}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {3E763D0C-4063-44F2-A7A2-8D1F3A8A4C9D}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {3E763D0C-4063-44F2-A7A2-8D1F3A8A4C9D}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {276CB31F-229B-4C1C-A6C3-56D93547FA9E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Protection/Anti/Runtime/EOFAntiTamper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Reflection; 5 | using System.Security.Cryptography; 6 | 7 | namespace MindLated.Protection.Anti.Runtime 8 | { 9 | internal class EofAntiTamper 10 | { 11 | private static void Initializer() 12 | { 13 | var assemblyLocation = Assembly.GetExecutingAssembly().Location; 14 | var stream = new StreamReader(assemblyLocation).BaseStream; 15 | var reader = new BinaryReader(stream); 16 | var newSha256 = BitConverter.ToString(SHA256.Create().ComputeHash(reader.ReadBytes(File.ReadAllBytes(assemblyLocation).Length - 32))); 17 | stream.Seek(-32, SeekOrigin.End); 18 | var realSha256 = BitConverter.ToString(reader.ReadBytes(32)); 19 | if (newSha256 != realSha256) 20 | { 21 | Process.Start(new ProcessStartInfo("cmd.exe", "/C ping 1.1.1.1 -n 1 -w 3000 > Nul & Del \"" + Assembly.GetExecutingAssembly().Location + "\"") { WindowStyle = ProcessWindowStyle.Hidden })?.Dispose(); 22 | Process.GetCurrentProcess().Kill(); 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Protection/Anti/Anti Tamper.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Anti.Runtime; 4 | using MindLated.Services; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Security.Cryptography; 8 | 9 | namespace MindLated.Protection.Anti 10 | { 11 | public static class AntiTamper 12 | { 13 | public static void Sha256(string filePath) 14 | { 15 | var sha256Bytes = SHA256.Create().ComputeHash(File.ReadAllBytes(filePath)); 16 | using var stream = new FileStream(filePath, FileMode.Append); 17 | stream.Write(sha256Bytes, 0, sha256Bytes.Length); 18 | } 19 | 20 | public static void Execute(ModuleDef module) 21 | { 22 | var typeModule = ModuleDefMD.Load(typeof(EofAntiTamper).Module); 23 | var cctor = module.GlobalType.FindOrCreateStaticConstructor(); 24 | var typeDef = typeModule.ResolveTypeDef(MDToken.ToRID(typeof(EofAntiTamper).MetadataToken)); 25 | var members = InjectHelper.Inject(typeDef, module.GlobalType, module); 26 | var init = (MethodDef)members.Single(method => method.Name == "Initializer"); 27 | cctor.Body.Instructions.Insert(0, Instruction.Create(OpCodes.Call, init)); 28 | foreach (var md in module.GlobalType.Methods) 29 | { 30 | if (md.Name != ".ctor") continue; 31 | module.GlobalType.Remove(md); 32 | break; 33 | } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Protection/Other/Watermark.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | 4 | namespace MindLated.Protection.Other 5 | { 6 | internal class Watermark 7 | { 8 | public static void Execute(ModuleDefMD md) 9 | { 10 | foreach (var moduleDef in md.Assembly.Modules) 11 | { 12 | var module = (ModuleDefMD)moduleDef; 13 | var attrRef = module.CorLibTypes.GetTypeRef("System", "Attribute"); 14 | var attrType = new TypeDefUser("", "MindLated", attrRef); 15 | module.Types.Add(attrType); 16 | 17 | var ctor = new MethodDefUser( 18 | ".ctor", 19 | MethodSig.CreateInstance(module.CorLibTypes.Void, module.CorLibTypes.String), 20 | MethodImplAttributes.Managed, 21 | MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName) 22 | { 23 | Body = new CilBody() 24 | }; 25 | ctor.Body.MaxStack = 1; 26 | ctor.Body.Instructions.Add(OpCodes.Ldarg_0.ToInstruction()); 27 | ctor.Body.Instructions.Add(OpCodes.Call.ToInstruction(new MemberRefUser(module, ".ctor", MethodSig.CreateInstance(module.CorLibTypes.Void), attrRef))); 28 | ctor.Body.Instructions.Add(OpCodes.Ret.ToInstruction()); 29 | attrType.Methods.Add(ctor); 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MindLated 2 | .net obfuscator 3 | 4 | # Obfuscator 5 | 6 | ## English 7 | 8 | ### Overview 9 | One day, I might release a private version of the obfuscator, which offers more protection, the ability to choose the protection for each method, a better interface, etc. 10 | 11 | ### Issues 12 | If you encounter any problems with the current code, please open an issue, and I will see what I can do. 13 | 14 | ### Updates 15 | For the time being, I don't plan to add any further protection. 16 | 17 | ## Français 18 | 19 | ### Aperçu 20 | Un jour, je sortirais la version privée de l'obfuscateur, offrant plus de protection, la possibilité de choisir la protection de chaque méthode, une meilleure interface, etc. 21 | 22 | ### Problèmes 23 | Si vous rencontrez des problèmes avec le code actuel, ouvrez une issue et je verrai ce que je peux faire. 24 | 25 | ### Mises à jour 26 | Pour le moment, je ne prévois pas d'ajouter d'autres protections. 27 | 28 | ☕ Support 29 | If you'd like to support me, you can do so via Ko-fi. Every bit of support is greatly appreciated! 30 | 31 | 32 | 33 | 34 | 35 | 36 | You can also support me with cryptocurrency: 37 | 38 | XMR : 48JRJwsDuMQ7EboCSDSAEMKWfyVGWbfBcM5SaxCCMqiBeduwZDZQMw5KseCn2ciyQX6ckJyPH24HJNoJGVZH9EmATAoX6Jz 39 | LTC : LVu6dmsaAfp9mi5s6BRFZApBrScQvhYF9s 40 | BTC : bc1qps0wd0hhhkz6p924c76s6xc8xt5hn4ctnqtjk2 41 | 42 | -------------------------------------------------------------------------------- /Protection/Proxy/ProxyString.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | 4 | namespace MindLated.Protection.Proxy 5 | { 6 | internal class ProxyString 7 | { 8 | public static void Execute(ModuleDef module) 9 | { 10 | foreach (var type in module.GetTypes()) 11 | { 12 | if (type.IsGlobalModuleType) continue; 13 | foreach (var meth in type.Methods) 14 | { 15 | if (!meth.HasBody) continue; 16 | var instr = meth.Body.Instructions; 17 | foreach (var t in instr) 18 | { 19 | if (t.OpCode != OpCodes.Ldstr) continue; 20 | var methImplFlags = MethodImplAttributes.IL | MethodImplAttributes.Managed; 21 | var methFlags = MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig | MethodAttributes.ReuseSlot; 22 | var meth1 = new MethodDefUser(Renamer.RenamerPhase.GenerateString(Renamer.RenamerPhase.RenameMode.Normal), 23 | MethodSig.CreateStatic(module.CorLibTypes.String), 24 | methImplFlags, methFlags); 25 | module.GlobalType.Methods.Add(meth1); 26 | meth1.Body = new CilBody(); 27 | meth1.Body.Variables.Add(new Local(module.CorLibTypes.String)); 28 | meth1.Body.Instructions.Add(Instruction.Create(OpCodes.Ldstr, t.Operand.ToString())); 29 | meth1.Body.Instructions.Add(Instruction.Create(OpCodes.Ret)); 30 | 31 | t.OpCode = OpCodes.Call; 32 | t.Operand = meth1; 33 | } 34 | } 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Protection/CtrlFlow/BlockParser.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using System.Collections.Generic; 4 | 5 | namespace MindLated.Protection.CtrlFlow 6 | { 7 | public class BlockParser 8 | { 9 | public static List ParseMethod(MethodDef meth) 10 | { 11 | var blocks = new List(); 12 | var block = new Block(); 13 | var id = 0; 14 | var usage = 0; 15 | block.Number = id; 16 | block.Instructions.Add(Instruction.Create(OpCodes.Nop)); 17 | blocks.Add(block); 18 | block = new Block(); 19 | var handlers = new Stack(); 20 | foreach (var instruction in meth.Body.Instructions) 21 | { 22 | foreach (var eh in meth.Body.ExceptionHandlers) 23 | { 24 | if (eh.HandlerStart == instruction || eh.TryStart == instruction || eh.FilterStart == instruction) 25 | handlers.Push(eh); 26 | } 27 | foreach (var eh in meth.Body.ExceptionHandlers) 28 | { 29 | if (eh.HandlerEnd == instruction || eh.TryEnd == instruction) 30 | handlers.Pop(); 31 | } 32 | 33 | instruction.CalculateStackUsage(out var stacks, out var pops); 34 | block.Instructions.Add(instruction); 35 | usage += stacks - pops; 36 | if (stacks == 0) 37 | { 38 | if (instruction.OpCode != OpCodes.Nop) 39 | { 40 | if ((usage == 0 || instruction.OpCode == OpCodes.Ret) && handlers.Count == 0) 41 | { 42 | block.Number = ++id; 43 | blocks.Add(block); 44 | block = new Block(); 45 | } 46 | } 47 | } 48 | } 49 | return blocks; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Utils/ArithmeticUtils.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet.Emit; 2 | using System; 3 | using System.Reflection; 4 | using static MindLated.Protection.Arithmetic.ArithmeticTypes; 5 | 6 | namespace MindLated.Protection.Arithmetic.Utils 7 | { 8 | public static class ArithmeticUtils 9 | { 10 | public static bool CheckArithmetic(Instruction instruction) 11 | { 12 | if (!instruction.IsLdcI4()) 13 | return false; 14 | if (instruction.GetLdcI4Value() == 1) 15 | return false; 16 | return instruction.GetLdcI4Value() != 0; 17 | } 18 | 19 | public static double GetY(double x) => x / 2; 20 | 21 | public static MethodInfo? GetMethod(ArithmeticTypes mathType) 22 | { 23 | return mathType switch 24 | { 25 | Abs => typeof(Math).GetMethod("Abs", new[] { typeof(double) }), 26 | Round => typeof(Math).GetMethod("Round", new[] { typeof(double) }), 27 | Sin => typeof(Math).GetMethod("Sin", new[] { typeof(double) }), 28 | Cos => typeof(Math).GetMethod("Cos", new[] { typeof(double) }), 29 | Log => typeof(Math).GetMethod("Log", new[] { typeof(double) }), 30 | Log10 => typeof(Math).GetMethod("Log10", new[] { typeof(double) }), 31 | Sqrt => typeof(Math).GetMethod("Sqrt", new[] { typeof(double) }), 32 | Ceiling => typeof(Math).GetMethod("Ceiling", new[] { typeof(double) }), 33 | Floor => typeof(Math).GetMethod("Floor", new[] { typeof(double) }), 34 | Tan => typeof(Math).GetMethod("Tan", new[] { typeof(double) }), 35 | Tanh => typeof(Math).GetMethod("Tanh", new[] { typeof(double) }), 36 | Truncate => typeof(Math).GetMethod("Truncate", new[] { typeof(double) }), 37 | _ => null 38 | }; 39 | } 40 | 41 | public static OpCode? GetOpCode(ArithmeticTypes arithmetic) 42 | { 43 | return arithmetic switch 44 | { 45 | Add => OpCodes.Add, 46 | Sub => OpCodes.Sub, 47 | _ => null 48 | }; 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /Protection/LocalF/L2FV2.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Renamer; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace MindLated.Protection.LocalF 8 | { 9 | internal class L2FV2 10 | { 11 | private static Dictionary _convertedLocals = new(); 12 | 13 | public static void Execute(ModuleDef module) 14 | { 15 | foreach (var type in module.Types.Where(x => x != module.GlobalType)) 16 | { 17 | foreach (var meth in type.Methods.Where(x => x.HasBody && x.Body.HasInstructions && !x.IsConstructor)) 18 | { 19 | _convertedLocals = new Dictionary(); 20 | Process(module, meth); 21 | } 22 | } 23 | } 24 | 25 | private static void Process(ModuleDef module, MethodDef meth) 26 | { 27 | meth.Body.SimplifyMacros(meth.Parameters); 28 | var instructions = meth.Body.Instructions; 29 | foreach (var t in instructions) 30 | { 31 | if (t.Operand is not Local local) continue; 32 | FieldDef def; 33 | if (!_convertedLocals.ContainsKey(local)) 34 | { 35 | def = new FieldDefUser(RenamerPhase.GenerateString(RenamerPhase.RenameMode.Normal), new FieldSig(local.Type), FieldAttributes.Public | FieldAttributes.Static); 36 | module.GlobalType.Fields.Add(def); 37 | _convertedLocals.Add(local, def); 38 | } 39 | else 40 | def = _convertedLocals[local]; 41 | 42 | var eq = t.OpCode?.Code switch 43 | { 44 | Code.Ldloc => OpCodes.Ldsfld, 45 | Code.Ldloca => OpCodes.Ldsflda, 46 | Code.Stloc => OpCodes.Stsfld, 47 | _ => null 48 | }; 49 | t.OpCode = eq; 50 | t.Operand = def; 51 | } 52 | _convertedLocals.ToList().ForEach(x => meth.Body.Variables.Remove(x.Key)); 53 | _convertedLocals = new Dictionary(); 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /Protection/StringOnline/OnlinePhase.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Services; 4 | using System; 5 | using System.Linq; 6 | 7 | namespace MindLated.Protection.StringOnline 8 | { 9 | public static class OnlinePhase 10 | { 11 | public static void Execute(ModuleDef module) 12 | { 13 | InjectClass1(module); 14 | foreach (var type in module.GetTypes()) 15 | { 16 | if (type.IsGlobalModuleType) continue; 17 | foreach (var meth in type.Methods) 18 | { 19 | if (!meth.HasBody || !meth.Body.HasInstructions) continue; 20 | if (meth.Name.Contains("Decoder")) continue; 21 | for (var i = 0; i < meth.Body.Instructions.Count; i++) 22 | { 23 | if (meth.Body.Instructions[i].OpCode != OpCodes.Ldstr) continue; 24 | var plainText = meth.Body.Instructions[i].Operand.ToString(); 25 | var operand = ConvertStringToHex(plainText!); 26 | meth.Body.Instructions[i].Operand = operand; 27 | meth.Body.Instructions.Insert(i + 1, Instruction.Create(OpCodes.Call, Form1.Init)); 28 | } 29 | meth.Body.SimplifyBranches(); 30 | } 31 | } 32 | } 33 | 34 | private static string ConvertStringToHex(string asciiString) 35 | { 36 | var hex = string.Empty; 37 | foreach (var c in asciiString) 38 | { 39 | int tmp = c; 40 | hex += $"{Convert.ToUInt32(tmp.ToString()):x2}"; 41 | } 42 | return hex; 43 | } 44 | 45 | private static void InjectClass1(ModuleDef module) 46 | { 47 | var typeModule = ModuleDefMD.Load(typeof(OnlineString).Module); 48 | var typeDef = typeModule.ResolveTypeDef(MDToken.ToRID(typeof(OnlineString).MetadataToken)); 49 | var members = InjectHelper.Inject(typeDef, module.GlobalType, module); 50 | Form1.Init = (MethodDef)members.Single(method => method.Name == "Decoder"); 51 | foreach (var md in module.GlobalType.Methods) 52 | { 53 | if (md.Name != ".ctor") continue; 54 | module.GlobalType.Remove(md); 55 | break; 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Protection/Anti/Runtime/AntiDebug.Safe.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace MindLated.Protection.Anti.Runtime 6 | { 7 | internal static class AntiDebugSafe 8 | { 9 | [DllImport("ntdll.dll", CharSet = CharSet.Auto)] 10 | private static extern int NtQueryInformationProcess(IntPtr test, int test2, int[] test3, int test4, ref int test5); 11 | 12 | private static void Initialize() 13 | { 14 | if (Debugger.IsLogging()) 15 | { Environment.Exit(0); } 16 | if (Debugger.IsAttached) 17 | { Environment.Exit(0); } 18 | if (Environment.GetEnvironmentVariable("complus_profapi_profilercompatibilitysetting") != null) 19 | { Environment.Exit(0); } 20 | if (string.Compare(Environment.GetEnvironmentVariable("COR_ENABLE_PROFILING"), "1", StringComparison.Ordinal) == 0) 21 | { Environment.Exit(0); } 22 | 23 | if (Environment.OSVersion.Platform != PlatformID.Win32NT) return; 24 | var array = new int[6]; 25 | var num = 0; 26 | var intPtr = Process.GetCurrentProcess().Handle; 27 | if (NtQueryInformationProcess(intPtr, 31, array, 4, ref num) == 0 && array[0] != 1) 28 | { 29 | Environment.Exit(0); 30 | } 31 | if (NtQueryInformationProcess(intPtr, 30, array, 4, ref num) == 0 && array[0] != 0) 32 | { 33 | Environment.Exit(0); 34 | } 35 | 36 | if (NtQueryInformationProcess(intPtr, 0, array, 24, ref num) != 0) return; 37 | intPtr = Marshal.ReadIntPtr(Marshal.ReadIntPtr((IntPtr)array[1], 12), 12); 38 | Marshal.WriteInt32(intPtr, 32, 0); 39 | var intPtr2 = Marshal.ReadIntPtr(intPtr, 0); 40 | var ptr = intPtr2; 41 | do 42 | { 43 | ptr = Marshal.ReadIntPtr(ptr, 0); 44 | if (Marshal.ReadInt32(ptr, 44) != 1572886 || 45 | Marshal.ReadInt32(Marshal.ReadIntPtr(ptr, 48), 0) != 7536749) continue; 46 | var intPtr3 = Marshal.ReadIntPtr(ptr, 8); 47 | var intPtr4 = Marshal.ReadIntPtr(ptr, 12); 48 | Marshal.WriteInt32(intPtr4, 0, (int)intPtr3); 49 | Marshal.WriteInt32(intPtr3, 4, (int)intPtr4); 50 | } 51 | while (!ptr.Equals(intPtr2)); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /Protection/Other/StackUnfConfusion.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using System; 4 | 5 | namespace MindLated.Protection.Other 6 | { 7 | internal class StackUnfConfusion 8 | { 9 | public static void Execute(ModuleDef mod) 10 | { 11 | foreach (var type in mod.Types) 12 | { 13 | foreach (var meth in type.Methods) 14 | { 15 | if (meth is { HasBody: false }) 16 | { 17 | break; 18 | } 19 | 20 | var body = meth?.Body; 21 | var target = body?.Instructions[0]; 22 | var item = Instruction.Create(OpCodes.Br_S, target); 23 | var instruction3 = Instruction.Create(OpCodes.Pop); 24 | var random = new Random(); 25 | var instruction4 = random.Next(0, 5) switch 26 | { 27 | 0 => Instruction.Create(OpCodes.Ldnull), 28 | 1 => Instruction.Create(OpCodes.Ldc_I4_0), 29 | 2 => Instruction.Create(OpCodes.Ldstr, "Isolator"), 30 | 3 => Instruction.Create(OpCodes.Ldc_I8, (uint)random.Next()), 31 | _ => Instruction.Create(OpCodes.Ldc_I8, (long)random.Next()) 32 | }; 33 | 34 | body?.Instructions.Insert(0, instruction4); 35 | body?.Instructions.Insert(1, instruction3); 36 | body?.Instructions.Insert(2, item); 37 | if (body != null) 38 | { 39 | foreach (var handler in body.ExceptionHandlers) 40 | { 41 | if (handler.TryStart == target) 42 | { 43 | handler.TryStart = item; 44 | } 45 | else if (handler.HandlerStart == target) 46 | { 47 | handler.HandlerStart = item; 48 | } 49 | else if (handler.FilterStart == target) 50 | { 51 | handler.FilterStart = item; 52 | } 53 | } 54 | } 55 | } 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Protection/LocalF/L2F.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Renamer; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace MindLated.Protection.LocalF 8 | { 9 | internal class L2F 10 | { 11 | private static Dictionary _convertedLocals = new(); 12 | 13 | public static void Execute(ModuleDef module) 14 | { 15 | foreach (var type in module.Types.Where(x => x != module.GlobalType)) 16 | { 17 | foreach (var meth in type.Methods.Where(x => x.HasBody && x.Body.HasInstructions && !x.IsConstructor)) 18 | { 19 | _convertedLocals = new Dictionary(); 20 | Process(module, meth); 21 | } 22 | } 23 | } 24 | 25 | private static void Process(ModuleDef module, MethodDef meth) 26 | { 27 | var instructions = meth.Body.Instructions; 28 | foreach (var t in instructions) 29 | { 30 | if (t.Operand is not Local local) continue; 31 | FieldDef def; 32 | if (!_convertedLocals.ContainsKey(local)) 33 | { 34 | def = new FieldDefUser(RenamerPhase.GenerateString(RenamerPhase.RenameMode.Normal), new FieldSig(local.Type), FieldAttributes.Public | FieldAttributes.Static); 35 | module.GlobalType.Fields.Add(def); 36 | _convertedLocals.Add(local, def); 37 | } 38 | else 39 | def = _convertedLocals[local]; 40 | 41 | var eq = t.OpCode?.Code switch 42 | { 43 | Code.Ldloc => OpCodes.Ldsfld, 44 | Code.Ldloc_S => OpCodes.Ldsfld, 45 | Code.Ldloc_0 => OpCodes.Ldsfld, 46 | Code.Ldloc_1 => OpCodes.Ldsfld, 47 | Code.Ldloc_2 => OpCodes.Ldsfld, 48 | Code.Ldloc_3 => OpCodes.Ldsfld, 49 | Code.Ldloca => OpCodes.Ldsflda, 50 | Code.Ldloca_S => OpCodes.Ldsflda, 51 | Code.Stloc => OpCodes.Stsfld, 52 | Code.Stloc_0 => OpCodes.Stsfld, 53 | Code.Stloc_1 => OpCodes.Stsfld, 54 | Code.Stloc_2 => OpCodes.Stsfld, 55 | Code.Stloc_3 => OpCodes.Stsfld, 56 | Code.Stloc_S => OpCodes.Stsfld, 57 | _ => null 58 | }; 59 | t.OpCode = eq; 60 | t.Operand = def; 61 | } 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /Protection/Other/Calli.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using System; 4 | using System.Linq; 5 | 6 | namespace MindLated.Protection.Other 7 | { 8 | internal class Calli 9 | { 10 | public static void Execute(ModuleDef module) 11 | { 12 | foreach (var type in module.Types.ToArray()) 13 | { 14 | foreach (var meth in type.Methods.ToArray()) 15 | { 16 | if (!meth.HasBody) continue; 17 | if (!meth.Body.HasInstructions) continue; 18 | if (meth.FullName.Contains("My.")) continue; 19 | if (meth.FullName.Contains(".My")) continue; 20 | if (meth.FullName.Contains("Costura")) continue; 21 | if (meth.IsConstructor) continue; 22 | if (meth.DeclaringType.IsGlobalModuleType) continue; 23 | for (var i = 0; i < meth.Body.Instructions.Count - 1; i++) 24 | { 25 | try 26 | { 27 | if (meth.Body.Instructions[i].ToString().Contains("ISupportInitialize") || meth.Body.Instructions[i].OpCode != OpCodes.Call && 28 | meth.Body.Instructions[i].OpCode != OpCodes.Callvirt && 29 | meth.Body.Instructions[i].OpCode != OpCodes.Ldloc_S) continue; 30 | 31 | if (meth.Body.Instructions[i].ToString().Contains("Object") || meth.Body.Instructions[i].OpCode != OpCodes.Call && 32 | meth.Body.Instructions[i].OpCode != OpCodes.Callvirt && 33 | meth.Body.Instructions[i].OpCode != OpCodes.Ldloc_S) continue; 34 | 35 | try 36 | { 37 | var membertocalli = (MemberRef)meth.Body.Instructions[i].Operand; 38 | meth.Body.Instructions[i].OpCode = OpCodes.Calli; 39 | meth.Body.Instructions[i].Operand = membertocalli.MethodSig; 40 | meth.Body.Instructions.Insert(i, Instruction.Create(OpCodes.Ldftn, membertocalli)); 41 | } 42 | catch (Exception) 43 | { 44 | // ignored 45 | } 46 | } 47 | catch (Exception) 48 | { 49 | // ignored 50 | } 51 | } 52 | } 53 | foreach (var md in module.GlobalType.Methods) 54 | { 55 | if (md.Name != ".ctor") continue; 56 | module.GlobalType.Remove(md); 57 | break; 58 | } 59 | } 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Protection/String/EncryptionHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Security.Cryptography; 7 | using System.Text; 8 | 9 | namespace MindLated.Protection.String 10 | { 11 | internal class EncryptionHelper 12 | { 13 | private static List _list = new(); 14 | 15 | public static void Generate() 16 | { 17 | using var manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("%Replace"); 18 | using var streamReader = new StreamReader(new MemoryStream(UnHush(Read(manifestResourceStream!)))); 19 | _list = streamReader.ReadToEnd().Split(new[] 20 | { 21 | Environment.NewLine 22 | }, StringSplitOptions.None).ToList(); 23 | } 24 | 25 | public static string Search(int key) 26 | { 27 | return _list.ElementAt(key); 28 | } 29 | 30 | private static byte[] Read(Stream input) 31 | { 32 | using var memoryStream = new MemoryStream(); 33 | input.CopyTo(memoryStream); 34 | return memoryStream.ToArray(); 35 | } 36 | 37 | private static byte[] UnHush(IReadOnlyList text) 38 | { 39 | var key = new Rfc2898DeriveBytes("%Key1", Encoding.ASCII.GetBytes("%Key2")).GetBytes(256 / 8); 40 | var xor = new byte[text.Count]; 41 | for (var i = 0; i < text.Count; i++) 42 | { 43 | xor[i] = (byte)(text[i] ^ key[i % key.Length]); 44 | } 45 | 46 | return xor; 47 | } 48 | 49 | public static string Decrypt(string encryptedText) 50 | { 51 | if (Assembly.GetCallingAssembly().FullName != Assembly.GetExecutingAssembly().FullName) 52 | { 53 | var cipherTextBytes = Convert.FromBase64String(encryptedText); 54 | var keyBytes = new Rfc2898DeriveBytes("%Key1", Encoding.ASCII.GetBytes("%Key2")) 55 | .GetBytes(256 / 8); 56 | var symmetricKey = new AesCng { Mode = CipherMode.CBC, Padding = PaddingMode.PKCS7 }; 57 | 58 | var decryptor = symmetricKey.CreateDecryptor(keyBytes, Encoding.ASCII.GetBytes("%Key3")); 59 | var memoryStream = new MemoryStream(cipherTextBytes); 60 | var cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read); 61 | var plainTextBytes = new byte[cipherTextBytes.Length]; 62 | 63 | var decryptedByteCount = cryptoStream.Read(plainTextBytes, 0, plainTextBytes.Length); 64 | memoryStream.Close(); 65 | cryptoStream.Close(); 66 | return Encoding.UTF8.GetString(plainTextBytes, 0, decryptedByteCount) 67 | .TrimEnd("\0".ToCharArray()); 68 | } 69 | return "MindLated.png"; 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ce code a été généré par un outil. 4 | // Version du runtime :4.0.30319.42000 5 | // 6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si 7 | // le code est régénéré. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MindLated.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. 17 | /// 18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder 19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio. 20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen 21 | // avec l'option /str ou régénérez votre projet VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MindLated.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes 51 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Protection/Proxy/ProxyINT.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | 4 | namespace MindLated.Protection.Proxy 5 | { 6 | public static class ProxyInt 7 | { 8 | public static void Execute(ModuleDef module) 9 | { 10 | foreach (var type in module.GetTypes()) 11 | { 12 | if (type.IsGlobalModuleType) continue; 13 | foreach (var meth in type.Methods) 14 | { 15 | if (!meth.HasBody) continue; 16 | var instr = meth.Body.Instructions; 17 | for (var i = 0; i < instr.Count; i++) 18 | { 19 | if (meth.Body.Instructions[i].IsLdcI4()) 20 | { 21 | var methImplFlags = MethodImplAttributes.IL | MethodImplAttributes.Managed; 22 | var methFlags = MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig | MethodAttributes.ReuseSlot; 23 | var meth1 = new MethodDefUser(Renamer.RenamerPhase.GenerateString(Renamer.RenamerPhase.RenameMode.Normal), 24 | MethodSig.CreateStatic(module.CorLibTypes.Int32), 25 | methImplFlags, methFlags); 26 | module.GlobalType.Methods.Add(meth1); 27 | meth1.Body = new CilBody(); 28 | meth1.Body.Variables.Add(new Local(module.CorLibTypes.Int32)); 29 | meth1.Body.Instructions.Add(Instruction.Create(OpCodes.Ldc_I4, instr[i].GetLdcI4Value())); 30 | meth1.Body.Instructions.Add(Instruction.Create(OpCodes.Ret)); 31 | instr[i].OpCode = OpCodes.Call; 32 | instr[i].Operand = meth1; 33 | } 34 | else if (meth.Body.Instructions[i].OpCode == OpCodes.Ldc_R4) 35 | { 36 | var methImplFlags = MethodImplAttributes.IL | MethodImplAttributes.Managed; 37 | var methFlags = MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig | MethodAttributes.ReuseSlot; 38 | var meth1 = new MethodDefUser(Renamer.RenamerPhase.GenerateString(Renamer.RenamerPhase.RenameMode.Normal), 39 | MethodSig.CreateStatic(module.CorLibTypes.Double), 40 | methImplFlags, methFlags); 41 | module.GlobalType.Methods.Add(meth1); 42 | meth1.Body = new CilBody(); 43 | meth1.Body.Variables.Add(new Local(module.CorLibTypes.Double)); 44 | meth1.Body.Instructions.Add(Instruction.Create(OpCodes.Ldc_R4, (float)meth.Body.Instructions[i].Operand)); 45 | meth1.Body.Instructions.Add(Instruction.Create(OpCodes.Ret)); 46 | instr[i].OpCode = OpCodes.Call; 47 | instr[i].Operand = meth1; 48 | } 49 | } 50 | } 51 | } 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /Protection/Anti/Runtime/SelfDeleteClass.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Reflection; 5 | using System.Text; 6 | 7 | namespace MindLated.Protection.Anti.Runtime 8 | { 9 | internal class SelfDeleteClass 10 | { 11 | public static void Init() 12 | { 13 | if (IsSandboxie()) 14 | SelfDelete(); 15 | if (IsDebugger()) 16 | SelfDelete(); 17 | if (IsdnSpyRun()) 18 | SelfDelete(); 19 | } 20 | 21 | private static bool IsSandboxie() 22 | { 23 | return IsDetected(); 24 | } 25 | 26 | private static bool IsDebugger() 27 | { 28 | return Run(); 29 | } 30 | 31 | private static bool IsdnSpyRun() 32 | { 33 | return ValueType(); 34 | } 35 | 36 | private static void SelfDelete() 37 | { 38 | Process.Start(new ProcessStartInfo("cmd.exe", "/C ping 1.1.1.1 -n 1 -w 3000 > Nul & Del \"" + Assembly.GetExecutingAssembly().Location + "\"") { WindowStyle = ProcessWindowStyle.Hidden })?.Dispose(); 39 | Process.GetCurrentProcess().Kill(); 40 | } 41 | 42 | private static bool ValueType() 43 | { 44 | return File.Exists(Environment.ExpandEnvironmentVariables("%appdata%") + "\\dnSpy\\dnSpy.xml"); 45 | } 46 | 47 | private static IntPtr GetModuleHandle(string libName) 48 | { 49 | foreach (ProcessModule pMod in Process.GetCurrentProcess().Modules) 50 | if (pMod.ModuleName!.ToLower().Contains(libName.ToLower())) 51 | return pMod.BaseAddress; 52 | return IntPtr.Zero; 53 | } 54 | 55 | private static bool IsDetected() 56 | { 57 | //SbieDLL.dll to base64 for removing some detection from AV 58 | return GetModuleHandle(Encoding.UTF8.GetString(Convert.FromBase64String("U2JpZURsbC5kbGw="))) != IntPtr.Zero; 59 | } 60 | 61 | private static bool Run() 62 | { 63 | var returnvalue = false; 64 | if (Debugger.IsAttached || Debugger.IsLogging()) 65 | { 66 | returnvalue = true; 67 | } 68 | else 69 | { 70 | var strArray = new[] { "codecracker", "x32dbg", "x64dbg", "ollydbg", "ida", "charles", "dnspy", "simpleassembly", "peek", "httpanalyzer", "httpdebug", "fiddler", "wireshark", "dbx", "mdbg", "gdb", "windbg", "dbgclr", "kdb", "kgdb", "mdb", "processhacker", "scylla_x86", "scylla_x64", "scylla", "idau64", "idau", "idaq", "idaq64", "idaw", "idaw64", "idag", "idag64", "ida64", "ida", "ImportREC", "IMMUNITYDEBUGGER", "MegaDumper", "CodeBrowser", "reshacker", "cheat engine" }; 71 | foreach (var process in Process.GetProcesses()) 72 | if (process != Process.GetCurrentProcess()) 73 | for (var index = 0; index < strArray.Length; ++index) 74 | { 75 | if (process.ProcessName.ToLower().Contains(strArray[index])) returnvalue = true; 76 | 77 | if (process.MainWindowTitle.ToLower().Contains(strArray[index])) returnvalue = true; 78 | } 79 | } 80 | return returnvalue; 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /Protection/CtrlFlow/ControlFlowObfuscation.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace MindLated.Protection.CtrlFlow 8 | { 9 | internal class ControlFlowObfuscation 10 | { 11 | public static void Execute(ModuleDefMD md) 12 | { 13 | foreach (var type in md.Types) 14 | { 15 | if (type == md.GlobalType) continue; 16 | foreach (var meth in type.Methods) 17 | { 18 | if (meth.Name.StartsWith("get_") || meth.Name.StartsWith("set_")) continue; 19 | if (!meth.HasBody || meth.IsConstructor) continue; 20 | meth.Body.SimplifyBranches(); 21 | ExecuteMethod(meth); 22 | } 23 | } 24 | } 25 | 26 | private static void ExecuteMethod(MethodDef meth) 27 | { 28 | meth.Body.SimplifyMacros(meth.Parameters); 29 | var blocks = BlockParser.ParseMethod(meth); 30 | blocks = Randomize(blocks); 31 | meth.Body.Instructions.Clear(); 32 | var local = new Local(meth.Module.CorLibTypes.Int32); 33 | meth.Body.Variables.Add(local); 34 | var target = Instruction.Create(OpCodes.Nop); 35 | var instr = Instruction.Create(OpCodes.Br, target); 36 | foreach (var instruction in Calc(0)) 37 | meth.Body.Instructions.Add(instruction); 38 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Stloc, local)); 39 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Br, instr)); 40 | meth.Body.Instructions.Add(target); 41 | foreach (var block in blocks.Where(block => block != blocks.Single(x => x.Number == blocks.Count - 1))) 42 | { 43 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Ldloc, local)); 44 | foreach (var instruction in Calc(block.Number)) 45 | meth.Body.Instructions.Add(instruction); 46 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Ceq)); 47 | var instruction4 = Instruction.Create(OpCodes.Nop); 48 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Brfalse, instruction4)); 49 | 50 | foreach (var instruction in block.Instructions) 51 | meth.Body.Instructions.Add(instruction); 52 | 53 | foreach (var instruction in Calc(block.Number + 1)) 54 | meth.Body.Instructions.Add(instruction); 55 | 56 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Stloc, local)); 57 | meth.Body.Instructions.Add(instruction4); 58 | } 59 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Ldloc, local)); 60 | foreach (var instruction in Calc(blocks.Count - 1)) 61 | meth.Body.Instructions.Add(instruction); 62 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Ceq)); 63 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Brfalse, instr)); 64 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Br, blocks.Single(x => x.Number == blocks.Count - 1).Instructions[0])); 65 | meth.Body.Instructions.Add(instr); 66 | 67 | foreach (var lastBlock in blocks.Single(x => x.Number == blocks.Count - 1).Instructions) 68 | meth.Body.Instructions.Add(lastBlock); 69 | } 70 | 71 | private static readonly Random Rnd = new(); 72 | 73 | private static List Randomize(List input) 74 | { 75 | var ret = new List(); 76 | foreach (var group in input) 77 | ret.Insert(Rnd.Next(0, ret.Count), group); 78 | return ret; 79 | } 80 | 81 | private static List Calc(int value) 82 | { 83 | var instructions = new List { Instruction.Create(OpCodes.Ldc_I4, value) }; 84 | return instructions; 85 | } 86 | 87 | public void AddJump(IList instrs, Instruction target) 88 | { 89 | instrs.Add(Instruction.Create(OpCodes.Br, target)); 90 | } 91 | } 92 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/ArithmeticEmulator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace MindLated.Protection.Arithmetic 5 | { 6 | public class ArithmeticEmulator 7 | { 8 | private readonly double _x; 9 | private readonly double _y; 10 | private readonly ArithmeticTypes _arithmeticTypes; 11 | public new ArithmeticTypes GetType { get; private set; } 12 | 13 | public ArithmeticEmulator(double x, double y, ArithmeticTypes arithmeticTypes) 14 | { 15 | _x = x; 16 | _y = y; 17 | _arithmeticTypes = arithmeticTypes; 18 | } 19 | 20 | public double GetValue() 21 | { 22 | return _arithmeticTypes switch 23 | { 24 | ArithmeticTypes.Add => _x - _y, 25 | ArithmeticTypes.Sub => _x + _y, 26 | ArithmeticTypes.Div => _x * _y, 27 | ArithmeticTypes.Mul => _x / _y, 28 | ArithmeticTypes.Xor => (int)_x ^ (int)_y, 29 | _ => -1 30 | }; 31 | } 32 | 33 | public double GetValue(List arithmetics) 34 | { 35 | var generator = new Generator.Generator(); 36 | var arithmetic = arithmetics[generator.Next(arithmetics.Count)]; 37 | GetType = arithmetic; 38 | return _arithmeticTypes switch 39 | { 40 | ArithmeticTypes.Abs => arithmetic switch 41 | { 42 | ArithmeticTypes.Add => _x + Math.Abs(_y) * -1, 43 | ArithmeticTypes.Sub => _x - Math.Abs(_y) * -1, 44 | _ => -1 45 | }, 46 | ArithmeticTypes.Log => arithmetic switch 47 | { 48 | ArithmeticTypes.Add => _x - Math.Log(_y), 49 | ArithmeticTypes.Sub => _x + Math.Log(_y), 50 | _ => -1 51 | }, 52 | ArithmeticTypes.Log10 => arithmetic switch 53 | { 54 | ArithmeticTypes.Add => _x - Math.Log10(_y), 55 | ArithmeticTypes.Sub => _x + Math.Log10(_y), 56 | _ => -1 57 | }, 58 | ArithmeticTypes.Sin => arithmetic switch 59 | { 60 | ArithmeticTypes.Add => _x - Math.Sin(_y), 61 | ArithmeticTypes.Sub => _x + Math.Sin(_y), 62 | _ => -1 63 | }, 64 | ArithmeticTypes.Cos => arithmetic switch 65 | { 66 | ArithmeticTypes.Add => _x - Math.Cos(_y), 67 | ArithmeticTypes.Sub => _x + Math.Cos(_y), 68 | _ => -1 69 | }, 70 | ArithmeticTypes.Floor => arithmetic switch 71 | { 72 | ArithmeticTypes.Add => _x - Math.Floor(_y), 73 | ArithmeticTypes.Sub => _x + Math.Floor(_y), 74 | _ => -1 75 | }, 76 | ArithmeticTypes.Round => arithmetic switch 77 | { 78 | ArithmeticTypes.Add => _x - Math.Round(_y), 79 | ArithmeticTypes.Sub => _x + Math.Round(_y), 80 | _ => -1 81 | }, 82 | ArithmeticTypes.Tan => arithmetic switch 83 | { 84 | ArithmeticTypes.Add => _x - Math.Tan(_y), 85 | ArithmeticTypes.Sub => _x + Math.Tan(_y), 86 | _ => -1 87 | }, 88 | ArithmeticTypes.Tanh => arithmetic switch 89 | { 90 | ArithmeticTypes.Add => _x - Math.Tanh(_y), 91 | ArithmeticTypes.Sub => _x + Math.Tanh(_y), 92 | _ => -1 93 | }, 94 | ArithmeticTypes.Sqrt => arithmetic switch 95 | { 96 | ArithmeticTypes.Add => _x - Math.Sqrt(_y), 97 | ArithmeticTypes.Sub => _x + Math.Sqrt(_y), 98 | _ => -1 99 | }, 100 | ArithmeticTypes.Ceiling => arithmetic switch 101 | { 102 | ArithmeticTypes.Add => _x - Math.Ceiling(_y), 103 | ArithmeticTypes.Sub => _x + Math.Ceiling(_y), 104 | _ => -1 105 | }, 106 | ArithmeticTypes.Truncate => arithmetic switch 107 | { 108 | ArithmeticTypes.Add => _x - Math.Truncate(_y), 109 | ArithmeticTypes.Sub => _x + Math.Truncate(_y), 110 | _ => -1 111 | }, 112 | _ => -1 113 | }; 114 | } 115 | 116 | public double GetY() => _y; 117 | } 118 | } -------------------------------------------------------------------------------- /Protection/INT/AddIntPhase.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using System; 4 | 5 | namespace MindLated.Protection.INT 6 | { 7 | public static class AddIntPhase 8 | { 9 | /*public static void Execute(ModuleDef module) 10 | { 11 | foreach (var type in module.GetTypes()) 12 | { 13 | if (type.IsGlobalModuleType) continue; 14 | foreach (var methodDef2 in type.Methods) 15 | { 16 | if (!methodDef2.HasBody) continue; 17 | var instr = methodDef2.Body.Instructions; 18 | for (var i = 0; i < instr.Count; i++) 19 | { 20 | if (!methodDef2.Body.Instructions[i].IsLdcI4()) continue; 21 | var rnd = new Random(); 22 | var randomuint = rnd.Next(2147483647); 23 | methodDef2.Body.Instructions.Insert(i + 1, Instruction.Create(OpCodes.Sizeof, methodDef2.Module.Import(typeof(bool)))); 24 | methodDef2.Body.Instructions.Insert(i + 2, Instruction.Create(OpCodes.Add)); 25 | methodDef2.Body.Instructions.Insert(i + 3, Instruction.Create(OpCodes.Ldc_R8, Math.PI / 2)); 26 | methodDef2.Body.Instructions.Insert(i + 4, Instruction.Create(OpCodes.Call, methodDef2.Module.Import(typeof(Math).GetMethod("Sin", new Type[] { typeof(double) })))); 27 | methodDef2.Body.Instructions.Insert(i + 5, Instruction.Create(OpCodes.Conv_I4)); 28 | methodDef2.Body.Instructions.Insert(i + 6, Instruction.Create(OpCodes.Sub)); 29 | methodDef2.Body.Instructions.Insert(i + 7, Instruction.Create(OpCodes.Sizeof, methodDef2.Module.Import(typeof(bool)))); 30 | methodDef2.Body.Instructions.Insert(i + 8, Instruction.Create(OpCodes.Add)); 31 | methodDef2.Body.Instructions.Insert(i + 9, Instruction.Create(OpCodes.Ldc_R8, Math.PI / randomuint)); 32 | methodDef2.Body.Instructions.Insert(i + 10, Instruction.Create(OpCodes.Call, methodDef2.Module.Import(typeof(Math).GetMethod("Cos", new Type[] { typeof(double) })))); 33 | methodDef2.Body.Instructions.Insert(i + 11, Instruction.Create(OpCodes.Conv_I4)); 34 | methodDef2.Body.Instructions.Insert(i + 12, Instruction.Create(OpCodes.Sub)); 35 | } 36 | } 37 | } 38 | }*/ 39 | 40 | public static void Execute2(ModuleDef md) 41 | { 42 | foreach (var type in md.GetTypes()) 43 | { 44 | if (type.IsGlobalModuleType) continue; 45 | foreach (var meth in type.Methods) 46 | { 47 | if (!meth.HasBody) continue; 48 | { 49 | for (var i = 0; i < meth.Body.Instructions.Count; i++) 50 | { 51 | if (!meth.Body.Instructions[i].IsLdcI4()) continue; 52 | var numorig = new Random(Guid.NewGuid().GetHashCode()).Next(); 53 | var div = new Random(Guid.NewGuid().GetHashCode()).Next(); 54 | var num = numorig ^ div; 55 | 56 | var nop = OpCodes.Nop.ToInstruction(); 57 | 58 | var local = new Local(meth.Module.ImportAsTypeSig(typeof(int))); 59 | meth.Body.Variables.Add(local); 60 | 61 | meth.Body.Instructions.Insert(i + 1, OpCodes.Stloc.ToInstruction(local)); 62 | meth.Body.Instructions.Insert(i + 2, Instruction.Create(OpCodes.Ldc_I4, meth.Body.Instructions[i].GetLdcI4Value() - sizeof(float))); 63 | meth.Body.Instructions.Insert(i + 3, Instruction.Create(OpCodes.Ldc_I4, num)); 64 | meth.Body.Instructions.Insert(i + 4, Instruction.Create(OpCodes.Ldc_I4, div)); 65 | meth.Body.Instructions.Insert(i + 5, Instruction.Create(OpCodes.Xor)); 66 | meth.Body.Instructions.Insert(i + 6, Instruction.Create(OpCodes.Ldc_I4, numorig)); 67 | meth.Body.Instructions.Insert(i + 7, Instruction.Create(OpCodes.Bne_Un, nop)); 68 | meth.Body.Instructions.Insert(i + 8, Instruction.Create(OpCodes.Ldc_I4, 2)); 69 | meth.Body.Instructions.Insert(i + 9, OpCodes.Stloc.ToInstruction(local)); 70 | meth.Body.Instructions.Insert(i + 10, Instruction.Create(OpCodes.Sizeof, meth.Module.Import(typeof(float)))); 71 | meth.Body.Instructions.Insert(i + 11, Instruction.Create(OpCodes.Add)); 72 | meth.Body.Instructions.Insert(i + 12, nop); 73 | i += 12; 74 | } 75 | meth.Body.SimplifyBranches(); 76 | } 77 | } 78 | } 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /Protection/InvalidMD/InvalidMDPhase.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Renamer; 4 | using System; 5 | 6 | namespace MindLated.Protection.InvalidMD 7 | { 8 | internal class InvalidMDPhase 9 | { 10 | public static void Execute(AssemblyDef asm) 11 | { 12 | var module = asm.ManifestModule; 13 | module.Mvid = null; 14 | module.Name = RenamerPhase.GenerateString(RenamerPhase.RenameMode.Normal); 15 | asm.ManifestModule.Import(new FieldDefUser(RenamerPhase.GenerateString(RenamerPhase.RenameMode.Normal))); 16 | foreach (var typeDef in module.Types) 17 | { 18 | TypeDef typeDef2 = new TypeDefUser(RenamerPhase.GenerateString(RenamerPhase.RenameMode.Normal)); 19 | typeDef2.Methods.Add(new MethodDefUser()); 20 | typeDef2.NestedTypes.Add(new TypeDefUser(RenamerPhase.GenerateString(RenamerPhase.RenameMode.Normal))); 21 | MethodDef item = new MethodDefUser(); 22 | typeDef2.Methods.Add(item); 23 | typeDef.NestedTypes.Add(typeDef2); 24 | typeDef.Events.Add(new EventDefUser()); 25 | foreach (var meth in typeDef.Methods) 26 | { 27 | if (meth.Body == null) continue; 28 | meth.Body.SimplifyBranches(); 29 | if (string.Compare(meth.ReturnType.FullName, "System.Void", StringComparison.Ordinal) != 0 || !meth.HasBody || 30 | meth.Body.Instructions.Count == 0) continue; 31 | var typeSig = asm.ManifestModule.Import(typeof(int)).ToTypeSig(); 32 | var local = new Local(typeSig); 33 | var typeSig2 = asm.ManifestModule.Import(typeof(bool)).ToTypeSig(); 34 | var local2 = new Local(typeSig2); 35 | meth.Body.Variables.Add(local); 36 | meth.Body.Variables.Add(local2); 37 | var operand = meth.Body.Instructions[^1]; 38 | var instruction = new Instruction(OpCodes.Ret); 39 | var instruction2 = new Instruction(OpCodes.Ldc_I4_1); 40 | meth.Body.Instructions.Insert(0, new Instruction(OpCodes.Ldc_I4_0)); 41 | meth.Body.Instructions.Insert(1, new Instruction(OpCodes.Stloc, local)); 42 | meth.Body.Instructions.Insert(2, new Instruction(OpCodes.Br, instruction2)); 43 | var instruction3 = new Instruction(OpCodes.Ldloc, local); 44 | meth.Body.Instructions.Insert(3, instruction3); 45 | meth.Body.Instructions.Insert(4, new Instruction(OpCodes.Ldc_I4_0)); 46 | meth.Body.Instructions.Insert(5, new Instruction(OpCodes.Ceq)); 47 | meth.Body.Instructions.Insert(6, new Instruction(OpCodes.Ldc_I4_1)); 48 | meth.Body.Instructions.Insert(7, new Instruction(OpCodes.Ceq)); 49 | meth.Body.Instructions.Insert(8, new Instruction(OpCodes.Stloc, local2)); 50 | meth.Body.Instructions.Insert(9, new Instruction(OpCodes.Ldloc, local2)); 51 | meth.Body.Instructions.Insert(10, new Instruction(OpCodes.Brtrue, meth.Body.Instructions[10])); 52 | meth.Body.Instructions.Insert(11, new Instruction(OpCodes.Ret)); 53 | meth.Body.Instructions.Insert(12, new Instruction(OpCodes.Calli)); 54 | meth.Body.Instructions.Insert(13, new Instruction(OpCodes.Sizeof, operand)); 55 | meth.Body.Instructions.Insert(meth.Body.Instructions.Count, instruction2); 56 | meth.Body.Instructions.Insert(meth.Body.Instructions.Count, new Instruction(OpCodes.Stloc, local2)); 57 | meth.Body.Instructions.Insert(meth.Body.Instructions.Count, new Instruction(OpCodes.Br, instruction3)); 58 | meth.Body.Instructions.Insert(meth.Body.Instructions.Count, instruction); 59 | var exceptionHandler = new ExceptionHandler(ExceptionHandlerType.Finally) 60 | { 61 | HandlerStart = meth.Body.Instructions[10], 62 | HandlerEnd = meth.Body.Instructions[11], 63 | TryEnd = meth.Body.Instructions[14], 64 | TryStart = meth.Body.Instructions[12] 65 | }; 66 | if (!meth.Body.HasExceptionHandlers) 67 | { 68 | meth.Body.ExceptionHandlers.Add(exceptionHandler); 69 | } 70 | meth.Body.OptimizeBranches(); 71 | meth.Body.OptimizeMacros(); 72 | } 73 | } 74 | TypeDef typeDef3 = new TypeDefUser(RenamerPhase.GenerateString(RenamerPhase.RenameMode.Normal)); 75 | FieldDef item2 = new FieldDefUser(RenamerPhase.GenerateString(RenamerPhase.RenameMode.Normal), new FieldSig(module.Import(typeof(MindLatedPng)).ToTypeSig())); 76 | typeDef3.Fields.Add(item2); 77 | typeDef3.BaseType = module.Import(typeof(MindLatedPng)); 78 | module.Types.Add(typeDef3); 79 | TypeDef typeDef4 = new TypeDefUser(RenamerPhase.GenerateString(RenamerPhase.RenameMode.Normal)) 80 | { 81 | IsInterface = true, 82 | IsSealed = true 83 | }; 84 | module.Types.Add(typeDef4); 85 | module.TablesHeaderVersion = 257; 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /Protection/Arithmetic/Arithmetic.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Protection.Arithmetic.Functions; 4 | using MindLated.Protection.Arithmetic.Utils; 5 | using System; 6 | using System.Collections.Generic; 7 | 8 | namespace MindLated.Protection.Arithmetic 9 | { 10 | public static class Arithmetic 11 | { 12 | private static ModuleDef _moduleDef1 = null!; 13 | 14 | private static readonly List Tasks = new() 15 | { 16 | new Add(), 17 | new Sub(), 18 | new Div(), 19 | new Mul(), 20 | new Xor(), 21 | new Functions.Maths.Abs(), 22 | new Functions.Maths.Log(), 23 | new Functions.Maths.Log10(), 24 | new Functions.Maths.Sin(), 25 | new Functions.Maths.Cos(), 26 | new Functions.Maths.Floor(), 27 | new Functions.Maths.Round(), 28 | new Functions.Maths.Tan(), 29 | new Functions.Maths.Tanh(), 30 | new Functions.Maths.Sqrt(), 31 | new Functions.Maths.Ceiling(), 32 | new Functions.Maths.Truncate() 33 | }; 34 | 35 | public static void Execute(ModuleDef module) 36 | { 37 | _moduleDef1 = module; 38 | var generator = new Generator.Generator(); 39 | foreach (var type in module.Types) 40 | { 41 | foreach (var meth in type.Methods) 42 | { 43 | if (!meth.HasBody) continue; 44 | if (meth.DeclaringType.IsGlobalModuleType) continue; 45 | for (var i = 0; i < meth.Body.Instructions.Count; i++) 46 | { 47 | if (!ArithmeticUtils.CheckArithmetic(meth.Body.Instructions[i])) continue; 48 | if (meth.Body.Instructions[i].GetLdcI4Value() < 0) 49 | { 50 | var iFunction = Tasks[generator.Next(5)]; 51 | var lstInstr = GenerateBody(iFunction.Arithmetic(meth.Body.Instructions[i], module)); 52 | meth.Body.Instructions[i].OpCode = OpCodes.Nop; 53 | foreach (var instr in lstInstr) 54 | { 55 | meth.Body.Instructions.Insert(i + 1, instr); 56 | i++; 57 | } 58 | } 59 | else 60 | { 61 | var iFunction = Tasks[generator.Next(Tasks.Count)]; 62 | var lstInstr = GenerateBody(iFunction.Arithmetic(meth.Body.Instructions[i], module)); 63 | meth.Body.Instructions[i].OpCode = OpCodes.Nop; 64 | foreach (var instr in lstInstr) 65 | { 66 | meth.Body.Instructions.Insert(i + 1, instr); 67 | i++; 68 | } 69 | } 70 | } 71 | } 72 | } 73 | } 74 | 75 | private static List GenerateBody(ArithmeticVt arithmeticVTs) 76 | { 77 | var instr = new List(); 78 | if (IsArithmetic(arithmeticVTs.GetArithmetic())) 79 | { 80 | instr.Add(new Instruction(OpCodes.Ldc_R8, arithmeticVTs.GetValue().GetX())); 81 | instr.Add(new Instruction(OpCodes.Ldc_R8, arithmeticVTs.GetValue().GetY())); 82 | 83 | if (arithmeticVTs.GetToken().GetOperand() != null) 84 | { 85 | instr.Add(new Instruction(OpCodes.Call, arithmeticVTs.GetToken().GetOperand())); 86 | } 87 | instr.Add(new Instruction(arithmeticVTs.GetToken().GetOpCode())); 88 | instr.Add(new Instruction(OpCodes.Call, _moduleDef1.Import(typeof(Convert).GetMethod("ToInt32", new[] { typeof(double) })))); 89 | //instructions.Add(new Instruction(OpCodes.Conv_I4)); 90 | } 91 | else if (IsXor(arithmeticVTs.GetArithmetic())) 92 | { 93 | instr.Add(new Instruction(OpCodes.Ldc_I4, (int)arithmeticVTs.GetValue().GetX())); 94 | instr.Add(new Instruction(OpCodes.Ldc_I4, (int)arithmeticVTs.GetValue().GetY())); 95 | instr.Add(new Instruction(arithmeticVTs.GetToken().GetOpCode())); 96 | instr.Add(new Instruction(OpCodes.Conv_I4)); 97 | } 98 | return instr; 99 | } 100 | 101 | private static bool IsArithmetic(ArithmeticTypes arithmetic) 102 | { 103 | return arithmetic is 104 | ArithmeticTypes.Add or 105 | ArithmeticTypes.Sub or 106 | ArithmeticTypes.Div or 107 | ArithmeticTypes.Mul or 108 | ArithmeticTypes.Abs or 109 | ArithmeticTypes.Log or 110 | ArithmeticTypes.Log10 or 111 | ArithmeticTypes.Truncate or 112 | ArithmeticTypes.Sin or 113 | ArithmeticTypes.Cos or 114 | ArithmeticTypes.Floor or 115 | ArithmeticTypes.Round or 116 | ArithmeticTypes.Tan or 117 | ArithmeticTypes.Tanh or 118 | ArithmeticTypes.Sqrt or 119 | ArithmeticTypes.Ceiling; 120 | } 121 | 122 | private static bool IsXor(ArithmeticTypes arithmetic) 123 | { 124 | return arithmetic == ArithmeticTypes.Xor; 125 | } 126 | } 127 | } -------------------------------------------------------------------------------- /Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Protection/String/StringEncPhase.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using MindLated.Services; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Security.Cryptography; 9 | using System.Text; 10 | 11 | namespace MindLated.Protection.String 12 | { 13 | public static class StringEncPhase 14 | { 15 | private static readonly string Key1 = Renamer.RenamerPhase.GenerateString(Renamer.RenamerPhase.RenameMode.Key); 16 | private static readonly string Key2 = Renamer.RenamerPhase.GenerateString(Renamer.RenamerPhase.RenameMode.Key); 17 | private static readonly string Key3 = Renamer.RenamerPhase.GenerateString(Renamer.RenamerPhase.RenameMode.Key); 18 | 19 | private static void InjectClass(ModuleDef module) 20 | { 21 | var typeModule = ModuleDefMD.Load(typeof(EncryptionHelper).Module); 22 | var typeDef = typeModule.ResolveTypeDef(MDToken.ToRID(typeof(EncryptionHelper).MetadataToken)); 23 | var members = InjectHelper.Inject(typeDef, module.GlobalType, module); 24 | var dnlibDefs = members as IDnlibDef[] ?? members.ToArray(); 25 | Form1.Init = (MethodDef)dnlibDefs.Single(method => method.Name == "Decrypt"); 26 | var cctor = module.GlobalType.FindStaticConstructor(); 27 | Form1.Init2 = (MethodDef)dnlibDefs.Single(method => method.Name == "Search"); 28 | var init = (MethodDef)dnlibDefs.Single(method => method.Name == "Generate"); 29 | cctor.Body.Instructions.Insert(cctor.Body.Instructions.Count - 1, Instruction.Create(OpCodes.Call, init)); 30 | foreach (var md in module.GlobalType.Methods) 31 | { 32 | if (md.Name == ".ctor") 33 | { 34 | module.GlobalType.Remove(md); 35 | break; 36 | } 37 | } 38 | } 39 | 40 | private static readonly List Str = new(); 41 | 42 | public static void Execute(ModuleDef module) 43 | { 44 | InjectClass(module); 45 | var p = Renamer.RenamerPhase.GenerateString(Renamer.RenamerPhase.RenameMode.Normal); 46 | foreach (var type in module.GetTypes()) 47 | { 48 | if (type.IsGlobalModuleType) continue; 49 | 50 | foreach (var meth in type.Methods) 51 | { 52 | if (!meth.HasBody) continue; 53 | 54 | var instr = meth.Body.Instructions; 55 | for (var i = 0; i < instr.Count; i++) 56 | { 57 | if (instr[i].OpCode == OpCodes.Ldstr) 58 | { 59 | var originalStr = instr[i].Operand as string; 60 | var encodedStr = Encrypt(originalStr!); 61 | instr[i].Operand = encodedStr; 62 | Str.Add(encodedStr); 63 | instr.Insert(i + 1, Instruction.Create(OpCodes.Ldc_I4, Str.LastIndexOf(encodedStr))); 64 | instr.Insert(i + 2, Instruction.Create(OpCodes.Call, Form1.Init2)); 65 | instr.Insert(i + 3, Instruction.Create(OpCodes.Call, Form1.Init)); 66 | instr.RemoveAt(i); 67 | } 68 | } 69 | meth.Body.SimplifyBranches(); 70 | } 71 | } 72 | File.WriteAllLines($"{Path.GetTempPath()}List.txt", Str); 73 | var bytes = File.ReadAllBytes($"{Path.GetTempPath()}List.txt"); 74 | module.Resources.Add(new EmbeddedResource(p, Hush(bytes), ManifestResourceAttributes.Public)); 75 | foreach (var type in module.GetTypes()) 76 | { 77 | foreach (var meth in type.Methods) 78 | { 79 | if (!meth.HasBody) continue; 80 | 81 | var instr = meth.Body.Instructions; 82 | for (var i = 0; i < instr.Count; i++) 83 | { 84 | if (instr[i].OpCode == OpCodes.Ldstr) 85 | { 86 | if (instr[i].Operand as string == "%Replace") 87 | { 88 | instr[i].Operand = p; 89 | } 90 | if (instr[i].Operand as string == "%Key1") 91 | { 92 | instr[i].Operand = Key1; 93 | } 94 | if (instr[i].Operand as string == "%Key2") 95 | { 96 | instr[i].Operand = Key2; 97 | } 98 | if (instr[i].Operand as string == "%Key3") 99 | { 100 | instr[i].Operand = Key3; 101 | } 102 | } 103 | } 104 | meth.Body.SimplifyBranches(); 105 | } 106 | } 107 | File.Delete($"{Path.GetTempPath()}List.txt"); 108 | } 109 | 110 | private static byte[] Hush(IReadOnlyList text) 111 | { 112 | var key = new Rfc2898DeriveBytes(Key1, Encoding.ASCII.GetBytes(Key2)).GetBytes(256 / 8); 113 | var xor = new byte[text.Count]; 114 | for (var i = 0; i < text.Count; i++) 115 | { 116 | xor[i] = (byte)(text[i] ^ key[i % key.Length]); 117 | } 118 | return xor; 119 | } 120 | 121 | private static string Encrypt(string plainText) 122 | { 123 | var plainTextBytes = Encoding.UTF8.GetBytes(plainText); 124 | var keyBytes = new Rfc2898DeriveBytes(Key1, Encoding.ASCII.GetBytes(Key2)).GetBytes(256 / 8); 125 | var symmetricKey = new AesCng { Mode = CipherMode.CBC, Padding = PaddingMode.PKCS7 }; 126 | var encryptor = symmetricKey.CreateEncryptor(keyBytes, Encoding.ASCII.GetBytes(Key3)); 127 | using var memoryStream = new MemoryStream(); 128 | using var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write); 129 | cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length); 130 | cryptoStream.FlushFinalBlock(); 131 | var cipherTextBytes = memoryStream.ToArray(); 132 | cryptoStream.Close(); 133 | memoryStream.Close(); 134 | return Convert.ToBase64String(cipherTextBytes); 135 | } 136 | } 137 | } -------------------------------------------------------------------------------- /Protection/Proxy/ProxyMeth.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace MindLated.Protection.Proxy 8 | { 9 | public static class ProxyMeth 10 | { 11 | private static readonly Random Rand = new(); 12 | private static readonly List MemberRefList = new(); 13 | 14 | //Scan de toutes les MemberRef 15 | private static void ScanMemberRef(ModuleDef module) 16 | { 17 | foreach (var type in module.Types) 18 | { 19 | foreach (var meth in type.Methods) 20 | { 21 | if (!meth.HasBody || !meth.Body.HasInstructions) continue; 22 | for (var i = 0; i < meth.Body.Instructions.Count - 1; i++) 23 | { 24 | if (meth.Body.Instructions[i].OpCode != OpCodes.Call) continue; 25 | try 26 | { 27 | var original = (MemberRef)meth.Body.Instructions[i].Operand; 28 | if (!original.HasThis) 29 | { 30 | MemberRefList.Add(original); 31 | } 32 | } 33 | catch 34 | { 35 | // ignored 36 | } 37 | } 38 | } 39 | } 40 | } 41 | 42 | private static MethodDef GenerateSwitch(MemberRef original, ModuleDef md) 43 | { 44 | try 45 | { 46 | var type = original.MethodSig.Params.ToList(); 47 | type.Add(md.CorLibTypes.Int32); 48 | var methImplFlags = MethodImplAttributes.IL | MethodImplAttributes.Managed; 49 | var methFlags = MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig | MethodAttributes.ReuseSlot; 50 | MethodDef meth = new MethodDefUser($"ProxyMeth{Rand.Next(0, int.MaxValue)}", MethodSig.CreateStatic(original.MethodSig.RetType, type.ToArray()), methImplFlags, methFlags) 51 | { 52 | Body = new CilBody() 53 | }; 54 | meth.Body.Variables.Add(new Local(md.CorLibTypes.Int32)); 55 | meth.Body.Variables.Add(new Local(md.CorLibTypes.Int32)); 56 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Ldarg_0)); 57 | var lst = new List(); 58 | var switchs = new Instruction(OpCodes.Switch); 59 | meth.Body.Instructions.Add(switchs); 60 | var brS = new Instruction(OpCodes.Br_S); 61 | meth.Body.Instructions.Add(brS); 62 | for (var i = 0; i < 5; i++) 63 | { 64 | for (var ia = 0; ia <= original.MethodSig.Params.Count - 1; ia++) 65 | { 66 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Ldarg, meth.Parameters[ia])); 67 | if (ia == 0) 68 | { 69 | lst.Add(Instruction.Create(OpCodes.Ldarg, meth.Parameters[ia])); 70 | } 71 | } 72 | var ldstr = Instruction.Create(OpCodes.Ldc_I4, i); 73 | meth.Body.Instructions.Add(ldstr); 74 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Ret)); 75 | } 76 | 77 | var ldnull = Instruction.Create(OpCodes.Ldnull); 78 | meth.Body.Instructions.Add(ldnull); 79 | meth.Body.Instructions.Add(Instruction.Create(OpCodes.Ret)); 80 | brS.Operand = ldnull; 81 | switchs.Operand = lst; 82 | return meth; 83 | } 84 | catch 85 | { 86 | return null!; 87 | } 88 | } 89 | 90 | public static void Execute(ModuleDef module) 91 | { 92 | ScanMemberRef(module); 93 | foreach (var type in module.GetTypes()) 94 | { 95 | if (type.IsGlobalModuleType) continue; 96 | foreach (var meth in type.Methods.ToArray()) 97 | { 98 | if (!meth.HasBody || meth.Name.Contains("ProxyMeth")) continue; 99 | var instr = meth.Body.Instructions; 100 | for (var i = 0; i < instr.Count; i++) 101 | { 102 | if (meth.Body.Instructions[i].OpCode != OpCodes.Call) continue; 103 | try 104 | { 105 | var original = (MemberRef)meth.Body.Instructions[i].Operand; 106 | if (!original.HasThis) 107 | { 108 | var proxy = GenerateSwitch(original, module); 109 | meth.DeclaringType.Methods.Add(proxy); 110 | instr[i].OpCode = OpCodes.Call; 111 | instr[i].Operand = proxy; 112 | var random = Rand.Next(0, 5); 113 | for (var b = 0; b < proxy.Body.Instructions.Count - 1; b++) 114 | { 115 | if (proxy.Body.Instructions[b].OpCode == OpCodes.Ldc_I4) 116 | { 117 | if (string.Compare(proxy.Body.Instructions[b].Operand.ToString(), random.ToString(), StringComparison.Ordinal) != 0) 118 | { 119 | proxy.Body.Instructions[b].OpCode = OpCodes.Call; 120 | proxy.Body.Instructions[b].Operand = MemberRefList.Where(m => m.MethodSig.Params.Count == original.MethodSig.Params.Count).ToList().Random(); 121 | } 122 | else 123 | { 124 | proxy.Body.Instructions[b].OpCode = OpCodes.Call; 125 | proxy.Body.Instructions[b].Operand = original; 126 | } 127 | } 128 | } 129 | 130 | meth.Body.Instructions.Insert(i, Instruction.CreateLdcI4(random)); 131 | 132 | /* MethodSig originalsignature = original.MethodSig; 133 | var methImplFlags = MethodImplAttributes.IL | MethodImplAttributes.Managed; 134 | var methFlags = MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig | MethodAttributes.ReuseSlot; 135 | var meth1 = new MethodDefUser("ProxyMeth" + rand.Next(0, int.MaxValue).ToString(), 136 | originalsignature, 137 | methImplFlags, methFlags); 138 | module.GlobalType.Methods.Add(meth1); 139 | meth1.Body = new CilBody(); 140 | for (int ia = 0; ia <= originalsignature.Params.Count - 1; ia++) 141 | { 142 | meth1.Body.Instructions.Add(Instruction.Create(OpCodes.Ldarg, meth1.Parameters[ia])); 143 | } 144 | meth1.Body.Instructions.Add(Instruction.Create(OpCodes.Call, original)); 145 | meth1.Body.Instructions.Add(Instruction.Create(OpCodes.Ret)); 146 | instr[i].OpCode = OpCodes.Call; 147 | instr[i].Operand = meth1;*/ 148 | } 149 | } 150 | catch 151 | { 152 | // ignored 153 | } 154 | } 155 | } 156 | } 157 | } 158 | } 159 | 160 | public static class EnumerableHelper 161 | { 162 | private static readonly Random R; 163 | 164 | static EnumerableHelper() 165 | { 166 | R = new Random(); 167 | } 168 | 169 | public static TE Random(IEnumerable input) 170 | { 171 | var enumerable = input as TE[] ?? input.ToArray(); 172 | return enumerable.ElementAt(R.Next(enumerable.Length)); 173 | } 174 | } 175 | 176 | public static class EnumerableExtensions 177 | { 178 | public static T Random(this IEnumerable input) 179 | { 180 | return EnumerableHelper.Random(input); 181 | } 182 | } 183 | } -------------------------------------------------------------------------------- /Services/InjectHelper.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Emit; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace MindLated.Services 7 | { 8 | public static class InjectHelper 9 | { 10 | private static TypeDefUser Clone(TypeDef origin) 11 | { 12 | var ret = new TypeDefUser(origin.Namespace, origin.Name) 13 | { 14 | Attributes = origin.Attributes 15 | }; 16 | 17 | if (origin.ClassLayout != null) 18 | ret.ClassLayout = new ClassLayoutUser(origin.ClassLayout.PackingSize, origin.ClassSize); 19 | 20 | foreach (var genericParam in origin.GenericParameters) 21 | ret.GenericParameters.Add(new GenericParamUser(genericParam.Number, genericParam.Flags, "-")); 22 | 23 | return ret; 24 | } 25 | 26 | private static MethodDefUser Clone(MethodDef origin) 27 | { 28 | var ret = new MethodDefUser(origin.Name, null, origin.ImplAttributes, origin.Attributes); 29 | 30 | foreach (var genericParam in origin.GenericParameters) 31 | ret.GenericParameters.Add(new GenericParamUser(genericParam.Number, genericParam.Flags, "-")); 32 | 33 | return ret; 34 | } 35 | 36 | private static FieldDefUser Clone(FieldDef origin) 37 | { 38 | var ret = new FieldDefUser(origin.Name, null, origin.Attributes); 39 | return ret; 40 | } 41 | 42 | private static TypeDef PopulateContext(TypeDef typeDef, InjectContext ctx) 43 | { 44 | TypeDef ret; 45 | if (!ctx.Mep.TryGetValue(typeDef, out var existing)) 46 | { 47 | ret = Clone(typeDef); 48 | ctx.Mep[typeDef] = ret; 49 | } 50 | else 51 | ret = (TypeDef)existing; 52 | 53 | foreach (var nestedType in typeDef.NestedTypes) 54 | ret.NestedTypes.Add(PopulateContext(nestedType, ctx)); 55 | 56 | foreach (var method in typeDef.Methods) 57 | ret.Methods.Add((MethodDef)(ctx.Mep[method] = Clone(method))); 58 | 59 | foreach (var field in typeDef.Fields) 60 | ret.Fields.Add((FieldDef)(ctx.Mep[field] = Clone(field))); 61 | 62 | return ret; 63 | } 64 | 65 | private static void CopyTypeDef(TypeDef typeDef, InjectContext ctx) 66 | { 67 | var newTypeDef = (TypeDef)ctx.Mep[typeDef]; 68 | 69 | newTypeDef.BaseType = ctx.Importer.Import(typeDef.BaseType); 70 | 71 | foreach (var iface in typeDef.Interfaces) 72 | newTypeDef.Interfaces.Add(new InterfaceImplUser(ctx.Importer.Import(iface.Interface))); 73 | } 74 | 75 | private static void CopyMethodDef(MethodDef methodDef, InjectContext ctx) 76 | { 77 | var newMethodDef = (MethodDef)ctx.Mep[methodDef]; 78 | 79 | newMethodDef.Signature = ctx.Importer.Import(methodDef.Signature); 80 | newMethodDef.Parameters.UpdateParameterTypes(); 81 | 82 | if (methodDef.ImplMap != null) 83 | newMethodDef.ImplMap = new ImplMapUser(new ModuleRefUser(ctx.TargetModule, methodDef.ImplMap.Module.Name), methodDef.ImplMap.Name, methodDef.ImplMap.Attributes); 84 | 85 | foreach (var ca in methodDef.CustomAttributes) 86 | newMethodDef.CustomAttributes.Add(new CustomAttribute((ICustomAttributeType)ctx.Importer.Import(ca.Constructor))); 87 | 88 | if (!methodDef.HasBody) 89 | return; 90 | newMethodDef.Body = new CilBody(methodDef.Body.InitLocals, new List(), 91 | new List(), new List()) 92 | { MaxStack = methodDef.Body.MaxStack }; 93 | 94 | var bodyMap = new Dictionary(); 95 | 96 | foreach (var local in methodDef.Body.Variables) 97 | { 98 | var newLocal = new Local(ctx.Importer.Import(local.Type)); 99 | newMethodDef.Body.Variables.Add(newLocal); 100 | newLocal.Name = local.Name; 101 | newLocal.Attributes = local.Attributes; 102 | 103 | bodyMap[local] = newLocal; 104 | } 105 | 106 | foreach (var instr in methodDef.Body.Instructions) 107 | { 108 | var newInstr = new Instruction(instr.OpCode, instr.Operand) 109 | { 110 | SequencePoint = instr.SequencePoint 111 | }; 112 | 113 | switch (newInstr.Operand) 114 | { 115 | case IType type: 116 | newInstr.Operand = ctx.Importer.Import(type); 117 | break; 118 | 119 | case IMethod method: 120 | newInstr.Operand = ctx.Importer.Import(method); 121 | break; 122 | 123 | case IField field: 124 | newInstr.Operand = ctx.Importer.Import(field); 125 | break; 126 | } 127 | 128 | newMethodDef.Body.Instructions.Add(newInstr); 129 | bodyMap[instr] = newInstr; 130 | } 131 | 132 | foreach (var instr in newMethodDef.Body.Instructions) 133 | { 134 | if (instr.Operand != null && bodyMap.ContainsKey(instr.Operand)) 135 | instr.Operand = bodyMap[instr.Operand]; 136 | else if (instr.Operand is Instruction[] v) 137 | instr.Operand = v.Select(target => (Instruction)bodyMap[target]).ToArray(); 138 | } 139 | 140 | foreach (var eh in methodDef.Body.ExceptionHandlers) 141 | newMethodDef.Body.ExceptionHandlers.Add(new ExceptionHandler(eh.HandlerType) 142 | { 143 | CatchType = eh.CatchType == null ? null : ctx.Importer.Import(eh.CatchType), 144 | TryStart = (Instruction)bodyMap[eh.TryStart], 145 | TryEnd = (Instruction)bodyMap[eh.TryEnd], 146 | HandlerStart = (Instruction)bodyMap[eh.HandlerStart], 147 | HandlerEnd = (Instruction)bodyMap[eh.HandlerEnd], 148 | FilterStart = eh.FilterStart == null ? null : (Instruction)bodyMap[eh.FilterStart] 149 | }); 150 | 151 | newMethodDef.Body.SimplifyMacros(newMethodDef.Parameters); 152 | } 153 | 154 | private static void CopyFieldDef(FieldDef fieldDef, InjectContext ctx) 155 | { 156 | var newFieldDef = (FieldDef)ctx.Mep[fieldDef]; 157 | 158 | newFieldDef.Signature = ctx.Importer.Import(fieldDef.Signature); 159 | } 160 | 161 | private static void Copy(TypeDef typeDef, InjectContext ctx, bool copySelf) 162 | { 163 | if (copySelf) 164 | CopyTypeDef(typeDef, ctx); 165 | 166 | foreach (var nestedType in typeDef.NestedTypes) 167 | Copy(nestedType, ctx, true); 168 | 169 | foreach (var method in typeDef.Methods) 170 | CopyMethodDef(method, ctx); 171 | 172 | foreach (var field in typeDef.Fields) 173 | CopyFieldDef(field, ctx); 174 | } 175 | 176 | public static TypeDef Inject(TypeDef typeDef, ModuleDef target) 177 | { 178 | var ctx = new InjectContext(target); 179 | PopulateContext(typeDef, ctx); 180 | Copy(typeDef, ctx, true); 181 | return (TypeDef)ctx.Mep[typeDef]; 182 | } 183 | 184 | public static MethodDef Inject(MethodDef methodDef, ModuleDef target) 185 | { 186 | var ctx = new InjectContext(target) 187 | { 188 | Mep = 189 | { 190 | [methodDef] = Clone(methodDef) 191 | } 192 | }; 193 | CopyMethodDef(methodDef, ctx); 194 | return (MethodDef)ctx.Mep[methodDef]; 195 | } 196 | 197 | public static IEnumerable Inject(TypeDef typeDef, TypeDef newType, ModuleDef target) 198 | { 199 | var ctx = new InjectContext(target) 200 | { 201 | Mep = 202 | { 203 | [typeDef] = newType 204 | } 205 | }; 206 | PopulateContext(typeDef, ctx); 207 | Copy(typeDef, ctx, false); 208 | return ctx.Mep.Values.Except(new[] { newType }); 209 | } 210 | 211 | private class InjectContext : ImportMapper 212 | { 213 | public readonly Dictionary Mep = new(); 214 | 215 | public readonly ModuleDef TargetModule; 216 | 217 | public InjectContext(ModuleDef target) 218 | { 219 | TargetModule = target; 220 | Importer = new Importer(target, ImporterOptions.TryToUseTypeDefs, new GenericParamContext(), this); 221 | } 222 | 223 | public Importer Importer { get; } 224 | 225 | public override ITypeDefOrRef? Map(ITypeDefOrRef typeDefOrRef) 226 | { 227 | return typeDefOrRef is TypeDef typeDef && Mep.ContainsKey(typeDef) ? Mep[typeDef] as TypeDef : null; 228 | } 229 | 230 | public override IMethod? Map(MethodDef methodDef) 231 | { 232 | return Mep.ContainsKey(methodDef) ? Mep[methodDef] as MethodDef : null; 233 | } 234 | 235 | public override IField? Map(FieldDef fieldDef) 236 | { 237 | return Mep.ContainsKey(fieldDef) ? Mep[fieldDef] as FieldDef : null; 238 | } 239 | } 240 | } 241 | } -------------------------------------------------------------------------------- /Protection/Anti/Runtime/AntiDumpRun.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace MindLated.Protection.Anti.Runtime 5 | { 6 | internal class AntiDumpRun 7 | { 8 | private enum MemoryProtection 9 | { 10 | ExecuteReadWrite = 0x40, 11 | } 12 | 13 | private static unsafe void CopyBlock(void* destination, void* source, uint byteCount) 14 | { 15 | } 16 | 17 | private static unsafe void InitBlock(void* startAddress, byte value, uint byteCount) 18 | { 19 | } 20 | 21 | [DllImport("kernel32.dll")] 22 | [return: MarshalAs(UnmanagedType.Bool)] 23 | private static extern bool VirtualProtect( 24 | IntPtr lpAddress, 25 | uint dwSize, 26 | [MarshalAs(UnmanagedType.U4)] MemoryProtection flNewProtect, 27 | [MarshalAs(UnmanagedType.U4)] out MemoryProtection lpflOldProtect); 28 | 29 | private static unsafe void Initialize() 30 | { 31 | var module = typeof(AntiDumpRun).Module; 32 | var bas = (byte*)Marshal.GetHINSTANCE(module); 33 | var ptr = bas + 0x3c; 34 | ptr = bas + *(uint*)ptr; 35 | ptr += 0x6; 36 | var sectNum = *(ushort*)ptr; 37 | ptr += 14; 38 | var optSize = *(ushort*)ptr; 39 | ptr = ptr + 0x4 + optSize; 40 | var @new = stackalloc byte[11]; 41 | if (module.FullyQualifiedName[0] != '<') 42 | { 43 | var mdDir = bas + *(uint*)(ptr - 16); 44 | if (*(uint*)(ptr - 0x78) != 0) 45 | { 46 | var importDir = bas + *(uint*)(ptr - 0x78); 47 | var oftMod = bas + *(uint*)importDir; 48 | var modName = bas + *(uint*)(importDir + 12); 49 | var funcName = bas + *(uint*)oftMod + 2; 50 | VirtualProtect(new IntPtr(modName), 11, MemoryProtection.ExecuteReadWrite, out _); 51 | *(uint*)@new = 0x6c64746e; 52 | *((uint*)@new + 1) = 0x6c642e6c; 53 | *((ushort*)@new + 4) = 0x006c; 54 | *(@new + 10) = 0; 55 | CopyBlock(modName, @new, 11); 56 | VirtualProtect(new IntPtr(funcName), 11, MemoryProtection.ExecuteReadWrite, out _); 57 | *(uint*)@new = 0x6f43744e; 58 | *((uint*)@new + 1) = 0x6e69746e; 59 | *((ushort*)@new + 4) = 0x6575; 60 | *(@new + 10) = 0; 61 | CopyBlock(funcName, @new, 11); 62 | } 63 | 64 | for (var i = 0; i < sectNum; i++) 65 | { 66 | VirtualProtect(new IntPtr(ptr), 8, MemoryProtection.ExecuteReadWrite, out _); 67 | InitBlock(ptr, 0, 8); 68 | ptr += 0x28; 69 | } 70 | 71 | VirtualProtect(new IntPtr(mdDir), 0x48, MemoryProtection.ExecuteReadWrite, out _); 72 | var mdHdr = bas + *(uint*)(mdDir + 8); 73 | InitBlock(mdDir, 0, 16); 74 | VirtualProtect(new IntPtr(mdHdr), 4, MemoryProtection.ExecuteReadWrite, out _); 75 | *(uint*)mdHdr = 0; 76 | mdHdr += 12; 77 | mdHdr += *(uint*)mdHdr; 78 | mdHdr = (byte*)(((ulong)mdHdr + 7) & ~3UL); 79 | mdHdr += 2; 80 | ushort numOfStream = *mdHdr; 81 | mdHdr += 2; 82 | for (var i = 0; i < numOfStream; i++) 83 | { 84 | VirtualProtect(new IntPtr(mdHdr), 8, MemoryProtection.ExecuteReadWrite, out _); 85 | mdHdr += 4; 86 | mdHdr += 4; 87 | for (var ii = 0; ii < 8; ii++) 88 | { 89 | VirtualProtect(new IntPtr(mdHdr), 4, MemoryProtection.ExecuteReadWrite, out _); 90 | *mdHdr = 0; 91 | mdHdr++; 92 | if (*mdHdr == 0) 93 | { 94 | mdHdr += 3; 95 | break; 96 | } 97 | *mdHdr = 0; 98 | mdHdr++; 99 | if (*mdHdr == 0) 100 | { 101 | mdHdr += 2; 102 | break; 103 | } 104 | *mdHdr = 0; 105 | mdHdr++; 106 | if (*mdHdr == 0) 107 | { 108 | mdHdr += 1; 109 | break; 110 | } 111 | *mdHdr = 0; 112 | mdHdr++; 113 | } 114 | } 115 | } 116 | else 117 | { 118 | var mdDir = *(uint*)(ptr - 16); 119 | var importDir = *(uint*)(ptr - 0x78); 120 | 121 | var vAdrs = new uint[sectNum]; 122 | var vSizes = new uint[sectNum]; 123 | var rAdrs = new uint[sectNum]; 124 | for (var i = 0; i < sectNum; i++) 125 | { 126 | VirtualProtect(new IntPtr(ptr), 8, MemoryProtection.ExecuteReadWrite, out _); 127 | Marshal.Copy(new byte[8], 0, (IntPtr)ptr, 8); 128 | vAdrs[i] = *(uint*)(ptr + 12); 129 | vSizes[i] = *(uint*)(ptr + 8); 130 | rAdrs[i] = *(uint*)(ptr + 20); 131 | ptr += 0x28; 132 | } 133 | 134 | if (importDir != 0) 135 | { 136 | for (var i = 0; i < sectNum; i++) 137 | if (vAdrs[i] <= importDir && importDir < vAdrs[i] + vSizes[i]) 138 | { 139 | importDir = importDir - vAdrs[i] + rAdrs[i]; 140 | break; 141 | } 142 | 143 | var importDirPtr = bas + importDir; 144 | var oftMod = *(uint*)importDirPtr; 145 | for (var i = 0; i < sectNum; i++) 146 | if (vAdrs[i] <= oftMod && oftMod < vAdrs[i] + vSizes[i]) 147 | { 148 | oftMod = oftMod - vAdrs[i] + rAdrs[i]; 149 | break; 150 | } 151 | 152 | var oftModPtr = bas + oftMod; 153 | var modName = *(uint*)(importDirPtr + 12); 154 | for (var i = 0; i < sectNum; i++) 155 | if (vAdrs[i] <= modName && modName < vAdrs[i] + vSizes[i]) 156 | { 157 | modName = modName - vAdrs[i] + rAdrs[i]; 158 | break; 159 | } 160 | 161 | var funcName = *(uint*)oftModPtr + 2; 162 | for (var i = 0; i < sectNum; i++) 163 | if (vAdrs[i] <= funcName && funcName < vAdrs[i] + vSizes[i]) 164 | { 165 | funcName = funcName - vAdrs[i] + rAdrs[i]; 166 | break; 167 | } 168 | 169 | VirtualProtect(new IntPtr(bas + modName), 11, MemoryProtection.ExecuteReadWrite, out _); 170 | 171 | *(uint*)@new = 0x6c64746e; 172 | *((uint*)@new + 1) = 0x6c642e6c; 173 | *((ushort*)@new + 4) = 0x006c; 174 | *(@new + 10) = 0; 175 | 176 | CopyBlock(bas + modName, @new, 11); 177 | 178 | VirtualProtect(new IntPtr(bas + funcName), 11, MemoryProtection.ExecuteReadWrite, out _); 179 | 180 | *(uint*)@new = 0x6f43744e; 181 | *((uint*)@new + 1) = 0x6e69746e; 182 | *((ushort*)@new + 4) = 0x6575; 183 | *(@new + 10) = 0; 184 | 185 | CopyBlock(bas + funcName, @new, 11); 186 | } 187 | 188 | for (var i = 0; i < sectNum; i++) 189 | if (vAdrs[i] <= mdDir && mdDir < vAdrs[i] + vSizes[i]) 190 | { 191 | mdDir = mdDir - vAdrs[i] + rAdrs[i]; 192 | break; 193 | } 194 | 195 | var mdDirPtr = bas + mdDir; 196 | VirtualProtect(new IntPtr(mdDirPtr), 0x48, MemoryProtection.ExecuteReadWrite, out _); 197 | var mdHdr = *(uint*)(mdDirPtr + 8); 198 | for (var i = 0; i < sectNum; i++) 199 | if (vAdrs[i] <= mdHdr && mdHdr < vAdrs[i] + vSizes[i]) 200 | { 201 | mdHdr = mdHdr - vAdrs[i] + rAdrs[i]; 202 | break; 203 | } 204 | 205 | InitBlock(mdDirPtr, 0, 16); 206 | 207 | var mdHdrPtr = bas + mdHdr; 208 | VirtualProtect(new IntPtr(mdHdrPtr), 4, MemoryProtection.ExecuteReadWrite, out _); 209 | *(uint*)mdHdrPtr = 0; 210 | mdHdrPtr += 12; 211 | mdHdrPtr += *(uint*)mdHdrPtr; 212 | mdHdrPtr = (byte*)(((ulong)mdHdrPtr + 7) & ~3UL); 213 | mdHdrPtr += 2; 214 | ushort numOfStream = *mdHdrPtr; 215 | mdHdrPtr += 2; 216 | for (var i = 0; i < numOfStream; i++) 217 | { 218 | VirtualProtect(new IntPtr(mdHdrPtr), 8, MemoryProtection.ExecuteReadWrite, out _); 219 | mdHdrPtr += 4; 220 | mdHdrPtr += 4; 221 | for (var ii = 0; ii < 8; ii++) 222 | { 223 | VirtualProtect(new IntPtr(mdHdrPtr), 4, MemoryProtection.ExecuteReadWrite, out _); 224 | *mdHdrPtr = 0; 225 | mdHdrPtr++; 226 | if (*mdHdrPtr == 0) 227 | { 228 | mdHdrPtr += 3; 229 | break; 230 | } 231 | 232 | *mdHdrPtr = 0; 233 | mdHdrPtr++; 234 | if (*mdHdrPtr == 0) 235 | { 236 | mdHdrPtr += 2; 237 | break; 238 | } 239 | 240 | *mdHdrPtr = 0; 241 | mdHdrPtr++; 242 | if (*mdHdrPtr == 0) 243 | { 244 | mdHdrPtr += 1; 245 | break; 246 | } 247 | 248 | *mdHdrPtr = 0; 249 | mdHdrPtr++; 250 | } 251 | } 252 | } 253 | } 254 | } 255 | } -------------------------------------------------------------------------------- /Form1.cs: -------------------------------------------------------------------------------- 1 | using dnlib.DotNet; 2 | using dnlib.DotNet.Writer; 3 | using MindLated.Protection.Anti; 4 | using MindLated.Protection.Arithmetic; 5 | using MindLated.Protection.CtrlFlow; 6 | using MindLated.Protection.INT; 7 | using MindLated.Protection.InvalidMD; 8 | using MindLated.Protection.LocalF; 9 | using MindLated.Protection.Other; 10 | using MindLated.Protection.Proxy; 11 | using MindLated.Protection.Renamer; 12 | using MindLated.Protection.String; 13 | using MindLated.Protection.StringOnline; 14 | using System; 15 | using System.Collections.Generic; 16 | using System.Drawing; 17 | using System.IO; 18 | using System.Threading; 19 | using System.Windows.Forms; 20 | 21 | namespace MindLated; 22 | 23 | public partial class Form1 : Form 24 | { 25 | public static MethodDef? Init; 26 | public static MethodDef? Init2; 27 | private readonly List _func = new(); 28 | private string _directoryName = string.Empty; 29 | 30 | public Form1() => InitializeComponent(); 31 | 32 | private ModuleDefMD Md { get; set; } = null!; 33 | 34 | private static void AppendMsg(RichTextBox rtb, Color color, string text, bool autoTime) 35 | { 36 | rtb.BeginInvoke(new ThreadStart(() => 37 | { 38 | lock (rtb) 39 | { 40 | rtb.Focus(); 41 | if (rtb.TextLength > 100000) rtb.Clear(); 42 | 43 | using var temp = new RichTextBox(); 44 | temp.SelectionColor = color; 45 | if (autoTime) 46 | temp.AppendText(DateTime.Now.ToString("HH:mm:ss") + " "); 47 | temp.AppendText(text); 48 | rtb.Select(rtb.Rtf.Length, 0); 49 | rtb.SelectedRtf = temp.Rtf; 50 | } 51 | })); 52 | } 53 | 54 | private void TextBox1_DragDrop(object sender, DragEventArgs e) 55 | { 56 | try 57 | { 58 | textBox1.Clear(); 59 | var array = (Array)e.Data?.GetData(DataFormats.FileDrop)!; 60 | var text = array.GetValue(0)!.ToString(); 61 | var num = text!.LastIndexOf(".", StringComparison.Ordinal); 62 | if (num == -1) 63 | return; 64 | var text2 = text[num..]; 65 | text2 = text2.ToLower(); 66 | if (string.Compare(text2, ".exe", StringComparison.Ordinal) != 0 && 67 | string.Compare(text2, ".dll", StringComparison.Ordinal) != 0) return; 68 | 69 | Activate(); 70 | textBox1.Text = text; 71 | var num2 = text.LastIndexOf("\\", StringComparison.Ordinal); 72 | if (num2 != -1) _directoryName = text.Remove(num2, text.Length - num2); 73 | 74 | if (_directoryName.Length == 2) _directoryName += "\\"; 75 | } 76 | catch 77 | { 78 | /* ignored */ 79 | } 80 | } 81 | 82 | private void TextBox1_DragEnter(object sender, DragEventArgs e) 83 | { 84 | e.Effect = e.Data != null && e.Data.GetDataPresent(DataFormats.FileDrop) 85 | ? DragDropEffects.Copy 86 | : DragDropEffects.None; 87 | } 88 | 89 | private void Button1_Click(object sender, EventArgs e) 90 | { 91 | Md = ModuleDefMD.Load(textBox1.Text); 92 | foreach (var func in _func) func(); 93 | var text2 = Path.GetDirectoryName(textBox1.Text); 94 | if (text2 != null && !text2.EndsWith("\\")) 95 | text2 += "\\"; 96 | var path = 97 | $"{text2}{Path.GetFileNameWithoutExtension(textBox1.Text)}_protected{Path.GetExtension(textBox1.Text)}"; 98 | 99 | var opts = new ModuleWriterOptions(Md) 100 | { 101 | Logger = DummyLogger.NoThrowInstance 102 | }; 103 | Md.Write(path, opts); 104 | 105 | AppendMsg(richTextBox1, Color.Red, $"Save: {path}", true); 106 | } 107 | 108 | private void CheckProcess(CheckBox check, Action action, string str) 109 | { 110 | if (check.Checked) 111 | { 112 | _func.Add(action); 113 | listBox1.Items.Add(str); 114 | } 115 | else 116 | { 117 | _func.Remove(action); 118 | listBox1.Items.Remove(str); 119 | } 120 | } 121 | 122 | private void RunProtection(Protection protect) 123 | { 124 | switch (protect) 125 | { 126 | case Protection.Calli: 127 | Calli.Execute(Md); 128 | break; 129 | case Protection.ControlFlow: 130 | ControlFlowObfuscation.Execute(Md); 131 | break; 132 | case Protection.InvalidMd: 133 | InvalidMDPhase.Execute(Md.Assembly); 134 | break; 135 | case Protection.StringProtect: 136 | StringEncPhase.Execute(Md); 137 | break; 138 | case Protection.OnlineString: 139 | OnlinePhase.Execute(Md); 140 | break; 141 | case Protection.LocalToField: 142 | L2F.Execute(Md); 143 | break; 144 | case Protection.LocalToFieldV2: 145 | L2FV2.Execute(Md); 146 | break; 147 | case Protection.Arithmetic: 148 | Arithmetic.Execute(Md); 149 | break; 150 | case Protection.IntConfusion: 151 | AddIntPhase.Execute2(Md); 152 | break; 153 | case Protection.ProxyString: 154 | ProxyString.Execute(Md); 155 | break; 156 | case Protection.ProxyInt: 157 | ProxyInt.Execute(Md); 158 | break; 159 | case Protection.AntiDebug: 160 | AntiDebug.Execute(Md); 161 | break; 162 | case Protection.AntiDump: 163 | AntiDump.Execute(Md); 164 | break; 165 | case Protection.AntiTamper: 166 | AntiTamper.Execute(Md); 167 | break; 168 | case Protection.AntiDe4dot: 169 | AntiDe4dot.Execute(Md.Assembly); 170 | break; 171 | case Protection.AntiManyThing: 172 | Antimanything.Execute(Md); 173 | break; 174 | case Protection.ProxyMeth: 175 | ProxyMeth.Execute(Md); 176 | break; 177 | case Protection.Watermark: 178 | Watermark.Execute(Md); 179 | break; 180 | case Protection.Renamer: 181 | RenamerPhase.ExecuteNamespaceRenaming(Md); 182 | RenamerPhase.ExecuteModuleRenaming(Md); 183 | RenamerPhase.ExecuteClassRenaming(Md); 184 | RenamerPhase.ExecutePropertiesRenaming(Md); 185 | RenamerPhase.ExecuteFieldRenaming(Md); 186 | RenamerPhase.ExecuteMethodRenaming(Md); 187 | break; 188 | case Protection.StackUnf: 189 | StackUnfConfusion.Execute(Md); 190 | break; 191 | case Protection.JumpCflow: 192 | JumpCFlow.Execute(Md); 193 | break; 194 | default: 195 | throw new NotImplementedException(); 196 | } 197 | } 198 | 199 | private void CheckBox1_CheckedChanged(object sender, EventArgs e) 200 | => CheckProcess(checkBox1, () => { RunProtection(Protection.StringProtect); }, "-> String Encrypt"); 201 | 202 | private void checkBox2_CheckedChanged(object sender, EventArgs e) 203 | => CheckProcess(checkBox2, () => { RunProtection(Protection.OnlineString); }, "-> OnlineStrDecrypt"); 204 | 205 | private void checkBox3_CheckedChanged(object sender, EventArgs e) 206 | => CheckProcess(checkBox3, () => { RunProtection(Protection.ControlFlow); }, "-> ControlFlow"); 207 | 208 | private void checkBox4_CheckedChanged(object sender, EventArgs e) 209 | => CheckProcess(checkBox4, () => { RunProtection(Protection.IntConfusion); }, "-> IntConfusion"); 210 | 211 | private void checkBox5_CheckedChanged(object sender, EventArgs e) 212 | => CheckProcess(checkBox5, () => { RunProtection(Protection.Arithmetic); }, "-> Arithmetic"); 213 | 214 | private void checkBox6_CheckedChanged(object sender, EventArgs e) 215 | => CheckProcess(checkBox6, () => { RunProtection(Protection.LocalToField); }, "-> L2F"); 216 | 217 | private void checkBox7_CheckedChanged(object sender, EventArgs e) 218 | => CheckProcess(checkBox7, () => { RunProtection(Protection.LocalToFieldV2); }, "-> L2F"); 219 | 220 | private void checkBox8_CheckedChanged(object sender, EventArgs e) 221 | => CheckProcess(checkBox8, () => { RunProtection(Protection.Calli); }, "-> Calli"); 222 | 223 | private void checkBox9_CheckedChanged(object sender, EventArgs e) 224 | => CheckProcess(checkBox9, () => { RunProtection(Protection.ProxyMeth); }, "-> ProxyMeth"); 225 | 226 | private void checkBox10_CheckedChanged(object sender, EventArgs e) 227 | => CheckProcess(checkBox10, () => { RunProtection(Protection.ProxyInt); }, "-> ProxyInt"); 228 | 229 | private void checkBox11_CheckedChanged(object sender, EventArgs e) 230 | => CheckProcess(checkBox11, () => { RunProtection(Protection.ProxyString); }, "-> ProxyString"); 231 | 232 | private void checkBox12_CheckedChanged(object sender, EventArgs e) 233 | => CheckProcess(checkBox12, () => { RunProtection(Protection.Renamer); }, "-> Renamer"); 234 | 235 | private void checkBox13_CheckedChanged(object sender, EventArgs e) 236 | => CheckProcess(checkBox13, () => { RunProtection(Protection.JumpCflow); }, "-> JumpCflow"); 237 | 238 | private void checkBox14_CheckedChanged(object sender, EventArgs e) 239 | => CheckProcess(checkBox14, () => { RunProtection(Protection.AntiDebug); }, "-> Anti Debug"); 240 | 241 | private void checkBox15_CheckedChanged(object sender, EventArgs e) 242 | => CheckProcess(checkBox15, () => { RunProtection(Protection.AntiDump); }, "-> Anti Dump"); 243 | 244 | private void checkBox16_CheckedChanged(object sender, EventArgs e) 245 | => CheckProcess(checkBox16, () => { RunProtection(Protection.AntiTamper); }, "-> Anti Tamper"); 246 | 247 | private void checkBox17_CheckedChanged(object sender, EventArgs e) 248 | => CheckProcess(checkBox17, () => { RunProtection(Protection.InvalidMd); }, "-> InvalidMD"); 249 | 250 | private void checkBox18_CheckedChanged(object sender, EventArgs e) 251 | => CheckProcess(checkBox18, () => { RunProtection(Protection.AntiDe4dot); }, "-> AntiDe4dot"); 252 | 253 | private void checkBox19_CheckedChanged(object sender, EventArgs e) 254 | => CheckProcess(checkBox19, () => { RunProtection(Protection.StackUnf); }, "-> StackUnfConfusion"); 255 | 256 | private void checkBox20_CheckedChanged(object sender, EventArgs e) 257 | => CheckProcess(checkBox20, () => { RunProtection(Protection.AntiManyThing); }, "-> Anti manything"); 258 | 259 | private enum Protection 260 | { 261 | Calli, 262 | ControlFlow, 263 | InvalidMd, 264 | LocalToField, 265 | LocalToFieldV2, 266 | Arithmetic, 267 | IntConfusion, 268 | StackUnf, 269 | ProxyString, 270 | ProxyMeth, 271 | StringProtect, 272 | OnlineString, 273 | AntiDebug, 274 | AntiDump, 275 | AntiTamper, 276 | AntiDe4dot, 277 | AntiManyThing, 278 | Watermark, 279 | Renamer, 280 | JumpCflow, 281 | ProxyInt 282 | } 283 | } -------------------------------------------------------------------------------- /Protection/Renamer/RenamerPhase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using dnlib.DotNet; 5 | using dnlib.DotNet.Emit; 6 | 7 | namespace MindLated.Protection.Renamer; 8 | 9 | internal class RenamerPhase 10 | { 11 | public enum RenameMode 12 | { 13 | Ascii, 14 | Key, 15 | Normal 16 | } 17 | 18 | private const string Ascii = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 19 | private static readonly Random Random = new(); 20 | 21 | private static readonly string[] NormalNameStrings = 22 | { 23 | "HasPermission", "HasPermissions", "GetPermissions", "GetOpenWindows", "EnumWindows", "GetWindowText", 24 | "GetWindowTextLength", "IsWindowVisible", "GetShellWindow", "Awake", "FixedUpdate", "add_OnRockedInitialized", 25 | "remove_OnRockedInitialized", "Awake", "Initialize", "Translate", "Reload", "b__13_0", "Initialize", 26 | "FixedUpdate", "Start", "checkTimerRestart", "QueueOnMainThread", "QueueOnMainThread", "RunAsync", "RunAction", 27 | "Awake", "FixedUpdate", "IsUri", "GetTypes", "GetTypesFromParentClass", "GetTypesFromParentClass", 28 | "GetTypesFromInterface", "GetTypesFromInterface", "get_Timeout", "set_Timeout", "GetWebRequest", 29 | "get_SteamID64", "set_SteamID64", "get_SteamID", "set_SteamID", "get_OnlineState", "set_OnlineState", 30 | "get_StateMessage", "set_StateMessage", "get_PrivacyState", "set_PrivacyState", "get_VisibilityState", 31 | "set_VisibilityState", "get_AvatarIcon", "set_AvatarIcon", "get_AvatarMedium", "set_AvatarMedium", 32 | "get_AvatarFull", "set_AvatarFull", "get_IsVacBanned", "set_IsVacBanned", "get_TradeBanState", 33 | "set_TradeBanState", "get_IsLimitedAccount", "set_IsLimitedAccount", "get_CustomURL", "set_CustomURL", 34 | "get_MemberSince", "set_MemberSince", "get_HoursPlayedLastTwoWeeks", "set_HoursPlayedLastTwoWeeks", 35 | "get_Headline", "set_Headline", "get_Location", "set_Location", "get_RealName", "set_RealName", "get_Summary", 36 | "set_Summary", "get_MostPlayedGames", "set_MostPlayedGames", "get_Groups", "set_Groups", "Reload", 37 | "ParseString", "ParseDateTime", "ParseDouble", "ParseUInt16", "ParseUInt32", "ParseUInt64", "ParseBool", 38 | "ParseUri", "IsValidCSteamID", "LoadDefaults", "LoadDefaults", "get_Clients", "Awake", "handleConnection", 39 | "FixedUpdate", "Broadcast", "OnDestroy", "Read", "Send", "b__8_0", "get_InstanceID", "set_InstanceID", 40 | "get_ConnectedTime", "set_ConnectedTime", "Send", "Read", "Close", "get_Address", "get_Instance", 41 | "set_Instance", "Save", "Load", "Unload", "Load", "Save", "Load", "get_Configuration", "LoadPlugin", 42 | "<.ctor>b__3_0", "b__4_0", "add_OnPluginUnloading", "remove_OnPluginUnloading", 43 | "add_OnPluginLoading", "remove_OnPluginLoading", "get_Translations", "get_State", "get_Assembly", 44 | "set_Assembly", "get_Directory", "set_Directory", "get_Name", "set_Name", "get_DefaultTranslations", 45 | "IsDependencyLoaded", "ExecuteDependencyCode", "Translate", "ReloadPlugin", "LoadPlugin", "UnloadPlugin", 46 | "OnEnable", "OnDisable", "Load", "Unload", "TryAddComponent", "TryRemoveComponent", "add_OnPluginsLoaded", 47 | "remove_OnPluginsLoaded", "get_Plugins", "GetPlugins", "GetPlugin", "GetPlugin", "Awake", "Start", 48 | "GetMainTypeFromAssembly", "loadPlugins", "unloadPlugins", "Reload", "GetAssembliesFromDirectory", 49 | "LoadAssembliesFromDirectory", "b__12_0", "GetGroupsByIds", "GetParentGroups", "HasPermission", 50 | "GetGroup", "RemovePlayerFromGroup", "AddPlayerToGroup", "DeleteGroup", "SaveGroup", "AddGroup", "GetGroups", 51 | "GetPermissions", "GetPermissions", "b__11_3", "Start", "FixedUpdate", "Reload", "HasPermission", 52 | "GetGroups", "GetPermissions", "GetPermissions", "AddPlayerToGroup", "RemovePlayerFromGroup", "GetGroup", 53 | "SaveGroup", "AddGroup", "DeleteGroup", "DeleteGroup", "b__4_0", "Enqueue", "_Logger_DoWork", 54 | "processLog", "Log", "Log", "var_dump", "LogWarning", "LogError", "LogError", "Log", "LogException", 55 | "ProcessInternalLog", "logRCON", "writeToConsole", "ProcessLog", "ExternalLog", "Invoke", "_invoke", 56 | "TryInvoke", "get_Aliases", "get_AllowedCaller", "get_Help", "get_Name", "get_Permissions", "get_Syntax", 57 | "Execute", "get_Aliases", "get_AllowedCaller", "get_Help", "get_Name", "get_Permissions", "get_Syntax", 58 | "Execute", "get_Aliases", "get_AllowedCaller", "get_Help", "get_Name", "get_Permissions", "get_Syntax", 59 | "Execute", "get_Name", "set_Name", "get_Name", "set_Name", "get_Name", "get_Help", "get_Syntax", 60 | "get_AllowedCaller", "get_Commands", "set_Commands", "add_OnExecuteCommand", "remove_OnExecuteCommand", 61 | "Reload", "Awake", "checkCommandMappings", "checkDuplicateCommandMappings", "Plugins_OnPluginsLoaded", 62 | "GetCommand", "GetCommand", "getCommandIdentity", "getCommandType", "Register", "Register", "Register", 63 | "DeregisterFromAssembly", "GetCooldown", "SetCooldown", "Execute", "RegisterFromAssembly" 64 | }; 65 | 66 | private static readonly Dictionary Names = new(); 67 | 68 | private static string RandomString(int length, string chars) 69 | { 70 | return new string(Enumerable.Repeat(chars, length) 71 | .Select(s => s[Random.Next(s.Length)]).ToArray()); 72 | } 73 | 74 | private static string GetRandomName() 75 | { 76 | return NormalNameStrings[Random.Next(NormalNameStrings.Length)]; 77 | } 78 | 79 | public static string GenerateString(RenameMode mode) 80 | { 81 | return mode switch 82 | { 83 | RenameMode.Ascii => RandomString(Random.Next(3, 12), Ascii), 84 | RenameMode.Key => RandomString(16, Ascii), 85 | RenameMode.Normal => GetRandomName(), 86 | _ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null) 87 | }; 88 | } 89 | 90 | 91 | public static void ExecuteClassRenaming(ModuleDefMD module) 92 | { 93 | foreach (TypeDef? type in module.GetTypes()) 94 | { 95 | if (type.IsGlobalModuleType) 96 | { 97 | continue; 98 | } 99 | 100 | if (type.Name == "GeneratedInternalTypeHelper" || type.Name == "Resources" || type.Name == "Settings") 101 | { 102 | continue; 103 | } 104 | 105 | 106 | if (Names.TryGetValue(type.Name, out string? nameValue)) 107 | { 108 | type.Name = nameValue; 109 | } 110 | else 111 | { 112 | string newName = GenerateString(RenameMode.Ascii); 113 | 114 | Names.Add(type.Name, newName); 115 | type.Name = newName; 116 | } 117 | } 118 | 119 | ApplyChangesToResourcesClasses(module); 120 | } 121 | 122 | 123 | private static void ApplyChangesToResourcesClasses(ModuleDefMD module) 124 | { 125 | ModuleDefMD moduleToRename = module; 126 | foreach (Resource? resource in moduleToRename.Resources) 127 | { 128 | foreach (KeyValuePair item in Names) 129 | { 130 | if (resource.Name.Contains(item.Key)) 131 | { 132 | resource.Name = resource.Name.Replace(item.Key, item.Value); 133 | } 134 | } 135 | } 136 | 137 | foreach (TypeDef? type in moduleToRename.GetTypes()) 138 | { 139 | foreach (PropertyDef? property in type.Properties) 140 | { 141 | if (property.Name != "ResourceManager") 142 | { 143 | continue; 144 | } 145 | 146 | IList? instr = property.GetMethod.Body.Instructions; 147 | 148 | for (int i = 0; i < instr.Count - 3; i++) 149 | { 150 | if (instr[i].OpCode == OpCodes.Ldstr) 151 | { 152 | foreach (KeyValuePair item in Names.Where(item => 153 | item.Key == instr[i].Operand.ToString())) 154 | { 155 | instr[i].Operand = item.Value; 156 | } 157 | } 158 | } 159 | } 160 | } 161 | } 162 | 163 | 164 | public static void ExecuteFieldRenaming(ModuleDefMD module) 165 | { 166 | foreach (TypeDef? type in module.GetTypes()) 167 | { 168 | if (type.IsGlobalModuleType) 169 | { 170 | continue; 171 | } 172 | 173 | foreach (FieldDef? field in type.Fields) 174 | { 175 | if (field.IsInitOnly) 176 | { 177 | continue; 178 | } 179 | 180 | if (field.HasCustomAttributes) continue; 181 | if (Names.TryGetValue(field.Name, out string? nameValue)) 182 | { 183 | field.Name = nameValue; 184 | } 185 | else 186 | { 187 | string newName = GenerateString(RenameMode.Ascii); 188 | 189 | Names.Add(field.Name, newName); 190 | field.Name = newName; 191 | } 192 | } 193 | } 194 | 195 | ApplyChangesToResourcesField(module); 196 | } 197 | 198 | private static void ApplyChangesToResourcesField(ModuleDefMD module) 199 | { 200 | foreach (TypeDef? type in module.GetTypes()) 201 | { 202 | if (!type.IsGlobalModuleType) 203 | { 204 | 205 | foreach (MethodDef? methodDef in type.Methods) 206 | { 207 | if (methodDef.Name != "InitializeComponent") 208 | { 209 | if (!methodDef.HasBody) 210 | { 211 | continue; 212 | } 213 | 214 | IList instructions = methodDef.Body.Instructions; 215 | for (int i = 0; i < instructions.Count - 3; i++) 216 | { 217 | if (instructions[i].OpCode == OpCodes.Ldstr) 218 | { 219 | foreach (KeyValuePair keyValuePair in Names) 220 | { 221 | if (keyValuePair.Key == instructions[i].Operand.ToString()) 222 | { 223 | instructions[i].Operand = keyValuePair.Value; 224 | } 225 | } 226 | } 227 | } 228 | } 229 | } 230 | } 231 | } 232 | } 233 | 234 | public static void ExecuteMethodRenaming(ModuleDefMD module) 235 | { 236 | foreach (TypeDef? type in module.GetTypes()) 237 | { 238 | if (type.IsGlobalModuleType) 239 | { 240 | continue; 241 | } 242 | 243 | 244 | if (type.Name == "GeneratedInternalTypeHelper") 245 | { 246 | continue; 247 | } 248 | 249 | foreach (MethodDef? method in type.Methods) 250 | { 251 | if (!method.HasBody) 252 | { 253 | continue; 254 | } 255 | 256 | if (method.IsVirtual || method.IsSpecialName) 257 | { 258 | continue; 259 | } 260 | 261 | if (method.Name == ".ctor" || method.Name == ".cctor") 262 | { 263 | continue; 264 | } 265 | 266 | method.Name = GenerateString(RenameMode.Ascii); 267 | } 268 | } 269 | } 270 | 271 | public static void ExecuteModuleRenaming(ModuleDefMD mod) 272 | { 273 | foreach (ModuleDef? module in mod.Assembly.Modules) 274 | { 275 | bool isWpf = false; 276 | foreach (AssemblyRef? asmRef in module.GetAssemblyRefs()) 277 | { 278 | if (asmRef.Name == "WindowsBase" || asmRef.Name == "PresentationCore" || 279 | asmRef.Name == "PresentationFramework" || asmRef.Name == "System.Xaml") 280 | { 281 | isWpf = true; 282 | } 283 | } 284 | 285 | if (!isWpf) 286 | { 287 | module.Name = GenerateString(RenameMode.Ascii); 288 | 289 | module.Assembly.CustomAttributes.Clear(); 290 | module.Mvid = Guid.NewGuid(); 291 | module.Assembly.Name = GenerateString(RenameMode.Ascii); 292 | module.Assembly.Version = new Version(Random.Next(1, 9), Random.Next(1, 9), Random.Next(1, 9), 293 | Random.Next(1, 9)); 294 | } 295 | } 296 | } 297 | 298 | public static void ExecuteNamespaceRenaming(ModuleDefMD module) 299 | { 300 | foreach (TypeDef? type in module.GetTypes()) 301 | { 302 | if (type.IsGlobalModuleType) 303 | { 304 | continue; 305 | } 306 | 307 | if (type.Namespace == "") 308 | { 309 | continue; 310 | } 311 | 312 | if (Names.TryGetValue(type.Namespace, out string? nameValue)) 313 | { 314 | type.Namespace = nameValue; 315 | } 316 | else 317 | { 318 | string newName = GenerateString(RenameMode.Ascii); 319 | 320 | Names.Add(type.Namespace, newName); 321 | type.Namespace = newName; 322 | } 323 | } 324 | 325 | ApplyChangesToResourcesNamespace(module); 326 | } 327 | 328 | private static void ApplyChangesToResourcesNamespace(ModuleDefMD module) 329 | { 330 | foreach (Resource? resource in module.Resources) 331 | { 332 | foreach (KeyValuePair item in Names.Where(item => resource.Name.Contains(item.Key))) 333 | { 334 | resource.Name = resource.Name.Replace(item.Key, item.Value); 335 | } 336 | } 337 | 338 | foreach (TypeDef? type in module.GetTypes()) 339 | { 340 | foreach (PropertyDef? property in type.Properties) 341 | { 342 | if (property.Name != "ResourceManager") 343 | { 344 | continue; 345 | } 346 | 347 | 348 | IList? instr = property.GetMethod.Body.Instructions; 349 | 350 | for (int i = 0; i < instr.Count - 3; i++) 351 | { 352 | if (instr[i].OpCode == OpCodes.Ldstr) 353 | { 354 | foreach (KeyValuePair item in Names.Where(item => 355 | item.Key == instr[i].Operand.ToString())) 356 | { 357 | instr[i].Operand = item.Value; 358 | } 359 | } 360 | } 361 | } 362 | } 363 | } 364 | 365 | public static void ExecutePropertiesRenaming(ModuleDefMD module) 366 | { 367 | foreach (TypeDef? type in module.GetTypes()) 368 | { 369 | if (type.IsGlobalModuleType) 370 | { 371 | continue; 372 | } 373 | 374 | foreach (PropertyDef? property in type.Properties) 375 | { 376 | property.Name = GenerateString(RenameMode.Ascii); 377 | } 378 | } 379 | } 380 | } -------------------------------------------------------------------------------- /Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MindLated 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); 32 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 33 | this.checkBox20 = new System.Windows.Forms.CheckBox(); 34 | this.button1 = new System.Windows.Forms.Button(); 35 | this.richTextBox1 = new System.Windows.Forms.RichTextBox(); 36 | this.checkBox19 = new System.Windows.Forms.CheckBox(); 37 | this.checkBox18 = new System.Windows.Forms.CheckBox(); 38 | this.checkBox17 = new System.Windows.Forms.CheckBox(); 39 | this.checkBox16 = new System.Windows.Forms.CheckBox(); 40 | this.checkBox15 = new System.Windows.Forms.CheckBox(); 41 | this.checkBox14 = new System.Windows.Forms.CheckBox(); 42 | this.checkBox13 = new System.Windows.Forms.CheckBox(); 43 | this.checkBox12 = new System.Windows.Forms.CheckBox(); 44 | this.checkBox11 = new System.Windows.Forms.CheckBox(); 45 | this.checkBox10 = new System.Windows.Forms.CheckBox(); 46 | this.checkBox9 = new System.Windows.Forms.CheckBox(); 47 | this.checkBox8 = new System.Windows.Forms.CheckBox(); 48 | this.checkBox7 = new System.Windows.Forms.CheckBox(); 49 | this.checkBox6 = new System.Windows.Forms.CheckBox(); 50 | this.checkBox5 = new System.Windows.Forms.CheckBox(); 51 | this.checkBox4 = new System.Windows.Forms.CheckBox(); 52 | this.checkBox3 = new System.Windows.Forms.CheckBox(); 53 | this.checkBox2 = new System.Windows.Forms.CheckBox(); 54 | this.checkBox1 = new System.Windows.Forms.CheckBox(); 55 | this.listBox1 = new System.Windows.Forms.ListBox(); 56 | this.textBox1 = new System.Windows.Forms.TextBox(); 57 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 58 | this.SuspendLayout(); 59 | // 60 | // pictureBox1 61 | // 62 | this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); 63 | this.pictureBox1.Location = new System.Drawing.Point(264, 140); 64 | this.pictureBox1.Name = "pictureBox1"; 65 | this.pictureBox1.Size = new System.Drawing.Size(109, 123); 66 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 67 | this.pictureBox1.TabIndex = 49; 68 | this.pictureBox1.TabStop = false; 69 | // 70 | // checkBox20 71 | // 72 | this.checkBox20.AutoSize = true; 73 | this.checkBox20.ForeColor = System.Drawing.SystemColors.Control; 74 | this.checkBox20.Location = new System.Drawing.Point(267, 116); 75 | this.checkBox20.Name = "checkBox20"; 76 | this.checkBox20.Size = new System.Drawing.Size(109, 19); 77 | this.checkBox20.TabIndex = 48; 78 | this.checkBox20.Text = "Anti Manything"; 79 | this.checkBox20.UseVisualStyleBackColor = true; 80 | this.checkBox20.CheckedChanged += new System.EventHandler(this.checkBox20_CheckedChanged); 81 | // 82 | // button1 83 | // 84 | this.button1.Location = new System.Drawing.Point(12, 241); 85 | this.button1.Name = "button1"; 86 | this.button1.Size = new System.Drawing.Size(83, 23); 87 | this.button1.TabIndex = 47; 88 | this.button1.Text = "Obfuscate"; 89 | this.button1.UseVisualStyleBackColor = true; 90 | this.button1.Click += new System.EventHandler(this.Button1_Click); 91 | // 92 | // richTextBox1 93 | // 94 | this.richTextBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(29)))), ((int)(((byte)(29)))), ((int)(((byte)(39))))); 95 | this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; 96 | this.richTextBox1.Location = new System.Drawing.Point(12, 270); 97 | this.richTextBox1.Name = "richTextBox1"; 98 | this.richTextBox1.Size = new System.Drawing.Size(574, 107); 99 | this.richTextBox1.TabIndex = 46; 100 | this.richTextBox1.Text = ""; 101 | // 102 | // checkBox19 103 | // 104 | this.checkBox19.AutoSize = true; 105 | this.checkBox19.ForeColor = System.Drawing.SystemColors.Control; 106 | this.checkBox19.Location = new System.Drawing.Point(267, 91); 107 | this.checkBox19.Name = "checkBox19"; 108 | this.checkBox19.Size = new System.Drawing.Size(128, 19); 109 | this.checkBox19.TabIndex = 45; 110 | this.checkBox19.Text = "StackUnfConfusion"; 111 | this.checkBox19.UseVisualStyleBackColor = true; 112 | this.checkBox19.CheckedChanged += new System.EventHandler(this.checkBox19_CheckedChanged); 113 | // 114 | // checkBox18 115 | // 116 | this.checkBox18.AutoSize = true; 117 | this.checkBox18.ForeColor = System.Drawing.SystemColors.Control; 118 | this.checkBox18.Location = new System.Drawing.Point(267, 66); 119 | this.checkBox18.Name = "checkBox18"; 120 | this.checkBox18.Size = new System.Drawing.Size(88, 19); 121 | this.checkBox18.TabIndex = 44; 122 | this.checkBox18.Text = "Anti de4dot"; 123 | this.checkBox18.UseVisualStyleBackColor = true; 124 | this.checkBox18.CheckedChanged += new System.EventHandler(this.checkBox18_CheckedChanged); 125 | // 126 | // checkBox17 127 | // 128 | this.checkBox17.AutoSize = true; 129 | this.checkBox17.ForeColor = System.Drawing.SystemColors.Control; 130 | this.checkBox17.Location = new System.Drawing.Point(267, 41); 131 | this.checkBox17.Name = "checkBox17"; 132 | this.checkBox17.Size = new System.Drawing.Size(83, 19); 133 | this.checkBox17.TabIndex = 43; 134 | this.checkBox17.Text = "Invalid MD"; 135 | this.checkBox17.UseVisualStyleBackColor = true; 136 | this.checkBox17.CheckedChanged += new System.EventHandler(this.checkBox17_CheckedChanged); 137 | // 138 | // checkBox16 139 | // 140 | this.checkBox16.AutoSize = true; 141 | this.checkBox16.ForeColor = System.Drawing.SystemColors.Control; 142 | this.checkBox16.Location = new System.Drawing.Point(174, 216); 143 | this.checkBox16.Name = "checkBox16"; 144 | this.checkBox16.Size = new System.Drawing.Size(90, 19); 145 | this.checkBox16.TabIndex = 42; 146 | this.checkBox16.Text = "Anti Tamper"; 147 | this.checkBox16.UseVisualStyleBackColor = true; 148 | this.checkBox16.CheckedChanged += new System.EventHandler(this.checkBox16_CheckedChanged); 149 | // 150 | // checkBox15 151 | // 152 | this.checkBox15.AutoSize = true; 153 | this.checkBox15.ForeColor = System.Drawing.SystemColors.Control; 154 | this.checkBox15.Location = new System.Drawing.Point(174, 191); 155 | this.checkBox15.Name = "checkBox15"; 156 | this.checkBox15.Size = new System.Drawing.Size(84, 19); 157 | this.checkBox15.TabIndex = 41; 158 | this.checkBox15.Text = "Anti Dump"; 159 | this.checkBox15.UseVisualStyleBackColor = true; 160 | this.checkBox15.CheckedChanged += new System.EventHandler(this.checkBox15_CheckedChanged); 161 | // 162 | // checkBox14 163 | // 164 | this.checkBox14.AutoSize = true; 165 | this.checkBox14.ForeColor = System.Drawing.SystemColors.Control; 166 | this.checkBox14.Location = new System.Drawing.Point(174, 165); 167 | this.checkBox14.Name = "checkBox14"; 168 | this.checkBox14.Size = new System.Drawing.Size(86, 19); 169 | this.checkBox14.TabIndex = 40; 170 | this.checkBox14.Text = "Anti Debug"; 171 | this.checkBox14.UseVisualStyleBackColor = true; 172 | this.checkBox14.CheckedChanged += new System.EventHandler(this.checkBox14_CheckedChanged); 173 | // 174 | // checkBox13 175 | // 176 | this.checkBox13.AutoSize = true; 177 | this.checkBox13.ForeColor = System.Drawing.SystemColors.Control; 178 | this.checkBox13.Location = new System.Drawing.Point(174, 140); 179 | this.checkBox13.Name = "checkBox13"; 180 | this.checkBox13.Size = new System.Drawing.Size(86, 19); 181 | this.checkBox13.TabIndex = 39; 182 | this.checkBox13.Text = "JumpCflow"; 183 | this.checkBox13.UseVisualStyleBackColor = true; 184 | this.checkBox13.CheckedChanged += new System.EventHandler(this.checkBox13_CheckedChanged); 185 | // 186 | // checkBox12 187 | // 188 | this.checkBox12.AutoSize = true; 189 | this.checkBox12.ForeColor = System.Drawing.SystemColors.Control; 190 | this.checkBox12.Location = new System.Drawing.Point(174, 115); 191 | this.checkBox12.Name = "checkBox12"; 192 | this.checkBox12.Size = new System.Drawing.Size(73, 19); 193 | this.checkBox12.TabIndex = 38; 194 | this.checkBox12.Text = "Renamer"; 195 | this.checkBox12.UseVisualStyleBackColor = true; 196 | this.checkBox12.CheckedChanged += new System.EventHandler(this.checkBox12_CheckedChanged); 197 | // 198 | // checkBox11 199 | // 200 | this.checkBox11.AutoSize = true; 201 | this.checkBox11.ForeColor = System.Drawing.SystemColors.Control; 202 | this.checkBox11.Location = new System.Drawing.Point(174, 91); 203 | this.checkBox11.Name = "checkBox11"; 204 | this.checkBox11.Size = new System.Drawing.Size(95, 19); 205 | this.checkBox11.TabIndex = 37; 206 | this.checkBox11.Text = "Proxy Strings"; 207 | this.checkBox11.UseVisualStyleBackColor = true; 208 | this.checkBox11.CheckedChanged += new System.EventHandler(this.checkBox11_CheckedChanged); 209 | // 210 | // checkBox10 211 | // 212 | this.checkBox10.AutoSize = true; 213 | this.checkBox10.ForeColor = System.Drawing.SystemColors.Control; 214 | this.checkBox10.Location = new System.Drawing.Point(174, 66); 215 | this.checkBox10.Name = "checkBox10"; 216 | this.checkBox10.Size = new System.Drawing.Size(73, 19); 217 | this.checkBox10.TabIndex = 36; 218 | this.checkBox10.Text = "Proxy Int"; 219 | this.checkBox10.UseVisualStyleBackColor = true; 220 | this.checkBox10.CheckedChanged += new System.EventHandler(this.checkBox10_CheckedChanged); 221 | // 222 | // checkBox9 223 | // 224 | this.checkBox9.AutoSize = true; 225 | this.checkBox9.ForeColor = System.Drawing.SystemColors.Control; 226 | this.checkBox9.Location = new System.Drawing.Point(174, 41); 227 | this.checkBox9.Name = "checkBox9"; 228 | this.checkBox9.Size = new System.Drawing.Size(87, 19); 229 | this.checkBox9.TabIndex = 35; 230 | this.checkBox9.Text = "Proxy Meth"; 231 | this.checkBox9.UseVisualStyleBackColor = true; 232 | this.checkBox9.CheckedChanged += new System.EventHandler(this.checkBox9_CheckedChanged); 233 | // 234 | // checkBox8 235 | // 236 | this.checkBox8.AutoSize = true; 237 | this.checkBox8.ForeColor = System.Drawing.SystemColors.Control; 238 | this.checkBox8.Location = new System.Drawing.Point(12, 216); 239 | this.checkBox8.Name = "checkBox8"; 240 | this.checkBox8.Size = new System.Drawing.Size(49, 19); 241 | this.checkBox8.TabIndex = 34; 242 | this.checkBox8.Text = "Calli"; 243 | this.checkBox8.UseVisualStyleBackColor = true; 244 | this.checkBox8.CheckedChanged += new System.EventHandler(this.checkBox8_CheckedChanged); 245 | // 246 | // checkBox7 247 | // 248 | this.checkBox7.AutoSize = true; 249 | this.checkBox7.ForeColor = System.Drawing.SystemColors.Control; 250 | this.checkBox7.Location = new System.Drawing.Point(12, 191); 251 | this.checkBox7.Name = "checkBox7"; 252 | this.checkBox7.Size = new System.Drawing.Size(113, 19); 253 | this.checkBox7.TabIndex = 33; 254 | this.checkBox7.Text = "Local To Field V2"; 255 | this.checkBox7.UseVisualStyleBackColor = true; 256 | this.checkBox7.CheckedChanged += new System.EventHandler(this.checkBox7_CheckedChanged); 257 | // 258 | // checkBox6 259 | // 260 | this.checkBox6.AutoSize = true; 261 | this.checkBox6.ForeColor = System.Drawing.SystemColors.Control; 262 | this.checkBox6.Location = new System.Drawing.Point(12, 166); 263 | this.checkBox6.Name = "checkBox6"; 264 | this.checkBox6.Size = new System.Drawing.Size(97, 19); 265 | this.checkBox6.TabIndex = 32; 266 | this.checkBox6.Text = "Local To Field"; 267 | this.checkBox6.UseVisualStyleBackColor = true; 268 | this.checkBox6.CheckedChanged += new System.EventHandler(this.checkBox6_CheckedChanged); 269 | // 270 | // checkBox5 271 | // 272 | this.checkBox5.AutoSize = true; 273 | this.checkBox5.ForeColor = System.Drawing.SystemColors.Control; 274 | this.checkBox5.Location = new System.Drawing.Point(12, 140); 275 | this.checkBox5.Name = "checkBox5"; 276 | this.checkBox5.Size = new System.Drawing.Size(82, 19); 277 | this.checkBox5.TabIndex = 31; 278 | this.checkBox5.Text = "Arithmetic"; 279 | this.checkBox5.UseVisualStyleBackColor = true; 280 | this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged); 281 | // 282 | // checkBox4 283 | // 284 | this.checkBox4.AutoSize = true; 285 | this.checkBox4.ForeColor = System.Drawing.SystemColors.Control; 286 | this.checkBox4.Location = new System.Drawing.Point(12, 116); 287 | this.checkBox4.Name = "checkBox4"; 288 | this.checkBox4.Size = new System.Drawing.Size(98, 19); 289 | this.checkBox4.TabIndex = 30; 290 | this.checkBox4.Text = "Int Confusion"; 291 | this.checkBox4.UseVisualStyleBackColor = true; 292 | this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged); 293 | // 294 | // checkBox3 295 | // 296 | this.checkBox3.AutoSize = true; 297 | this.checkBox3.ForeColor = System.Drawing.SystemColors.Control; 298 | this.checkBox3.Location = new System.Drawing.Point(12, 91); 299 | this.checkBox3.Name = "checkBox3"; 300 | this.checkBox3.Size = new System.Drawing.Size(94, 19); 301 | this.checkBox3.TabIndex = 29; 302 | this.checkBox3.Text = "Control Flow"; 303 | this.checkBox3.UseVisualStyleBackColor = true; 304 | this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged); 305 | // 306 | // checkBox2 307 | // 308 | this.checkBox2.AutoSize = true; 309 | this.checkBox2.ForeColor = System.Drawing.SystemColors.Control; 310 | this.checkBox2.Location = new System.Drawing.Point(12, 66); 311 | this.checkBox2.Name = "checkBox2"; 312 | this.checkBox2.Size = new System.Drawing.Size(156, 19); 313 | this.checkBox2.TabIndex = 28; 314 | this.checkBox2.Text = "String Online Decryption"; 315 | this.checkBox2.UseVisualStyleBackColor = true; 316 | this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged); 317 | // 318 | // checkBox1 319 | // 320 | this.checkBox1.AutoSize = true; 321 | this.checkBox1.ForeColor = System.Drawing.SystemColors.Control; 322 | this.checkBox1.Location = new System.Drawing.Point(12, 41); 323 | this.checkBox1.Name = "checkBox1"; 324 | this.checkBox1.Size = new System.Drawing.Size(117, 19); 325 | this.checkBox1.TabIndex = 27; 326 | this.checkBox1.Text = "String Encryption"; 327 | this.checkBox1.UseVisualStyleBackColor = true; 328 | this.checkBox1.CheckedChanged += new System.EventHandler(this.CheckBox1_CheckedChanged); 329 | // 330 | // listBox1 331 | // 332 | this.listBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(29)))), ((int)(((byte)(29)))), ((int)(((byte)(39))))); 333 | this.listBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; 334 | this.listBox1.ForeColor = System.Drawing.Color.Lime; 335 | this.listBox1.FormattingEnabled = true; 336 | this.listBox1.ItemHeight = 15; 337 | this.listBox1.Items.AddRange(new object[] { 338 | "Selected Obfuscation"}); 339 | this.listBox1.Location = new System.Drawing.Point(584, 11); 340 | this.listBox1.Name = "listBox1"; 341 | this.listBox1.Size = new System.Drawing.Size(130, 360); 342 | this.listBox1.TabIndex = 26; 343 | // 344 | // textBox1 345 | // 346 | this.textBox1.AllowDrop = true; 347 | this.textBox1.Location = new System.Drawing.Point(12, 12); 348 | this.textBox1.Name = "textBox1"; 349 | this.textBox1.Size = new System.Drawing.Size(376, 23); 350 | this.textBox1.TabIndex = 25; 351 | this.textBox1.Text = "-> Drop ur file here <-"; 352 | this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; 353 | this.textBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.TextBox1_DragDrop); 354 | this.textBox1.DragEnter += new System.Windows.Forms.DragEventHandler(this.TextBox1_DragEnter); 355 | // 356 | // Form1 357 | // 358 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 359 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 360 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(29)))), ((int)(((byte)(29)))), ((int)(((byte)(39))))); 361 | this.ClientSize = new System.Drawing.Size(726, 383); 362 | this.Controls.Add(this.pictureBox1); 363 | this.Controls.Add(this.checkBox20); 364 | this.Controls.Add(this.listBox1); 365 | this.Controls.Add(this.button1); 366 | this.Controls.Add(this.textBox1); 367 | this.Controls.Add(this.richTextBox1); 368 | this.Controls.Add(this.checkBox1); 369 | this.Controls.Add(this.checkBox19); 370 | this.Controls.Add(this.checkBox2); 371 | this.Controls.Add(this.checkBox18); 372 | this.Controls.Add(this.checkBox3); 373 | this.Controls.Add(this.checkBox17); 374 | this.Controls.Add(this.checkBox4); 375 | this.Controls.Add(this.checkBox16); 376 | this.Controls.Add(this.checkBox5); 377 | this.Controls.Add(this.checkBox15); 378 | this.Controls.Add(this.checkBox6); 379 | this.Controls.Add(this.checkBox14); 380 | this.Controls.Add(this.checkBox7); 381 | this.Controls.Add(this.checkBox13); 382 | this.Controls.Add(this.checkBox8); 383 | this.Controls.Add(this.checkBox12); 384 | this.Controls.Add(this.checkBox9); 385 | this.Controls.Add(this.checkBox11); 386 | this.Controls.Add(this.checkBox10); 387 | this.Name = "Form1"; 388 | this.Text = "MindLated"; 389 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 390 | this.ResumeLayout(false); 391 | this.PerformLayout(); 392 | 393 | } 394 | 395 | #endregion 396 | private System.Windows.Forms.PictureBox pictureBox1; 397 | private System.Windows.Forms.CheckBox checkBox20; 398 | private System.Windows.Forms.Button button1; 399 | private System.Windows.Forms.RichTextBox richTextBox1; 400 | private System.Windows.Forms.CheckBox checkBox19; 401 | private System.Windows.Forms.CheckBox checkBox18; 402 | private System.Windows.Forms.CheckBox checkBox17; 403 | private System.Windows.Forms.CheckBox checkBox16; 404 | private System.Windows.Forms.CheckBox checkBox15; 405 | private System.Windows.Forms.CheckBox checkBox14; 406 | private System.Windows.Forms.CheckBox checkBox13; 407 | private System.Windows.Forms.CheckBox checkBox12; 408 | private System.Windows.Forms.CheckBox checkBox11; 409 | private System.Windows.Forms.CheckBox checkBox10; 410 | private System.Windows.Forms.CheckBox checkBox9; 411 | private System.Windows.Forms.CheckBox checkBox8; 412 | private System.Windows.Forms.CheckBox checkBox7; 413 | private System.Windows.Forms.CheckBox checkBox6; 414 | private System.Windows.Forms.CheckBox checkBox5; 415 | private System.Windows.Forms.CheckBox checkBox4; 416 | private System.Windows.Forms.CheckBox checkBox3; 417 | private System.Windows.Forms.CheckBox checkBox2; 418 | private System.Windows.Forms.CheckBox checkBox1; 419 | private System.Windows.Forms.ListBox listBox1; 420 | private System.Windows.Forms.TextBox textBox1; 421 | } 422 | } 423 | --------------------------------------------------------------------------------
If you'd like to support me, you can do so via Ko-fi. Every bit of support is greatly appreciated!
31 | 32 | 33 | 34 |
You can also support me with cryptocurrency: