private void CharSelector_Load(object sender, EventArgs e) { procs = Process.GetProcessesByName("Gw"); IntPtr charnameAddr; { GWCAMemory firstprocmems = new GWCAMemory(procs[0]); firstprocmems.InitScanner(new IntPtr(0x401000), 0x49A000); charnameAddr = firstprocmems.ScanForPtr(new byte[] { 0x6A, 0x14, 0x8D, 0x96, 0xBC }, 0x9, true); firstprocmems.TerminateScanner(); } foreach (Process proc in procs) { GWCAMemory mem = new GWCAMemory(proc); if (mem.Read <Int32>(new IntPtr(0x00DE0000)) != 0) { continue; } if (mem.HaveModule("GWToolbox.dll")) { continue; } string charname = mem.ReadWString(charnameAddr, 30); comboBox.Items.Add(charname); checkedListBox.Items.Add(charname, CheckState.Unchecked); } comboBox.SelectedIndex = 0; if (checkedListBox.Items.Count > 0) { checkedListBox.SetItemCheckState(0, CheckState.Checked); } }
private void CharSelector_Load(object sender, EventArgs e) { Process[] check_procs = Process.GetProcessesByName("Gw"); procs = new Process[check_procs.Length]; int validProcs = 0; for (int i = 0; i < check_procs.Length; i++) { GWCAMemory mem = new GWCAMemory(check_procs[i]); if (mem.HaveModule("GWToolbox.dll")) { continue; } Tuple <IntPtr, int> imagebase = mem.GetImageBase(); mem.InitScanner(imagebase.Item1, imagebase.Item2); IntPtr charnameAddr = mem.ScanForPtr(new byte[] { 0x8B, 0xF8, 0x6A, 0x03, 0x68, 0x0F, 0x00, 0x00, 0xC0, 0x8B, 0xCF, 0xE8 }, -0x42, true); mem.TerminateScanner(); procs[validProcs] = check_procs[i]; validProcs++; string charname = mem.ReadWString(charnameAddr, 30); comboBox.Items.Add(charname); checkedListBox.Items.Add(charname, CheckState.Unchecked); } comboBox.SelectedIndex = 0; if (checkedListBox.Items.Count > 0) { checkedListBox.SetItemCheckState(0, CheckState.Checked); } }
public Process[] GetValidProcesses() { Process[] check_procs = Process.GetProcessesByName("Gw"); Process[] tmp_procs = new Process[check_procs.Length]; string[] tmp_charnames = new string[check_procs.Length]; IntPtr charnameAddr = IntPtr.Zero; if (check_procs.Length < 1) { return(check_procs); } int validProcs = 0; // Check for admin rights. WindowsIdentity identity = WindowsIdentity.GetCurrent(); WindowsPrincipal principal = new WindowsPrincipal(identity); bool isElevated = principal.IsInRole(WindowsBuiltInRole.Administrator); for (int i = 0; i < check_procs.Length; i++) { if (!isElevated && ProcessHelper.IsProcessOwnerAdmin(check_procs[i])) { continue; // Guild wars has higher privileges } GWCAMemory mem = new GWCAMemory(check_procs[i]); if (mem.Read <Int32>(new IntPtr(0x00DE0000)) != 0) { continue; } if (mem.HaveModule("GWToolbox.dll")) { continue; } if (charnameAddr == IntPtr.Zero) { mem.InitScanner(new IntPtr(0x401000), 0x49A000); charnameAddr = mem.ScanForPtr(new byte[] { 0x6A, 0x14, 0x8D, 0x96, 0xBC }, 0x9, true); mem.TerminateScanner(); } if (charnameAddr == IntPtr.Zero) { continue; } tmp_procs[validProcs] = check_procs[i]; tmp_charnames[validProcs] = mem.ReadWString(charnameAddr, 60); validProcs++; } charnames = new string[validProcs]; procs = new Process[validProcs]; for (int i = 0; i < validProcs; i++) { procs[i] = tmp_procs[i]; charnames[i] = tmp_charnames[i]; } return(procs); }
private IntPtr GetCharnameAddress(Process process) { var firstprocmems = new GWCAMemory(process); firstprocmems.InitScanner(new IntPtr(0x401000), 0x49A000); var charnameAddr = firstprocmems.ScanForPtr(new byte[] { 0x6A, 0x14, 0x8D, 0x96, 0xBC }, 0x9, true); firstprocmems.TerminateScanner(); return(charnameAddr); }
public Process[] GetValidProcesses() { Process[] check_procs = Process.GetProcessesByName("Gw"); Process[] tmp_procs = new Process[check_procs.Length]; string[] tmp_charnames = new string[check_procs.Length]; IntPtr charnameAddr = IntPtr.Zero; if (check_procs.Length < 1) { return(check_procs); } int validProcs = 0; // Check for admin rights. WindowsIdentity identity = WindowsIdentity.GetCurrent(); WindowsPrincipal principal = new WindowsPrincipal(identity); bool isElevated = principal.IsInRole(WindowsBuiltInRole.Administrator); procs = new Process[check_procs.Length]; for (int i = 0; i < check_procs.Length; i++) { if (!isElevated && ProcessHelper.IsProcessOwnerAdmin(check_procs[i])) { continue; // Guild wars has higher privileges } GWCAMemory mem = new GWCAMemory(check_procs[i]); if (mem.HaveModule("GWToolbox.dll")) { continue; } Tuple <IntPtr, int> imagebase = mem.GetImageBase(); mem.InitScanner(imagebase.Item1, imagebase.Item2); charnameAddr = mem.ScanForPtr(new byte[] { 0x8B, 0xF8, 0x6A, 0x03, 0x68, 0x0F, 0x00, 0x00, 0xC0, 0x8B, 0xCF, 0xE8 }, -0x42, true); mem.TerminateScanner(); if (charnameAddr == IntPtr.Zero) { continue; } tmp_procs[validProcs] = check_procs[i]; tmp_charnames[validProcs] = mem.ReadWString(charnameAddr, 40); validProcs++; } charnames = new string[validProcs]; procs = new Process[validProcs]; for (int i = 0; i < validProcs; i++) { procs[i] = tmp_procs[i]; charnames[i] = tmp_charnames[i]; } return(procs); }
public static void FindAddressesIfNeeded(GWCAMemory cli) { IntPtr tmp; Tuple <IntPtr, int> imagebase = cli.GetImageBase(); cli.InitScanner(imagebase.Item1, imagebase.Item2); tmp = cli.ScanForPtr(new byte[] { 0x55, 0x8B, 0xEC, 0x83, 0xEC, 0x10, 0x56, 0x6A }, 0x22, true); if (tmp != IntPtr.Zero) { WinTitle = tmp; } tmp = cli.ScanForPtr(new byte[] { 0x83, 0xC4, 0x40, 0x5F, 0x5E, 0x5B, 0x8B, 0x4D }); if (tmp != IntPtr.Zero) { EmailAddPtr = cli.Read <IntPtr>(new IntPtr(tmp.ToInt32() - 0x48)); CharnamePtr = cli.Read <IntPtr>(new IntPtr(tmp.ToInt32() - 0x2E)); } cli.TerminateScanner(); }
private void CharSelector_Load(object sender, EventArgs e) { procs = Process.GetProcessesByName("Gw"); IntPtr charnameAddr; { GWCAMemory firstprocmems = new GWCAMemory(procs[0]); firstprocmems.InitScanner(new IntPtr(0x401000), 0x49A000); charnameAddr = firstprocmems.ScanForPtr(new byte[] { 0x6A, 0x14, 0x8D, 0x96, 0xBC }, 0x9, true); firstprocmems.TerminateScanner(); } foreach (Process proc in procs) { GWCAMemory mem = new GWCAMemory(proc); string charname = mem.ReadWString(charnameAddr, 30); comboBox1.Items.Add(charname); } comboBox1.SelectedIndex = 0; }
//public static IntPtr DATInfo = new IntPtr(0x00A35300); public static void FindAddresses(GWCAMemory cli) { IntPtr tmp; cli.InitScanner(new IntPtr(0x00401000), 0x0049A000); tmp = cli.ScanForPtr(new byte[] { 0x33, 0xD2, 0x8B, 0xCE, 0x57, 0x6A, 0x0C }, 0x0D, true); if (tmp != IntPtr.Zero) { WinTitle = tmp; } tmp = cli.ScanForPtr(new byte[] { 0x6A, 0x14, 0x8D, 0x96, 0xBC }); if (tmp != IntPtr.Zero) { EmailAddPtr = new IntPtr(tmp.ToInt32() - 0x9); CharnamePtr = new IntPtr(tmp.ToInt32() + 0x9); } cli.FreeScanner(); scanned = true; }