コード例 #1
0
        private void FrezeHealthToggle()
        {
            if (!freezeHealthEnabled)
            {
                SoundPlayer snd = new SoundPlayer(Properties.Resources.f_on);
                snd.Play();

                if (inj == null)
                {
                    byte[] injCode = codeInjection.stringBytesToArray("66 81 3E 70 07 0F 85 12 00 00 00 C7 86 84 00 00 00 00 00 16 44 DD D8 D9 86 84 00 00 00 D9 9E 84 00 00 00");
                    inj = new codeInjection(myProcess[0], (uint)gCoreModule + 0x14aef4, 6, injCode);
                    System.Threading.Thread.Sleep(100);
                    Debug.WriteLine("Injected status: " + inj.result + " adress: 0x" + inj.getAllocationAddress().ToString("X4"));
                }
                else
                {
                    inj.updateJmpInstructions((uint)gCoreModule + 0x14aef4, 6);
                    inj.EnableHook();
                }
                freezeHealthEnabled = true;
            }
            else
            {
                SoundPlayer snd = new SoundPlayer(Properties.Resources.f_off);
                snd.Play();
                freezeHealthEnabled = false;
                inj.DisableHook();
            }
        }
コード例 #2
0
        private void Timer_Tick(object sender, EventArgs e)
        {
            try
            {
                myProcess = Process.GetProcessesByName(processName);
                if (myProcess.Length > 0)
                {
                    if (foundProcess == false || baseAddress == 0x0 || gCoreModule == 0x0 || gCoreRequiresRefresh)
                    {
                        TTimer.Interval = 1000;
                        IntPtr startOffset = myProcess[0].MainModule.BaseAddress;
                        IntPtr endOffset   = IntPtr.Add(startOffset, myProcess[0].MainModule.ModuleMemorySize);
                        baseAddress = startOffset.ToInt32();
                        foreach (ProcessModule module in myProcess[0].Modules)
                        {
                            if (module.ModuleName.ToLower() == "GCore.dll".ToLower())
                            {
                                gCoreModule = module.BaseAddress.ToInt32();
                            }
                        }
                        if (gCoreModule != 0x0)
                        {
                            gCoreRequiresRefresh = false;
                        }
                        Debug.WriteLine("Trying to get baseAddresses");
                    }

                    foundProcess = true;
                }
                else
                {
                    foundProcess        = false;
                    inj                 = null;
                    freezeHealthEnabled = false;
                }


                if (foundProcess)
                {
                    // The game is running, ready for memory reading.
                    LB_Running.Text      = "IJET is running";
                    LB_Running.ForeColor = Color.Green;

                    readCoordX   = Trainer.ReadPointerFloat(myProcess, gCoreModule + adressCoord, offsetX);
                    L_X.Text     = readCoordX.ToString();
                    readCoordY   = Trainer.ReadPointerFloat(myProcess, gCoreModule + adressCoord, offsetY);
                    L_Y.Text     = readCoordY.ToString();
                    readCoordZ   = Trainer.ReadPointerFloat(myProcess, gCoreModule + adressCoord, offsetZ);
                    L_Z.Text     = readCoordZ.ToString();
                    readSinAlpha = Trainer.ReadPointerFloat(myProcess, gCoreModule + adressCoord, offsetSinAlpha);
                    readCosAlpha = -Trainer.ReadPointerFloat(myProcess, gCoreModule + adressCoord, offsetCosAlpha); //this one we invert to negative value
                    drawVectorDisplay();
                    vectorDisplay.Image = bitmap;

                    if (readCoordX == 0.0f && readCoordY == 0.0f && readCoordZ == 0.0f)
                    {
                        gCoreRequiresRefresh = true;
                        Debug.WriteLine("Requested module refresh");
                    }
                    else
                    {
                        InitHotkey();
                        TTimer.Interval = 100;
                    }
                }
                else
                {
                    // The game process has not been found, reseting values.
                    LB_Running.Text      = "IJET is not running";
                    LB_Running.ForeColor = Color.Red;
                    ResetValues();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
            }
        }