public static void Inject(string targetAssemblyPath) { InjectionTools.ShortCircuitMethod(targetAssemblyPath, "PLGameStatic", "OnInjectionCheatDetected"); InjectionTools.ShortCircuitMethod(targetAssemblyPath, "PLGameStatic", "OnInjectionCheatDetected_Private"); InjectionTools.ShortCircuitMethod(targetAssemblyPath, "PLGameStatic", "OnSpeedHackCheatDetected"); InjectionTools.ShortCircuitMethod(targetAssemblyPath, "PLGameStatic", "OnTimeCheatDetected"); InjectionTools.ShortCircuitMethod(targetAssemblyPath, "PLGameStatic", "OnObscuredCheatDetected"); }
public static void InstallModLoader(string targetAssemblyPath) { Logger.Info("=== Backups ==="); string backupPath = Path.ChangeExtension(targetAssemblyPath, "bak"); if (InjectionTools.IsModified(targetAssemblyPath)) { if (File.Exists(backupPath)) { //Load from backup File.Copy(backupPath, targetAssemblyPath, true); } else { Logger.Info("The assembly is already modified, and a backup could not be found."); Logger.Info("Press any key to continue..."); Console.ReadKey(); return; } } else { //Create backup Logger.Info("Making backup of hopefully clean assembly."); File.Copy(targetAssemblyPath, backupPath, true); } Logger.Info("=== Creating directories ==="); string Modsdir = Path.Combine(Directory.GetParent(Path.GetDirectoryName(targetAssemblyPath)).Parent.FullName, "Mods"); if (!Directory.Exists(Modsdir)) { Logger.Info("Creating Mods Directory"); Directory.CreateDirectory(Modsdir); } Logger.Info("=== Anti-Cheat ==="); AntiCheatBypass.Inject(targetAssemblyPath); Logger.Info("=== Logging Modifications ==="); InjectionTools.PatchMethod(targetAssemblyPath, "PLGlobal", "Start", typeof(LoggingInjections), "LoggingCleanup"); Logger.Info("=== Injecting Harmony Initialization ==="); InjectionTools.PatchMethod(targetAssemblyPath, "PLGlobal", "Awake", typeof(HarmonyInjector), "InitializeHarmony"); Logger.Info("=== Copying Assemblies ==="); CopyAssemblies(Path.GetDirectoryName(targetAssemblyPath)); Logger.Info("Success! You may now run the game normally."); Logger.Info("Press any key to continue..."); Console.ReadKey(); }
public void method_10() { foreach (Control control in this.panel1.Controls) { control.Dispose(); } this.panel1.Controls.Clear(); InjectionTools injectionTools = new InjectionTools(); injectionTools.TopLevel = false; injectionTools.FormBorderStyle = FormBorderStyle.None; injectionTools.Visible = true; this.panel1.Controls.Add(injectionTools); }
public ManualMap(InjectionWrapper injectionWrapper) { _injectionTools = new InjectionTools(injectionWrapper); _injectionWrapper = injectionWrapper; }
public CreateRemoteThread(InjectionWrapper injectionWrapper) { _injectionTools = new InjectionTools(injectionWrapper); _injectionWrapper = injectionWrapper; }
static void Main(string[] args) { string targetAssemblyPath = defaultPath; if (args.Length > 0) { targetAssemblyPath = args[0]; } if (!File.Exists(targetAssemblyPath)) { Logger.Info("Please specify an assembly to inject (e.g., PULSARLostColony\\PULSAR_LostColony_Data\\Managed\\Assembly-CSharp.dll)"); Logger.Info("Press any key to continue..."); Console.ReadKey(); return; } Logger.Info("=== Backups ==="); string backupPath = Path.ChangeExtension(targetAssemblyPath, "bak"); if (InjectionTools.IsModified(targetAssemblyPath)) { if (File.Exists(backupPath)) { //Load from backup File.Copy(backupPath, targetAssemblyPath, true); } else { Logger.Info("The assembly is already modified, and a backup could not be found."); Logger.Info("Press any key to continue..."); Console.ReadKey(); return; } } else { //Create backup Logger.Info("Making backup of hopefully clean assembly."); File.Copy(targetAssemblyPath, backupPath, true); } Logger.Info("=== Creating Plugins directory ==="); var libdir = Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(targetAssemblyPath), "Libraries")); Directory.CreateDirectory(Path.Combine(libdir.FullName, "Unmanaged")); Directory.CreateDirectory(Path.Combine(libdir.FullName, "Managed")); Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(targetAssemblyPath), "Plugins")); Logger.Info("=== Anti-Cheat ==="); AntiCheatBypass.Inject(targetAssemblyPath); Logger.Info("=== Logging Modifications ==="); InjectionTools.CreateMethod(targetAssemblyPath, "PLGlobal", "Start", typeof(void), null); InjectionTools.PatchMethod(targetAssemblyPath, "PLGlobal", "Start", typeof(LoggingInjections), "LoggingCleanup"); Logger.Info("=== Injecting Harmony Initialization ==="); InjectionTools.PatchMethod(targetAssemblyPath, "PLGlobal", "Awake", typeof(HarmonyInjector), "InitializeHarmony"); Logger.Info("=== Copying Assemblies ==="); CopyAssemblies(Path.GetDirectoryName(targetAssemblyPath)); Logger.Info("Success! You may now run the game normally."); Logger.Info("Press any key to continue..."); Console.ReadKey(); }
public ThreadHijack(InjectionWrapper injectionWrapper) { _injectionTools = new InjectionTools(injectionWrapper); _injectionWrapper = injectionWrapper; }
internal EjectDll(InjectionWrapper injectionWrapper) { _injectionTools = new InjectionTools(injectionWrapper); _injectionWrapper = injectionWrapper; }