private void btnInject_Click(object sender, EventArgs e) { try { var process = System.Diagnostics.Process.GetProcessesByName("WowB").FirstOrDefault(); if (process == null) { process = System.Diagnostics.Process.GetProcessesByName("Wow").FirstOrDefault(); } if (process == null) { throw new Exception("Wow.exe is not running, nothing to unlock"); } ProcessSharp = new ProcessSharp(process, Process.NET.Memory.MemoryType.Remote); PatternScanner = new PatternScanner(ProcessSharp[ProcessSharp.Native.MainModule.ModuleName]); var wHandle = OpenProcess((int)MemoryProtection.Proc_All_Access, false, ProcessSharp.Native.Id); InjectCode(ProcessSharp.Native.Id, wHandle); MessageBox.Show("Success", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); Close(); } catch (Exception ex) { MessageBox.Show($"Failure: {ex.Message}", Text, MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } }
public static void LaunchOverlay() { var processName = "rustclient"; var process = System.Diagnostics.Process.GetProcessesByName(processName).FirstOrDefault(); ProcessSharp processSharp = new ProcessSharp(process, MemoryType.Remote); //WpfOverlayPlugin _overlay = new WpfOverlayPlugin(); }
public MainWindow() { //if (Debugger.IsAttached) Properties.Settings.Default.Reset(); InitializeComponent(); SetupKeyboardHooks(); var proc = System.Diagnostics.Process.GetProcessesByName("csgo")[0]; var _processSharp = new ProcessSharp(proc, MemoryType.Remote); wpfOverlay = new DirectXOverlayWindow(_processSharp.WindowFactory.MainWindow.Handle, false); GameManager.Attach(proc); synth.SetOutputToDefaultAudioDevice(); NHotkey.Wpf.HotkeyManager.Current.AddOrReplace("trigger", Key.numpad, ModifierKeys.None, (sender, e) => hotkey(e.Name, ref triggerOn)); if (Properties.Settings.Default.darkMode) { ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent("Blue"), ThemeManager.GetAppTheme("BaseDark")); } SourceInitialized += Window_SourceInitialized; new Thread(ESP) { IsBackground = true }.Start(); }
public void StartDemo() { Log.Debug(@"Please type the process name of the window you want to attach to, e.g 'notepad."); Log.Debug("Note: If there is more than one process found, the first will be used."); var processName = Console.ReadLine(); var process = System.Diagnostics.Process.GetProcessesByName(processName).FirstOrDefault(); if (process == null) { Log.Warn($"No process by the name of {processName} was found."); Log.Warn("Please open one or use a different name and restart the demo."); Console.ReadLine(); return; } _directXoverlayPluginExample = new DirectxOverlayPluginExample(); _processSharp = new ProcessSharp(process, MemoryType.Remote); _directXoverlayPluginExample.Initialize(_processSharp.WindowFactory.MainWindow); _directXoverlayPluginExample.Enable(); Log.Info("Close the console to end the demo."); while (true) { _directXoverlayPluginExample.Update(); } Log.Info("Close the console to end the demo."); Log.Debug("Demo complete."); }
public override void Dispose() { base.Dispose(); _process?.Dispose(); _process = null; }
public override void Dispose() { Initialized = false; _process.Dispose(); _process = null; }
public IntPtr Find(ProcessSharp PS) { var start = FindStart(PS); start = Modifiers.Aggregate(start, (current, mod) => mod.Apply(PS, current)); return(start - (int)PS.Native.MainModule.BaseAddress); }
private bool StartRenderOverlayPrimes() { if (_overlay == null) { _overlay = new WPFOverlay(); } if (_processSharp == null) { _processSharp = new ProcessSharp(Warframe.GetProcess(), MemoryType.Remote); } var process = Warframe.GetProcess(); if (process != null) { var _wpfoverlay = (WPFOverlay)_overlay; if (!_wpfoverlay.Initialized) { _wpfoverlay.Initialize(_processSharp.WindowFactory.MainWindow); } _wpfoverlay.UpdatePrimesData(displayPrimes); return(true); } return(false); }
private void OnLoad(object sender, EventArgs e) { try { var telegramProcess = System.Diagnostics.Process.GetProcessesByName("Telegram").FirstOrDefault(); if (telegramProcess == null) { throw new Exception("telegram isn't running"); } _processSharp = new ProcessSharp(telegramProcess, MemoryType.Local); _processSharp.Memory = new ExternalProcessMemory(_processSharp.Handle); var scanner = new PatternScanner(_processSharp.ModuleFactory.MainModule); // why do they keep changing this specific function var pattern = new DwordPattern("85 F6 74 48 8B CB"); var scanResult = scanner.Find(pattern); if (!scanResult.Found) { throw new Exception("something broke"); } _address = scanResult.ReadAddress + 2; } catch (Exception exception) { MessageBox.Show(exception.Message); } }
/// <summary> /// Starts the demo. /// </summary> public Overlay(string processName = "") { var processes = System.Diagnostics.Process.GetProcesses(); System.Diagnostics.Process process = new System.Diagnostics.Process(); foreach (System.Diagnostics.Process process1 in processes) { if (process1.MainWindowTitle.Contains(processName)) { process = process1; break; } } if (process == null) { Log.Warn($"No process by the name of {processName} was found."); return; } _processSharp = new ProcessSharp(process, MemoryType.Remote); _overlay = new OverlayPlugin(); var wpfOverlay = (OverlayPlugin)_overlay; // This is done to focus on the fact the Init method // is overriden in the wpf overlay demo in order to set the // wpf overlay window instance wpfOverlay.Initialize(_processSharp.WindowFactory.MainWindow); wpfOverlay.Enable(); _work = true; // Log some info about the overlay. Log.Debug("Starting update loop (open the process you specified and drag around)"); Log.Debug("Update rate: " + wpfOverlay.Settings.Current.UpdateRate.Milliseconds()); var info = wpfOverlay.Settings.Current; Log.Debug($"Author: {info.Author}"); Log.Debug($"Description: {info.Description}"); Log.Debug($"Name: {info.Name}"); Log.Debug($"Identifier: {info.Identifier}"); Log.Debug($"Version: {info.Version}"); Log.Info("Note: Settings are saved to a settings folder in your main app folder."); Log.Info("Give your window focus to enable the overlay (and unfocus to disable..)"); Log.Info("Close the console to end the demo."); wpfOverlay.OverlayWindow.Draw += OnDraw; // Do work while (_work) { _overlay.Update(); } Log.Debug("Demo complete."); }
private void temp_Load(object sender, EventArgs e) { System.Diagnostics.Process process = System.Diagnostics.Process.GetProcessById(pId); if (process != null) { k = new ProcessSharp(pId, Process.NET.Memory.MemoryType.Local); k.Memory = new ExternalProcessMemory(k.Handle); /* * khan.ReadProcess = process; * khan.OpenProcess(); */ } foreach (DataRow dr in prf.Rows) { tab_acc_prof.Rows.Add(dr.Field <Int32?>("acc_id"), dr["user_code"].ToString(), dr.Field <Boolean?>("OpenBooster"), dr.Field <Boolean?>("Extreme"), dr.Field <Boolean?>("Multi_Target"), dr.Field <Boolean?>("NPC"), dr.Field <Boolean?>("Items"), dr.Field <DateTime?>("Expiration"), dr.Field <Boolean?>("Bot"), dr.Field <Int32?>("MaxBoost"), dr.Field <Boolean?>("WeapMod"), dr.Field <Boolean?>("ArmorHack")); } bg_get_user.RunWorkerAsync(); }
/// <summary> /// Starts the demo. /// </summary> public void StartDemo() { var processName = "PathOfExile"; var process = System.Diagnostics.Process.GetProcessesByName(processName).FirstOrDefault(); if (process == null) { return; } _processSharp = new ProcessSharp(process, MemoryType.Remote); _overlay = new WpfOverlayDemoExample(); var wpfOverlay = (WpfOverlayDemoExample)_overlay; wpfOverlay.Initialize(_processSharp.WindowFactory.MainWindow); wpfOverlay.Enable(); _work = true; var info = wpfOverlay.Settings.Current; wpfOverlay.OverlayWindow.Draw += OnDraw; while (_work) { _overlay.Update(); } }
public void TestRemoteMemory() { System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("notepad++"); Assert.Greater(processes.Length, 0, "Failed to find a running instance of Notepad++."); var process = new ProcessSharp(processes[0], Process.NET.Memory.MemoryType.Remote); Assert.That(process.Memory.GetType() == typeof(Memory.ExternalProcessMemory), "Failed to find ExternalProcessMemory given MemoryType.Remote"); }
/// <summary> /// Determines whether the editor is open in the osu! client by checking if the window title ends with ".osu". /// </summary> /// <returns></returns> public static bool IsEditorOpen() { var process = System.Diagnostics.Process.GetProcessesByName("osu!").FirstOrDefault(); var processSharp = new ProcessSharp(process, MemoryType.Remote); var osuWindow = processSharp.WindowFactory.MainWindow; return(osuWindow.Title.EndsWith(@".osu")); }
private void Setup(NETProcess process) { factory?.Dispose(); target?.Dispose(); target = new ProcessSharp(process, MemoryType.Remote); factory = new AssemblyFactory(target, this); attach = false; }
/// <summary> /// Starts the demo. /// </summary> public void StartDemo() { Log.Debug(@"Please type the process name of the window you want to attach to, e.g 'notepad."); Log.Debug("Note: If there is more than one process found, the first will be used."); // Set up objects/overlay var processName = Console.ReadLine(); var process = System.Diagnostics.Process.GetProcessesByName(processName).FirstOrDefault(); if (process == null) { Log.Warn($"No process by the name of {processName} was found."); Log.Warn("Please open one or use a different name and restart the demo."); Console.ReadLine(); return; } _processSharp = new ProcessSharp(process, MemoryType.Remote); _overlay = new WpfOverlayDemoExample(); var wpfOverlay = (WpfOverlayDemoExample)_overlay; // This is done to focus on the fact the Init method // is overriden in the wpf overlay demo in order to set the // wpf overlay window instance wpfOverlay.Initialize(_processSharp.WindowFactory.MainWindow); wpfOverlay.Enable(); _work = true; // Log some info about the overlay. Log.Debug("Starting update loop (open the process you specified and drag around)"); Log.Debug("Update rate: " + wpfOverlay.Settings.Current.UpdateRate.Milliseconds()); var info = wpfOverlay.Settings.Current; Log.Debug($"Author: {info.Author}"); Log.Debug($"Description: {info.Description}"); Log.Debug($"Name: {info.Name}"); Log.Debug($"Identifier: {info.Identifier}"); Log.Debug($"Version: {info.Version}"); Log.Info("Note: Settings are saved to a settings folder in your main app folder."); Log.Info("Give your window focus to enable the overlay (and unfocus to disable..)"); Log.Info("Close the console to end the demo."); wpfOverlay.OverlayWindow.Draw += OnDraw; // Do work while (_work) { _overlay.Update(); } Log.Debug("Demo complete."); }
public void StartDemo() { Console.Title = @"Âđĺě˙ çŕęŕçîâ äë˙ Äŕëüíîáîéůčęŕ"; //var processName = "notepad"; //čě˙ ďđîöĺńńŕ var processName = "GTA5"; //čě˙ ďđîöĺńńŕ var process = System.Diagnostics.Process.GetProcessesByName(processName).FirstOrDefault(); if (process == null) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"Čăđŕ íĺ íŕéäĺíŕ."); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("Îćčäŕíčĺ çŕďóńęŕ čăđű..."); System.Threading.Thread.Sleep(5000); Console.Clear(); StartDemo(); } _directXoverlayPluginExample = new DirectxOverlayPluginExample(); _processSharp = new ProcessSharp(process, MemoryType.Remote); var result = "30"; var fpsValid = int.TryParse(Convert.ToString(result, CultureInfo.InvariantCulture), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out int fps); var d3DOverlay = (DirectxOverlayPluginExample)_directXoverlayPluginExample; d3DOverlay.Settings.Current.UpdateRate = 1000 / fps; _directXoverlayPluginExample.Initialize(_processSharp.WindowFactory.MainWindow); _directXoverlayPluginExample.Enable(); // Log some info about the overlay. var info = d3DOverlay.Settings.Current; Console.ForegroundColor = ConsoleColor.Cyan; Console.Write($"Ŕâňîđ: "); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine($"{ info.Author}"); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write($"Îâĺđëĺé: "); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine($"{ info.Identifier}"); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write($"Âĺđńč˙: "); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine($"{ info.Version}"); Console.WriteLine(""); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("×ňîáű âűęëţ÷čňü îâĺđëĺé - çŕęđîéňĺ ęîíńîëü."); while (true) { _directXoverlayPluginExample.Update(); } }
public MemoryService( ProcessSharp processSharp, IObjectManager objectManager) { this.processSharp = processSharp; this.objectManager = objectManager; enumerateVisibleObjectsCallbackDelegate = EnumerateVisibleObjectsCallback; enumerateVisibleObjectsCallbackPointer = Marshal.GetFunctionPointerForDelegate(enumerateVisibleObjectsCallbackDelegate); }
public override void Enable() { var tempProcess = MemoryHelpers.GetProcessIfRunning(ProcessName); if (tempProcess == null) return; _process = new ProcessSharp(tempProcess, MemoryType.Remote); Initialized = true; }
public static IntPtr PointRead(System.Diagnostics.Process procc, IntPtr baseAddres, int[] offsets) { var vam = new ProcessSharp(procc, Process.NET.Memory.MemoryType.Remote); for (int i = 0; i < offsets.Count() - 1; i++) { baseAddres = vam.Memory.Read <IntPtr>(IntPtr.Add(baseAddres, offsets[i])); } return(baseAddres + offsets[offsets.Count() - 1]); }
public unsafe SMHooks() { SMProcess = new ProcessSharp(System.Diagnostics.Process.GetCurrentProcess(), MemoryType.Local); // WndProc WndProcDelegate = new ManagedWndProc(WndProc); WndProcWrapper.SetCallback(Marshal.GetFunctionPointerForDelegate(WndProcDelegate)); // Native calls SetupNativeMethods(); }
public RemoteExecution(ProcessSharp <TExecDesc> process, bool initialize, Dictionary <string, int> cachedAddresses, object[] procedureConstructorParams) { Process = process; CachedAddresses = cachedAddresses ?? new Dictionary <string, int>(); Factory = new AssemblyFactory(process, new Fasm32Assembler()); if (initialize) { Initialize(procedureConstructorParams); } }
private void _2DRadarToggle(object sender, RoutedEventArgs e) { ToggleButton b = (ToggleButton)sender; if (b.IsChecked.GetValueOrDefault()) { this.cts = new CancellationTokenSource(); this.RadarOverlayThread = new Thread(delegate() { this.ro = new RadarOverlay(this.cts.Token); ProcessSharp ps = new ProcessSharp(Program.mem.Process.Id, MemoryType.Remote); this.ro.Initialize(ps.WindowFactory.MainWindow); this.ro.Enable(); Dispatcher.Run(); }) { IsBackground = true }; this.RadarOverlayThread.SetApartmentState(ApartmentState.STA); this.RadarOverlayThread.Start(); Task.Run(async delegate() { await Task.Delay(1000).ConfigureAwait(false); if (!this.cts.IsCancellationRequested && !Settings.Default.RadarEnableClickthru) { RadarOverlay radarOverlay2 = this.ro; if (radarOverlay2 != null) { radarOverlay2.MakeClickable(); } } }); return; } bool?isChecked = b.IsChecked; bool flag = true; if (!(isChecked.GetValueOrDefault() == flag & isChecked != null)) { CancellationTokenSource cancellationTokenSource = this.cts; if (cancellationTokenSource != null) { cancellationTokenSource.Cancel(); } RadarOverlay radarOverlay = this.ro; if (radarOverlay != null) { radarOverlay.Dispose(); } this.ro = null; } }
public override void Enable() { var tempProcess = MemoryHelpers.GetProcessIfRunning(ProcessName); if (tempProcess == null) { return; } _process = new ProcessSharp(tempProcess, MemoryType.Remote); Initialized = true; }
private void initMemory() { System.Diagnostics.Process dbfz = System.Diagnostics.Process.GetProcessesByName("RED-Win64-Shipping")[0]; var dbfzproc = new ProcessSharp(dbfz); dbfzmem = new ExternalProcessMemory(dbfzproc.Handle); var baseaddress = dbfzproc.ModuleFactory.MainModule.BaseAddress; framecounter = IntPtr.Add(baseaddress, 0x35EAB48); var recordingptr = (IntPtr)dbfzmem.Read <int>(IntPtr.Add(baseaddress, 0x3817BD8)); recordingStart = IntPtr.Add(recordingptr, 0x718); inputbuffer = IntPtr.Add(baseaddress, 0x35EAC08); }
private static ProcessSharp getProcess() { var MCCProcess = System.Diagnostics.Process.GetProcessesByName("MCC-Win64-Shipping").FirstOrDefault(); if (MCCProcess == null) { MessageBox.Show("Could not locate process. Is MCC running?", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(1); } var process = new ProcessSharp(MCCProcess, Process.NET.Memory.MemoryType.Remote); return(process); }
/// <summary> /// Scan SuperMemo to find the methods matching the signatures provided by /// <paramref name="nativeData" />. Also sets up the WndProc detour. /// </summary> /// <param name="nativeData">The offsets and method signatures for the running SuperMemo version</param> private unsafe void InstallSM(NativeData nativeData) { _smProcess = new ProcessSharp(System.Diagnostics.Process.GetCurrentProcess(), MemoryType.Local); // WndProc _wndProcDelegate = new ManagedWndProc(WndProc); WndProcWrapper.SetCallback(Marshal.GetFunctionPointerForDelegate(_wndProcDelegate)); SMA.SetWndProcHookAddr(WndProcWrapper.GetWndProcNativeWrapperAddr()); // Native calls ScanSMMethods(nativeData); }
public void TestLocalDwordPattern() { var process = new ProcessSharp(System.Diagnostics.Process.GetCurrentProcess(), Memory.MemoryType.Local); var module = process.ModuleFactory.MainModule; var scanner = new PatternScanner(module); Assert.NotNull(scanner, "Failed to instantiate PatternScanner object."); Assert.NotNull(scanner.Data, "Failed to read local memory in to Data object."); var pattern = new DwordPattern("E8 ? ? ? ? 83 C4"); //Most common x86 signature. CALL DWORD ADD ESP, X. var result = scanner.Find(pattern); Assert.IsTrue(result.Found, "Failed to find signature in TestLocalDwordPattern."); Assert.IsNotNull(result.Offset, "Offset was null in TestLocalDwordPattern."); }
public void StartDemo() { Log.Debug(@"Please type the process name of the window you want to attach to, e.g 'notepad."); Log.Debug("Note: If there is more than one process found, the first will be used."); var processName = Console.ReadLine(); var process = System.Diagnostics.Process.GetProcessesByName(processName).FirstOrDefault(); if (process == null) { Log.Warn($"No process by the name of {processName} was found."); Log.Warn("Please open one or use a different name and restart the demo."); Console.ReadLine(); return; } _directXoverlayPluginExample = new DirectxOverlayPluginExample(); _processSharp = new ProcessSharp(process, MemoryType.Remote); _directXoverlayPluginExample.Initialize(_processSharp.WindowFactory.MainWindow); _directXoverlayPluginExample.Enable(); var d3DOverlay = (DirectxOverlayPluginExample)_directXoverlayPluginExample; // Log some info about the overlay. Log.Debug("Starting update loop (open the process you specified and drag around)"); Log.Debug("Update rate: " + d3DOverlay.Settings.Current.UpdateRate.Milliseconds()); var info = d3DOverlay.Settings.Current; Log.Debug($"Author: {info.Author}"); Log.Debug($"Description: {info.Description}"); Log.Debug($"Name: {info.Name}"); Log.Debug($"Identifier: {info.Identifier}"); Log.Debug($"Version: {info.Version}"); Log.Info("Note: Settings are saved to a settings folder in your main app folder."); Log.Info("Give your window focus to enable the overlay (and unfocus to disable..)"); Log.Info("Close the console to end the demo."); while (true) { _directXoverlayPluginExample.Update(); } }
private static void SetObjectType(ProcessSharp Processsharp, IntPtr ptr) { var vtmPtr = Processsharp.Memory.Read <IntPtr>(ptr + Offsets.UIObject.GetTypeNameVfuncOffset); if (IsValidTypePtr(Processsharp, vtmPtr)) { var strPtr = Processsharp.Memory.Read <IntPtr>(vtmPtr + 1); var str = Processsharp.Memory.Read(strPtr, Encoding.UTF8, 128); UIObjectTypeCache[ptr] = GetUIObjectTypeFromString(str); } else { UIObjectTypeCache[ptr] = UIObjectType.None; } }
public static Task GetWorldPtr() { process = new ProcessSharp(Utilities.BaseProc(), MemoryType.Remote); mem = new ExternalProcessMemory(process.Handle); //WorldPtr IntPtr addr = Find(process.ModuleFactory.MainModule.Name, MemoryReader.WorldPTR, process).ReadAddress; addr = addr + mem.Read <int>(addr + 3) + 7; IntPtr WorldPtr = mem.Read <IntPtr>(addr); Addresses.WorldPtr = WorldPtr; return(Task.CompletedTask); }
public WoWNameCache(ProcessSharp process, IntPtr baseAddress) { Process = process; CurrentCacheAddress = process.Native.MainModule.BaseAddress + baseAddress.ToInt32(); }