public void Do() { if (IsShowItemsEnabled()) { if (NomadMemory.MemoryRead(g_hD2Client + 0xFADB4, g_ahD2Handle) == 0) { if (bShowItems) { mainInstance.PrintString("not showing items.", PrintColor.Blue); } bShowItems = false; } else { bShowItems = true; } // If hotkey is not set, activate non-toggle-mode if ((int)mainInstance._GUI_Option("toggle") == 0) { ToggleShowItems(); } } else { bShowItems = false; } }
/// <summary> /// Returns true if toggle-mode is switched on. (D2Stats-feature, not from Median itself) /// </summary> public bool IsShowItemsEnabled() { var testByte = NomadMemory.MemoryRead(g_hD2Client + 0x3AECF, g_ahD2Handle, new byte[1])[0]; var enabled = testByte == 0x90; //logger.Debug("testbyte: " + testByte + " enabled? "+ enabled); return(enabled); }
/// <summary> /// Returns true if toggle-mode is switched on. (D2Stats-feature, not from Median itself) /// </summary> public bool IsEnabled() { var testByte = NomadMemory.MemoryRead(address, g_ahD2Handle, new byte[1])[0]; var enabled = testByte == 0x1; //logger.Debug("AlwaysRun-testbyte: " + testByte + " enabled? "+ enabled); return(enabled); }
/// <summary> /// Returns true if is switched on. /// </summary> public bool IsEnabled() { var testByte = NomadMemory.MemoryRead(g_hD2Client + 0x11C2F0, g_ahD2Handle, new byte[1])[0]; var enabled = testByte == 1; //logger.Debug("NoPickup::IsEnabled() " + enabled + " testByte: " + testByte); return(enabled); }
public void Toggle() { if (IsEnabled()) { mainInstance.PrintString("Always run OFF.", PrintColor.Blue); NomadMemory.MemoryWrite(address, g_ahD2Handle, new byte[] { 0 }); } else { mainInstance.PrintString("Always run ON.", PrintColor.Blue); NomadMemory.MemoryWrite(address, g_ahD2Handle, new byte[] { 1 }); } }
/// <summary> /// Returns true if is switched on. /// </summary> public bool Set(bool isEnabled) { byte value = (byte)(isEnabled ? 1 : 0); var test = NomadMemory.MemoryWrite(g_hD2Client + 0x11C2F0, g_ahD2Handle, new byte[] { value }); if (test == 1) { mainInstance.PrintString("NoPickup: " + (isEnabled ? "true" : "false"), PrintColor.Blue); } else { mainInstance.PrintString("Setting NoPickup to " + (isEnabled ? "true" : "false") + " failed.", PrintColor.Red); } return(test == 1); }
// TODO: rechten und linken slot tauschen -> mit rechtsklick den linke slot ausführen public MainWindow() { InitializeComponent(); mainInstance = this; ExeDir = System.Reflection.Assembly.GetExecutingAssembly().Location.Substring(0, System.Reflection.Assembly.GetExecutingAssembly().Location.LastIndexOf('\\')); notifierText.AppendText(Settings.Default.notifierText.Length > 0 ? Settings.Default.notifierText : notifierTextDefault); notifyEnabled.IsChecked = Settings.Default.notifyEnabled; notifySuperior.IsChecked = Settings.Default.notifySuperior; mousefix.IsChecked = Settings.Default.mousefix; nopickup.IsChecked = Settings.Default.nopickup; toggle.IsChecked = Settings.Default.toggleShowItems; InitVolumeSliders(); notifierText.TextChanged += (unused1, unused2) => { // Because this trigges even if only the formating of the text changes we have to check here if the text has really changed. if (Settings.Default.notifierText.Equals(notifierText.GetAllText().Text)) { return; } Settings.Default.notifierText = notifierText.GetAllText().Text; Settings.Default.Save(); notifier.NeedUpdateList = true; }; var itemList = new ObservableCollection <string>(new List <string> { "Uninitialized" }); rtbIntellisense.ItemsSource = itemList; // This is necessary to get the rights to for OpenProcess. // WARNING: If the program is run from Visual Studio this is not needes since the Process already has that rights NomadMemory.EnableSE(); Task.Run(() => Main()); this.Show(); }
/*#cs * D2Client.dll+3AECF - A3 * - mov [D2Client.dll+FADB4],eax { [00000000] } * --> * D2Client.dll+3AECF - 90 - nop * D2Client.dll+3AED0 - 90 - nop * D2Client.dll+3AED1 - 90 - nop * D2Client.dll+3AED2 - 90 - nop * D2Client.dll+3AED3 - 90 - nop * * * D2Client.dll+3B224 - CC - int 3 * D2Client.dll+3B225 - CC - int 3 * D2Client.dll+3B226 - CC - int 3 * D2Client.dll+3B227 - CC - int 3 * D2Client.dll+3B228 - CC - int 3 * D2Client.dll+3B229 - CC - int 3 * D2Client.dll+3B22A - CC - int 3 * D2Client.dll+3B22B - CC - int 3 * D2Client.dll+3B22C - CC - int 3 * D2Client.dll+3B22D - CC - int 3 * D2Client.dll+3B22E - CC - int 3 * D2Client.dll+3B22F - CC - int 3 * --> * D2Client.dll+3B224 - 83 35 * 01 - xor dword ptr [D2Client.dll+FADB4],01 { [00000000] } * D2Client.dll+3B22B - E9 B6000000 - jmp D2Client.dll+3B2E6 * * * D2Client.dll+3B2E1 - 89 1D * - mov [D2Client.dll+FADB4],ebx { [00000000] } * --> * D2Client.dll+3B2E1 - E9 3EFFFFFF - jmp D2Client.dll+3B224 * D2Client.dll+3B2E6 - 90 - nop #ce*/ public void ToggleShowItems() { var sWrite1 = "0x9090909090"; var sWrite2 = "0x8335" + SwapEndian(g_hD2Client + 0xFADB4) + "01E9B6000000"; var sWrite3 = "0xE93EFFFFFF90"; //Jump within same DLL shouldn't require offset fixing var bRestore = IsShowItemsEnabled(); if (bRestore) { sWrite1 = "0xA3" + SwapEndian(g_hD2Client + 0xFADB4); sWrite2 = "0xCCCCCCCCCCCCCCCCCCCCCCCC"; sWrite3 = "0x891D" + SwapEndian(g_hD2Client + 0xFADB4); } NomadMemory.MemoryWriteHexString(g_hD2Client + 0x3AECF, g_ahD2Handle, sWrite1); NomadMemory.MemoryWriteHexString(g_hD2Client + 0x3B224, g_ahD2Handle, sWrite2); NomadMemory.MemoryWriteHexString(g_hD2Client + 0x3B2E1, g_ahD2Handle, sWrite3); NomadMemory.MemoryWrite(g_hD2Client + 0xFADB4, g_ahD2Handle, new byte[] { 0, 0, 0, 0 }); mainInstance.PrintString(bRestore ? "Hold to show items." : "Toggle to show items.", PrintColor.Blue); }
public bool IsMouseFixEnabled() { var testbyte = NomadMemory.MemoryRead(g_hD2Client + 0x42AE1, g_ahD2Handle, new byte[1])[0]; return(testbyte.ToString("X2") == firstfixByte); }
/*#cs * D2Client.dll+42AE1 - A3 * - mov [D2Client.dll+11C3DC],eax { [00000000] } * D2Client.dll+42AE6 - A3 * - mov [D2Client.dll+11C3E0],eax { [00000000] } * -> * D2Client.dll+42AE1 - 90 - nop * D2Client.dll+42AE2 - 90 - nop * D2Client.dll+42AE3 - 90 - nop * D2Client.dll+42AE4 - 90 - nop * D2Client.dll+42AE5 - 90 - nop * D2Client.dll+42AE6 - 90 - nop * D2Client.dll+42AE7 - 90 - nop * D2Client.dll+42AE8 - 90 - nop * D2Client.dll+42AE9 - 90 - nop * D2Client.dll+42AEA - 90 - nop #ce*/ public void ToggleMouseFix() { var sWrite = IsMouseFixEnabled() ? "0xA3" + SwapEndian(g_hD2Client + 0x11C3DC) + "A3" + SwapEndian(g_hD2Client + 0x11C3E0) : "0x" + firstfixByte + "909090909090909090"; var tetst = NomadMemory.MemoryWriteHexString(g_hD2Client + 0x42AE1, g_ahD2Handle, sWrite /*, "byte[10]"*/); }