private async void DebugLocalClicked(object sender, EventArgs e) { try { if (server != null) { server.Stop(); server = null; } monoExtension.BuildSolution(); using (server = new MonoDebugServer()) { server.Start(); await monoExtension.AttachDebuggerAsync(MonoProcess.GetLocalIp().ToString()); } } catch (Exception ex) { logger.Error(ex); if (server != null) { server.Stop(); } MessageBox.Show(ex.Message, "MonoRemoteDebugger", MessageBoxButton.OK, MessageBoxImage.Error); } }
/// <summary> /// Injects the DLL to specific process. /// </summary> /// <param name="process">The process.</param> /// <param name="file">The file.</param> /// <param name="hidden">if set to <c>true</c> file will be hidden from AssemblyLoad callback.</param> /// <returns> /// <c>true</c> injection was successfull; otherwise, <c>false</c>. /// </returns> public static bool Inject(Process process, string file, bool hidden = false) { if (MonoProcess.Attach(process, out MonoProcess mp)) { IntPtr domain = mp.GetRootDomain(); mp.ThreadAttach(domain); mp.SecuritySetMode(0); if (hidden) { mp.DisableAssemblyLoadCallback(); } byte[] rawAssembly = File.ReadAllBytes(file); IntPtr imagePtr = mp.ImageOpenFromDataFull(rawAssembly); IntPtr assemblyPtr = mp.AssemblyLoadFromFull(imagePtr); if (hidden) { mp.EnableAssemblyLoadCallback(); } mp.Dispose(); if (assemblyPtr == IntPtr.Zero) { return(false); } return(true); } return(false); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null || value == "") { return(null); } MonoProcess mp = (MonoProcess)value; return($"[{mp.Id}] {mp.Name}"); }
public static bool Inject(Process p_TargetProcess, Settings p_InjectionSettings) { MonoProcess monoProcess; if (MonoProcess.Attach(p_TargetProcess, out monoProcess)) { try { IntPtr monoDomain = monoProcess.GetRootDomain(); monoProcess.ThreadAttach(monoDomain); monoProcess.SecuritySetMode(0); if (p_InjectionSettings.HideAssemblyLoad) { monoProcess.DisableAssemblyLoadCallback(); } IntPtr rawAssemblyImage = monoProcess.ImageOpenFromDataFull(p_InjectionSettings.AssemblyBytes); IntPtr assemblyPointer = monoProcess.AssemblyLoadFromFull(rawAssemblyImage); IntPtr assemblyImage = monoProcess.AssemblyGetImage(assemblyPointer); IntPtr classPointer = monoProcess.ClassFromName(assemblyImage, p_InjectionSettings.Namespace, p_InjectionSettings.ClassName); IntPtr methodPointer = monoProcess.ClassGetMethodFromName(classPointer, p_InjectionSettings.MethodName); if (p_InjectionSettings.HideGetAssemblies) { monoProcess.HideLastAssembly(monoDomain); } monoProcess.RuntimeInvoke(methodPointer); if (p_InjectionSettings.HideAssemblyLoad) { monoProcess.EnableAssemblyLoadCallback(); } monoProcess.Dispose(); return(true); } catch { } } return(false); }
public static bool Inject(Process p_TargetProcess, Settings p_InjectionSettings) { MonoProcess monoProcess; //Try to attach to targetProcess Mono module if (MonoProcess.Attach(p_TargetProcess, out monoProcess)) { try { IntPtr monoDomain = monoProcess.GetRootDomain(); monoProcess.ThreadAttach(monoDomain); monoProcess.SecuritySetMode(0); //Disable AssemblyLoad callbacks before injection if (p_InjectionSettings.HideAssemblyLoad) { monoProcess.DisableAssemblyLoadCallback(); } IntPtr rawAssemblyImage = monoProcess.ImageOpenFromDataFull(p_InjectionSettings.AssemblyBytes); IntPtr assemblyPointer = monoProcess.AssemblyLoadFromFull(rawAssemblyImage); IntPtr assemblyImage = monoProcess.AssemblyGetImage(assemblyPointer); IntPtr classPointer = monoProcess.ClassFromName(assemblyImage, p_InjectionSettings.Namespace, p_InjectionSettings.ClassName); IntPtr methodPointer = monoProcess.ClassGetMethodFromName(classPointer, p_InjectionSettings.MethodName); //Finally invoke the TestInjection.Loader.Init method monoProcess.RuntimeInvoke(methodPointer); //Restore the AssemblyLoad callbacks to avoid weird behaviours if (p_InjectionSettings.HideAssemblyLoad) { monoProcess.EnableAssemblyLoadCallback(); } //You MUST dispose the MonoProcess instance when finished monoProcess.Dispose(); return(true); } catch { } } return(false); }
/// <summary> /// Hides the assembly loaded in <paramref name="load" /> method. /// </summary> /// <param name="process">The process.</param> /// <param name="load">The method.</param> public static bool HideAssemblyLoad(Process process, Action load) { if (!MonoProcess.Attach(process, out MonoProcess mp)) { return(false); } IntPtr domain = mp.GetRootDomain(); mp.ThreadAttach(domain); mp.SecuritySetMode(0); if (!mp.DisableAssemblyLoadCallback()) { mp.Dispose(); return(false); } load(); mp.EnableAssemblyLoadCallback(); mp.Dispose(); return(true); }
static void Main(string[] args) { Console.Title = "Funeral Loader"; Console.WriteLine("Trying to find VRChat.exe"); Console.WriteLine("Checking for Updates..."); GetCurrentVersion(); if (Process.GetProcessesByName("VRChat").Count() > 0) { Process targetProcess = Process.GetProcessesByName("VRChat")[0]; MonoProcess monoProcess; try { Console.WriteLine("Found VRChat.exe Injecting..."); if (MonoProcess.Attach(targetProcess, out monoProcess)) { if (File.Exists($"FuneralClient-{new WebClient().DownloadString("http://yaekiths-projects.xyz/funeralver.txt")}.dll")) { Console.WriteLine("Attaching to VRChat's Handle.."); byte[] assemblyBytes = File.ReadAllBytes($"FuneralClient-{new WebClient().DownloadString("http://yaekiths-projects.xyz/funeralver.txt")}.dll"); IntPtr monoDomain = monoProcess.GetRootDomain(); monoProcess.ThreadAttach(monoDomain); monoProcess.SecuritySetMode(0); monoProcess.DisableAssemblyLoadCallback(); IntPtr rawAssemblyImage = monoProcess.ImageOpenFromDataFull(assemblyBytes); IntPtr assemblyPointer = monoProcess.AssemblyLoadFromFull(rawAssemblyImage); IntPtr assemblyImage = monoProcess.AssemblyGetImage(assemblyPointer); IntPtr classPointer = monoProcess.ClassFromName(assemblyImage, "Funeral", "Loader"); IntPtr methodPointer = monoProcess.ClassGetMethodFromName(classPointer, "Init"); monoProcess.RuntimeInvoke(methodPointer); monoProcess.EnableAssemblyLoadCallback(); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("[Funeral Client] Injected."); Console.ForegroundColor = ConsoleColor.White; Thread.Sleep(3000); Environment.Exit(0); } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"[Funeral Client] FuneralClient-{new WebClient().DownloadString("http://yaekiths-projects.xyz/funeralver.txt")}.dll not found"); Console.ForegroundColor = ConsoleColor.White; } } } catch (Exception e) { Console.WriteLine("Failed to Inject. Details: " + e.ToString()); } } else { Console.WriteLine("[Funeral Client] Failed to find VRChat.exe press any key to retry."); Console.ReadKey(); Console.Clear(); Main(null); } Console.ReadLine(); }
static void Main(string[] args) { Console.Title = "UFO Loader"; Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine("Загрузка данных.."); string Namespace = "Cheats_Class"; string Class = "Loader"; string Method = "InitCheats"; string Proc = "rustclient"; Console.ForegroundColor = ConsoleColor.Yellow; string data = new WebClient().DownloadString("http://azp2033.000webhostapp.com/hwid.txt"); if (data.Contains(Crypt(GetHWID()))) { try { Console.Beep(400, 100); Console.WriteLine("Получение доступа к процессу.."); Process targetProcess = Process.GetProcessesByName(Proc)[0]; try { MonoProcess monoProcess; if (MonoProcess.Attach(targetProcess, out monoProcess)) { byte[] assemblyBytes = new WebClient().DownloadData("http://azp2033.000webhostapp.com/Facepunch.Mono.dll"); Console.WriteLine("Загрузка DLL с сервера.."); IntPtr monoDomain = monoProcess.GetRootDomain(); monoProcess.ThreadAttach(monoDomain); monoProcess.SecuritySetMode(0); monoProcess.DisableAssemblyLoadCallback(); IntPtr rawAssemblyImage = monoProcess.ImageOpenFromDataFull(assemblyBytes); IntPtr assemblyPointer = monoProcess.AssemblyLoadFromFull(rawAssemblyImage); IntPtr assemblyImage = monoProcess.AssemblyGetImage(assemblyPointer); IntPtr classPointer = monoProcess.ClassFromName(assemblyImage, Namespace, Class); IntPtr methodPointer = monoProcess.ClassGetMethodFromName(classPointer, Method); monoProcess.RuntimeInvoke(methodPointer); monoProcess.EnableAssemblyLoadCallback(); monoProcess.Dispose(); } } catch { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Ошибка! Возможно процесс не запущен..."); Console.ReadKey(); } } catch { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Ошибка! Возможно процесс не запущен..."); Console.ReadKey(); } } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Ошибка! У вас отсуствует лицензия.."); Console.WriteLine(""); Console.WriteLine("Меню: "); Console.WriteLine("1. Копировать HWID"); Console.WriteLine("2. Перейти на сайт"); Console.WriteLine("3. Группа ВК"); Console.WriteLine("4. Выход"); Console.Write("Меню: "); string line = Console.ReadLine(); if (line == "1") { Console.Clear(); Console.WriteLine("HWID: {0}", Crypt(GetHWID())); Console.ReadKey(); Environment.Exit(0); } else { if (line == "2") { Process.Start("http://ufohack.cf"); Console.Clear(); Console.ReadKey(); Environment.Exit(0); } else { if (line == "3") { Process.Start("https://vk.com/ufohacks"); Console.Clear(); Console.ReadKey(); Environment.Exit(0); } else { if (line == "4") { Environment.Exit(0); } } } } } }