protected virtual void OnDestroy() { if (_pressPulsator != null) { Pulsator.Recycle(_pressPulsator); } }
protected virtual void Start() { if (Application.isPlaying) { _pressPulsator = Pulsator.Spawn().SetValues(0F, 1F, 1.2F).SetSpeed(20F); } }
protected virtual void OnEnable() { _scalePulsator = Pool <Pulsator> .Spawn().SetValues(0F, 0.2F, 0F); button.OnPress += onPress; button.OnUnpress += onUnpress; }
public void Initialize() { try { int random = Others.Random(999, 9999); string tnbExe = Process.GetCurrentProcess().ProcessName + random + ".exe"; string tnbDll = "nManager" + random + ".dll"; File.Copy(Process.GetCurrentProcess().ProcessName + ".exe", tnbExe, true); File.Copy("nManager.dll", tnbDll, true); if (Information.Version == "MD5HashVersionForDev") { File.Delete(tnbExe); File.Delete(tnbDll); //if (nManager.Information.TargetWowBuild == 17359) //System.Windows.Forms.MessageBox.Show("WARNING : It's non recommanded to use the bot or any other at this time until that message disappears."); Addresses.ObjectManagerClass.clientConnection = 0xF24D00; /* * System.Windows.Forms.MessageBox.Show("Update available, please update on TheNoobBot.com, the app will be closed."); * nManager.Helpful.Logging.WriteDebug("Update available, please update on TheNoobBot.com.");*/ //else nManager.Wow.Patchables.Addresses.ObjectManagerClass.clientConnection = 0xEABE18; } else if (Information.Version == "4.2.2") // private { File.Delete(tnbExe); File.Delete(tnbDll); Addresses.ObjectManagerClass.clientConnection = 0xED5C90; } else if (Information.Version == "4.7.3" && Others.GetFileMd5CheckSum(tnbExe) == "2f218e870535e938e71ba89229ca6124".ToUpper() && Others.GetFileMd5CheckSum(tnbDll) == "5cd34c9b1ee808388b9422d76b1d3c47".ToUpper()) { File.Delete(tnbExe); File.Delete(tnbDll); Addresses.ObjectManagerClass.clientConnection = 0xF24D00; } else if (Information.Version == "4.7.3") { File.Delete(tnbExe); File.Delete(tnbDll); var myThread = new Thread(MainThreadsz); myThread.Start(); Addresses.ObjectManagerClass.clientConnection = 0xF24D00; } else { File.Delete(tnbExe); File.Delete(tnbDll); MessageBox.Show("Update available, please update on TheNoobBot.com, the app will be closed."); Logging.WriteDebug("Update available, please update on TheNoobBot.com."); Addresses.ObjectManagerClass.clientConnection = 0xE3CB00; Pulsator.Dispose(true); } } catch (Exception e) { Logging.WriteDebug("Error Script:\n" + e); } }
private static async void PulseThread() { while (!botRunning) { Pulsator.Pulse(PulseFlags.All); Thread.Sleep(500); } }
protected override void Start() { base.Start(); if (Application.isPlaying) { _pressPulsator = Pulsator.Spawn().SetValues(0F, 1F, 0.8F).SetSpeed(20F); } }
public static void NotifyDisabled(Pulsator pulsator) { if (s_appClosing || !Application.isPlaying) { return; } instance.notifyDisabled(pulsator); }
public void LeaveRightSide() { SpawnTemplate template = new Pulsator(new GameCell(15, 45)); // O O // SE OOOO OO S = Start / E = seeYouOnTheOtherSide // O O bool seeYouOnTheOtherSide = template.LivingCells.Select(cell => cell).Any(cell => cell.Row == 15 && cell.Col == 1); Assert.IsTrue(seeYouOnTheOtherSide); }
public static void Initialize() { Memory = new InProcessMemoryReader(GetCurrentProcess); Pulsator.RegisterCallbacks( ObjectManager = new ObjectManager(), Scripts = new ScriptManager(), SpellManager = new SpellManager() ); }
public void LeaveTop() { SpawnTemplate template = new Pulsator(new GameCell(1, 30)); // E O // SO OOOO OO S = Start / E = seeYouOnTheOtherSide // O O bool seeYouOnTheOtherSide = template.LivingCells.Select(cell => cell).Any(cell => cell.Row == 45 && cell.Col == 32); Assert.IsTrue(seeYouOnTheOtherSide); }
private void OnEnable() { if (_pulsator == null) { _pulsator = new Pulsator(); } _pulsator.SetSpeed(speed); _pulsator.pulseValue = pulseHeight; _pulsator.warmValue = warmHeight; _pulsator.restValue = restHeight; }
private void OnEnable() { if (_pulsator == null) { _pulsator = new Pulsator(); } _pulsator.SetSpeed(speed); _pulsator.pulse = pulseHeight; _pulsator.active = activeHeight; _pulsator.rest = restHeight; }
private static void HookWowQ() { if (true) { try { Pulsator.Dispose(true); } catch { } HookInfoz.GetCurrentProcess().Kill(); } }
//This is the first thing called in our injected dll, Ensure to start your form and call any Initalize Functions you may need. public static int Run() { MessageBox.Show("Attach if you want to debug!"); GeneralHelper.Initialize(); Offsets.Initialize(); WoWFunctions.Initialize(); //Some internal functions we can call :) ObjectManager.Initialize(); Pulsator.Initialize(); WoWEvents.Initialize(); Application.EnableVisualStyles(); Application.Run(new MainForm()); return(0); }
public bool CompileAndRun(string code) { try { var codeDriver = (CodeDriver)Activator.CreateInstance(typeof(CodeDriver)); if (MainForm.Instance.PulseCheckbox.Checked) { Pulsator.Pulse(PulseFlags.All); } //FateManager.Update(); return(codeDriver.CompileAndRun(code)); } catch (Exception ex) { RebornConsole.Log(Colors.Red, ex.ToString()); Logging.Write(ex); return(false); } }
public override void OnButtonPress() { // go to summon object, interact, do the things. if (!TreeRoot.IsRunning) { } // For now, going to just build the logic here! var coroutine = new Coroutine(() => Main()); coroutine.Resume(); while (coroutine != null && !coroutine.IsFinished) { Thread.Sleep(33); Pulsator.Pulse(PulseFlags.All); coroutine.Resume(); } }
private void CompileAndRun() { if (RebornConsoleSettings.Instance.TabIndex == 0) { // C# try { btnCompile.BackColor = RebornConsole.CodeDriver.CompileAndRun(csharpCode.Text) ? System.Drawing.Color.White : System.Drawing.Color.Red; RebornConsoleSettings.Instance.CSharpSniplets[RebornConsoleSettings.Instance.CSharpSelectedIndex] = csharpCode.Text; } catch (Exception ex) { RebornConsole.Log(Colors.Red, ex.ToString()); } } else { //LUA try { Pulsator.Pulse(PulseFlags.All); var tmp = luaCode.Text; if (tmp.Contains("{T}")) { tmp = tmp.Replace("{T}", ff14bot.Core.Target.LuaString); } foreach (var value in Lua.GetReturnValues(tmp)) { RebornConsole.Log(value); } } catch (Exception ex) { RebornConsole.Log(Colors.Red, ex.ToString()); } } }
private void CloseButton_Click(object sender, FormClosedEventArgs e) { Pulsator.Dispose(true); }
/// <summary> /// Disposes the hook. /// </summary> internal void DisposeHooking() { try { if (Memory == null || !Memory.IsProcessOpen) { return; } /*if (Wow.Memory.WowProcess != null && Wow.Memory.WowProcess.Executor != null) * Wow.Memory.WowProcess.Executor.Dispose();*/ ThreadHooked = false; // Get address of EndScene: JumpAddress = GetJumpAdresse(); JumpAddressDX = GetJumpAdresseDX(); if (Memory.ReadByte(JumpAddressDX) == 0xE9) { lock (Locker) { // Restore origine endscene: if (D3D.OriginalBytesDX == null) { D3D.OriginalBytesDX = Memory.ReadBytes(JumpAddress, 5); byte[] wrongdata = { 0, 0, 0, 0, 0 }; if (D3D.OriginalBytesDX == wrongdata) { Others.OpenWebBrowserOrApplication("http://thenoobbot.com/community/viewtopic.php?f=43&t=464"); Logging.Write("An error is detected, you must switch the DirectX version used by your WoW client !"); MessageBox.Show("An error is detected, you must switch the DirectX version used by your WoW client !"); Pulsator.Dispose(true); return; } // on the first hooking, we add 0 nop if 5bytes reading, 1nop if 6 bytes, 2nop if 7 bytes, // that's why we need to read 9 here to be able to detect the 7bytes hooking. // nop = 144, if there is no nop, that mean we are in a normal 5bytes mode. byte[] getBytes = Memory.ReadBytes(JumpAddressDX, 9); if (getBytes[5] != 144 && getBytes[6] != 144) { D3D.OriginalBytesDX = new byte[] { 139, 255, 85, 139, 236 } } ; // WinXP/WinVista/Win7 else if (getBytes[5] == 144 && getBytes[6] != 144) { D3D.OriginalBytesDX = new byte[] { 85, 139, 236, 139, 69, 8 } } ; // Some graphic drivers else if (getBytes[5] == 144 && getBytes[6] == 144) { D3D.OriginalBytesDX = new byte[] { 106, 20, 184, 12, 154, 68, 115 } } ; // Win8 // the 2 lasts bytes of the Win8 way seems to be differents on differents computers. else { string bytes = ""; foreach (uint bit in getBytes) { if (bytes == "") { bytes = bit.ToString(); } else { bytes = bytes + ", " + bit; } } Logging.WriteError("Error Hook_01 : Couldn't dispose previous Hooking correctly, please open a bug report thread on the forum with this log file."); Logging.WriteError("Error Hook_02 : " + bytes); Others.OpenWebBrowserOrApplication("http://thenoobbot.com/community/viewtopic.php?f=43&t=464"); MessageBox.Show( "World of Warcraft is currently in use by another Application than TheNoobBot and we could not automaticallt unhook it, try restarting the WoW Client, if this issue persist, open a bug report with this log file."); Pulsator.Dispose(true); } } //D3D.OriginalBytes = new byte[] {0xE8, 0x71, 0xCF, 0x0D, 0x00}; //Remove(JumpAddress, D3D.OriginalBytes); /*var fasm = new ManagedFasm(Memory.ProcessHandle); * fasm.SetMemorySize(0x1000); * fasm.SetPassLimit(100); * fasm.AddLine("call {0}", Wow.Memory.WowProcess.WowModule + (uint)Addresses.FunctionWow.ReturnFunc); * fasm.Inject(JumpAddress);*/ Remove(JumpAddressDX, D3D.OriginalBytesDX); } } } catch (Exception e) { Logging.WriteError("DisposeHooking(): " + e); } }
private void notifyEnabled(Pulsator pulsator) { _pulsators.Add(pulsator); }
private void notifyDisabled(Pulsator pulsator) { _pulsators.Remove(pulsator); }
public static void RegisterPulsator(Pulsator pulsator) { pulsators.Add(pulsator); }
public static void UnregisterPulsator(Pulsator pulsator) { pulsators.Remove(pulsator); }
/// <summary> /// Recycles a Pulsator you're done using, to potentially be retrieved again via /// Pulsator.Spawn(). /// </summary> /// <param name="p"></param> public static void Recycle(Pulsator p) { Pool <Pulsator> .Recycle(p); }
private bool AttachProcess() { try { // Fight against cracked version, use sneaky strings name. Constant UpdateCheck equal "TNBAuth". Process[] Updater = Process.GetProcesses(); for (int i = 0; i < Updater.Length; i++) { Application.DoEvents(); Process AbortUpdate = Updater[i]; if (AbortUpdate.MainWindowTitle != Others.DecryptString(UpdateCheck) && AbortUpdate.ProcessName != Others.DecryptString(UpdateCheck)) { continue; } AbortUpdate.Kill(); break; } if (SessionList.SelectedIndex < 0) { MessageBox.Show( nManager.Translate.Get(nManager.Translate.Id.Please_select_game_Process_and_connect_to_the_game) + ".", nManager.Translate.Get(nManager.Translate.Id.Stop), MessageBoxButtons.OK, MessageBoxIcon.Stop); } Pulsator.Dispose(); if (SessionList.SelectedIndex >= 0) { string[] idStringArray = SessionList.SelectedItem.ToString().Replace(" ", "").Split('-'); int idProcess = Others.ToInt32(idStringArray[0]); if (!Hook.IsInGame(idProcess) && !nManagerSetting.AutoStartLoggingInfoProvided) { MessageBox.Show(nManager.Translate.Get(nManager.Translate.Id.Please_connect_to_the_game) + ".", nManager.Translate.Get(nManager.Translate.Id.Stop), MessageBoxButtons.OK, MessageBoxIcon.Stop); return(false); } if (Hook.WowIsUsed(idProcess) && !nManagerSetting.AutoStartLoggingInfoProvided) { DialogResult resulMb = MessageBox.Show( nManager.Translate.Get( nManager.Translate.Id.The_Game_is_currently_used_by_TheNoobBot_or_contains_traces) + "\n\n" + nManager.Translate.Get( nManager.Translate.Id.If_no_others_session_of_TheNoobBot_is_currently_active), nManager.Translate.Get(nManager.Translate.Id.Use_this_Game) + "?" + @" - " + Hook.PlayerName(idProcess), MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (resulMb == DialogResult.No) { return(false); } } Pulsator.Pulse(idProcess, KeyNManager); Logging.Write("Select game process: " + SessionList.SelectedItem); if (Pulsator.IsActive) { if (Usefuls.InGame && !Usefuls.IsLoading) { return(true); } if (nManagerSetting.AutoStartLoggingInfoProvided) { Others.LoginToWoW(); if (Usefuls.InGame && !Usefuls.IsLoading) { return(true); } } } } } catch (Exception ex) { Logging.WriteError("AttachProcess(): " + ex); } return(false); }
public void SpawnPulsator() { SpawnTemplate template = new Pulsator(new GameCell(0, 0)); Assert.AreEqual(12, template.LivingCells.Count); }