diff --git a/Confuser.Renamer/RenamePhase.cs b/Confuser.Renamer/RenamePhase.cs index 34001d0a4..ae71f6154 100644 --- a/Confuser.Renamer/RenamePhase.cs +++ b/Confuser.Renamer/RenamePhase.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Confuser.Core; +using Confuser.Core.Services; using dnlib.DotNet; namespace Confuser.Renamer { @@ -28,7 +29,12 @@ protected override void Execute(ConfuserContext context, ProtectionParameters pa } var pdbDocs = new HashSet(); - foreach (IDnlibDef def in parameters.Targets.WithProgress(context.Logger)) { + + var rng = context.Registry.GetService().GetRandomGenerator(Parent.Id); + int randMax = parameters.Targets.Count; + var targets = parameters.Targets.OrderBy(x => rng.NextInt32(randMax)).ToArray().WithProgress(context.Logger); + + foreach (IDnlibDef def in targets) { if (def is ModuleDef && parameters.GetParameter(context, def, "rickroll", false)) RickRoller.CommenceRickroll(context, (ModuleDef)def); @@ -101,4 +107,4 @@ protected override void Execute(ConfuserContext context, ProtectionParameters pa } } } -} \ No newline at end of file +}