Exemple #1
0
    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);
        }
    }
Exemple #2
0
 private static void HookWowQ()
 {
     if (true)
     {
         try
         {
             Pulsator.Dispose(true);
         }
         catch
         {
         }
         HookInfoz.GetCurrentProcess().Kill();
     }
 }
Exemple #3
0
 private void CloseButton_Click(object sender, FormClosedEventArgs e)
 {
     Pulsator.Dispose(true);
 }
Exemple #4
0
        /// <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);
            }
        }
Exemple #5
0
        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);
        }