internal static void Main(GlobalOptions options, PatcherOptions patcherOptions) { Helper.WriteVerbose($"Written pather mode: {patcherOptions.Mode}"); Helper.WriteVerbose($"Input: {patcherOptions.Input}", ConsoleColor.Yellow); Helper.WriteVerbose($"Written output: {patcherOptions.Output}", ConsoleColor.Yellow); var output = !string.IsNullOrEmpty(patcherOptions.Output) ? patcherOptions.Output : patcherOptions.Input; Helper.WriteVerbose($"Final output: {patcherOptions.Output}", ConsoleColor.Yellow); var assembly = Helper.ReadAssembly(patcherOptions.Input); Helper.WriteVerbose("Loading assembly as module"); module = ModuleDefMD.Load(assembly); Helper.WriteVerbose($"Search for the desired class with a name: {typeToPatch}"); var type = module.GetTypes().FirstOrDefault(t => t.Name.Equals(typeToPatch)); Helper.WriteVerbose($"The found class is null: {type is null}"); MethodDef method = null; if (!(type is null)) { Helper.WriteVerbose($"Search for the desired method with a name: {methodToPath}"); method = type.FindMethod(methodToPath); Helper.WriteVerbose($"The found method is null: {method is null}"); }
public static async Task Start(GlobalOptions options) => await PatcherOptions.Parse(options, Environment.GetCommandLineArgs()).ConfigureAwait(false);