예제 #1
0
 private void HookTheGame(object sender, EventArgs e)
 {
     if (GameProcess == null)
     {
         try
         {
             // Game Process
             GameProcess = new MemorySharp(ApplicationFinder.FromProcessName("Tsonic_win").First());
             // If the first doesn't successfully happen this will never be hit
             Invoke(new MethodInvoker(WriteGameIsHookedText));
             Invoke(new MethodInvoker(DrawWindow));
             Invoke(new MethodInvoker(DrawStuffTimer));
         }
         catch
         {
             Invoke(new MethodInvoker(WriteWaitingForGameText));
         }
     }
     else if (GameProcess.IsRunning == false)
     {
         try
         {
             // Game Process
             GameProcess = new MemorySharp(ApplicationFinder.FromProcessName("Tsonic_win").First());
             // If the first doesn't successfully happen this will never be hit
             Invoke(new MethodInvoker(WriteGameIsHookedText));
             Invoke(new MethodInvoker(DrawWindow));
             Invoke(new MethodInvoker(DrawStuffTimer));
         }
         catch
         {
             Invoke(new MethodInvoker(WriteWaitingForGameText));
         }
     }
 }
예제 #2
0
파일: Form1.cs 프로젝트: drizzlicious/H5Fix
        private void setFPS_Click(object sender, EventArgs e)
        {
            using (var sharp = new MemorySharp(ApplicationFinder.FromProcessName("halo5forge").FirstOrDefault()))
            {
                long fps;
                try
                {
                    fps = (long)Convert.ToInt32(FPSBox.Text);
                }
                catch (SystemException ex)
                {
                    // this class's error string
                    MessageBox.Show("Invalid FPS value");
                    return;
                }

                bool fpsValid = long.TryParse(FPSBox.Text.ToString(), out fps);

                if (fpsValid)
                {
                    sharp[fpsAddress].Write <long>(1000000 / fps);
                }
                else
                {
                }
            }
        }
예제 #3
0
        static void Main()
        {
            Console.WriteLine("sloobs ty fly");
            Console.WriteLine("toggling fly!");
            new Thread(() =>
            {
                while (true)
                {
                    using (var m = new MemorySharp(ApplicationFinder.FromProcessName("TY2").First()))
                    {
                        var jumpPointer = new IntPtr(0x004465EC);
                        int[] offsets   = { 0x3C, 0x3C, 0x238, 0x54, 0xDC, 0x4 };

                        jumpPointer = m[jumpPointer].Read <IntPtr>();
                        jumpPointer = m[jumpPointer + offsets[0], false].Read <IntPtr>();
                        jumpPointer = m[jumpPointer + offsets[1], false].Read <IntPtr>();
                        jumpPointer = m[jumpPointer + offsets[2], false].Read <IntPtr>();
                        jumpPointer = m[jumpPointer + offsets[3], false].Read <IntPtr>();
                        jumpPointer = m[jumpPointer + offsets[4], false].Read <IntPtr>();

                        m[jumpPointer + offsets[5], false].Write(1);

                        Thread.Sleep(50);
                    }
                }
            }).Start();
        }
예제 #4
0
파일: Form1.cs 프로젝트: drizzlicious/H5Fix
        private void setFov_Click(object sender, EventArgs e)
        {
            using (var sharp = new MemorySharp(ApplicationFinder.FromProcessName("halo5forge").FirstOrDefault()))
            {
                float fov;
                try
                {
                    fov = (float)Convert.ToDouble(fovBox.Text);
                }
                catch (SystemException ex)
                {
                    // this class's error string
                    MessageBox.Show("Invalid FOV value");
                    return;
                }

                bool fovValid = float.TryParse(fovBox.Text.ToString(), out fov);

                if (fovValid)
                {
                    sharp[fovAddress].Write <float>(fov);
                }
                else
                {
                }
            }
        }
예제 #5
0
 public void HookTheGame(object sender, EventArgs e)
 {
     if (GameProcess == null)
     {
         try
         {
             // Game Process
             GameProcess = new MemorySharp(ApplicationFinder.FromProcessName("Tsonic_win").First());
             // If the first doesn't successfully happen this will never be hit
             HeroesHandle = WinAPIComponents.FindWindow(null, HEROES_WINDOW_NAME);
             Program.xSmallMainWindow.Invoke(new MethodInvoker(WriteGameIsHookedText));
             Program.xSmallMainWindow.Invoke(new MethodInvoker(DrawWindow));
         }
         catch
         {
             Program.xSmallMainWindow.Invoke(new MethodInvoker(WriteWaitingForGameText));
         }
     }
     else if (GameProcess.IsRunning == false)
     {
         try
         {
             // Game Process
             GameProcess = new MemorySharp(ApplicationFinder.FromProcessName("Tsonic_win").First());
             // If the first doesn't successfully happen this will never be hit
             HeroesHandle = WinAPIComponents.FindWindow(null, HEROES_WINDOW_NAME);
             Program.xSmallMainWindow.Invoke(new MethodInvoker(WriteGameIsHookedText));
             Program.xSmallMainWindow.Invoke(new MethodInvoker(DrawWindow));
         }
         catch
         {
             Program.xSmallMainWindow.Invoke(new MethodInvoker(WriteWaitingForGameText));
         }
     }
 }
예제 #6
0
파일: Form1.cs 프로젝트: drizzlicious/H5Fix
 private void readCurrentValues()
 {
     using (var sharp = new MemorySharp(ApplicationFinder.FromProcessName("halo5forge").FirstOrDefault()))
     {
         fovBox.Text = Convert.ToString(sharp[fovAddress].Read <float>());
         FPSBox.Text = Convert.ToString(1000000 / sharp[fpsAddress].Read <long>());
     }
 }
예제 #7
0
        public void FromProcessName()
        {
            // Arrange
            var process = Resources.ProcessTest;

            // Act
            var ret = ApplicationFinder.FromProcessName(process.ProcessName).First();

            // Assert
            Assert.AreEqual(process.Id, ret.Id, "Both processes are not equal.");
        }
예제 #8
0
 private void button2_Click(object sender, EventArgs e)
 {
     //Max Level
     using (var m = new MemorySharp(ApplicationFinder.FromProcessName(gameName).FirstOrDefault()))
     {
         var   levelPtr = new IntPtr(0x01CAC924);
         int[] offsets  = { 0x324, 0x38 };
         levelPtr = m[levelPtr].Read <IntPtr>();
         levelPtr = m[levelPtr + offsets[0], false].Read <IntPtr>();
         m[levelPtr + offsets[1], false].Write <int>(15);
     }
 }
예제 #9
0
 private void button1_Click(object sender, EventArgs e)
 {
     //Max Money
     using (var m = new MemorySharp(ApplicationFinder.FromProcessName(gameName).FirstOrDefault()))
     {
         var   moneyPtr = new IntPtr(0x01B71110);
         int[] offsets  = { 0x0, 0x14, 0x14, 0x218 };
         moneyPtr = m[moneyPtr].Read <IntPtr>();
         moneyPtr = m[moneyPtr + offsets[0], false].Read <IntPtr>();
         moneyPtr = m[moneyPtr + offsets[1], false].Read <IntPtr>();
         moneyPtr = m[moneyPtr + offsets[2], false].Read <IntPtr>();
         m[moneyPtr + offsets[3], false].Write <int>(999999999);
     }
 }
예제 #10
0
파일: Program.cs 프로젝트: Kyle873/NepHack
        static void Main()
        {
            try
            {
                Process process = ApplicationFinder.FromProcessName(ProcessName).First();

                if (process != null)
                {
                    Memory = new MemorySharp(process);

                    BaseAddress      = Memory[BaseAddress].Read <IntPtr>();
                    ItemDataPointer  = Memory[BaseAddress + ItemDataOffset, false];
                    CharacterPointer = Memory[BaseAddress + CharacterOffset, false];
                    ChallengePointer = Memory[BaseAddress + ChallengeOffset, false];
                    MiscPointer      = Memory[BaseAddress + MiscOffset, false];
                    ItemPointer      = Memory[BaseAddress + ItemOffset, false];
                    EquipPointer     = Memory[BaseAddress + EquipOffset, false];
                    ScoutPointer     = Memory[BaseAddress + ScoutOffset, false];

                    updateThread = new Thread(UpdateAddresses);
                    updateThread.Start();

                    for (int i = 0; i < MaxEquipItems; i++)
                    {
                        EquipItems[i] = new EquipItem();
                    }

                    Data.ParseItemData();
                    Data.ParseIDRanges();
                    Data.ParseParameters();
                    Data.ParseTraits();

                    // This is a stopgap fix to prevent some in-game CTDs and softlocks as reported by users in the tech forum
                    process.PriorityClass = ProcessPriorityClass.High;
                }
            }
            catch
            {
                MessageBox.Show($"Failed to attach to {GameName}!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(-1);
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());

            updateThread.Abort();
        }
예제 #11
0
파일: Poker.cs 프로젝트: krofty/H5Tweak
        private static Process getProcess()
        {
            Process proc = ApplicationFinder.FromProcessName("halo5forge").FirstOrDefault();

            Match match = versionRegex.Match(proc.MainModule.FileName);

            if (!match.Success)
            {
                throw new Exception("Unable to determine application version.");
            }

            String version = match.Groups[1].Value;

            if (version != EXPECTED_VERSION)
            {
                throw new Exception(String.Format("Wrong version. Expected={0}. Actual={1}.", EXPECTED_VERSION, version));
            }

            return(proc);
        }
예제 #12
0
 static Memory()
 {
     process = new MemorySharp(ApplicationFinder.FromProcessName("Wow").First());
 }