You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System.Text.RegularExpressions;
- using Mono.Cecil;
-
- Console.WriteLine("Starting assembly editing...");
- var fileRegex =
- new Regex(".*(Techblox|Gamecraft|RobocraftX|FullGame|RobocraftECS|DataLoader|RCX|GameState|Svelto\\.ECS)[^/]*(\\.dll)");
- foreach (var file in Directory.EnumerateFiles(@"../../../../../ref/Techblox_Data/Managed"))
- {
- if (!fileRegex.IsMatch(file)) continue;
- Console.WriteLine(file);
- ProcessAssembly(file);
- }
-
- void ProcessAssembly(string path)
- {
- using var mod = ModuleDefinition.ReadModule(path, new(ReadingMode.Immediate) { ReadWrite = true });
- foreach (var typeDefinition in mod.Types)
- {
- typeDefinition.IsPublic = true;
- foreach (var method in typeDefinition.Methods) method.IsPublic = true;
- foreach (var field in typeDefinition.Fields) field.IsPublic = true;
- }
-
- mod.Write();
- }
|