Example #1
0
        public static void StartSkipFERace()
        {
            int v1; // eax
            int v2; // ecx


            //MWDBG.writeMem((IntPtr)0x904FC4 = LODWORD(SkipFEDifficulty);
            MWDBG.writeMem <int>((IntPtr)0x904FD8, MWDBG.readMem <int>(Info.SkipFE.NumLaps));
            MWDBG.writeMem <int>((IntPtr)0x904FB8, MWDBG.readMem <int>(Info.SkipFE.TrackNumber));
            MWDBG.writeMem <int>((IntPtr)0x905008, MWDBG.readMem <int>(Info.SkipFE.MaxCops));
            MWDBG.writeMem <int>((IntPtr)0x904FCC, 1);//RaceType
            MWDBG.writeMem <int>((IntPtr)0x904FDC, MWDBG.readMem <int>(Info.SkipFE.NumPlayerCars));
            MWDBG.writeMem <int>((IntPtr)0x904FE0, MWDBG.readMem <int>(Info.SkipFE.NumAICars));
            MWDBG.writeMem <byte>((IntPtr)0x904FED, (byte)(MWDBG.readMem <int>(Info.SkipFE.NumAICars) + 2));
            MWDBG.writeMem <byte>((IntPtr)0x904FEC, (byte)(MWDBG.readMem <int>(Info.SkipFE.NumAICars) + 1));

            MWDBG.writeMem <int>((IntPtr)0x90501C, 1065353216);
            MWDBG.writeMem <int>((IntPtr)0x905020, 1065353216);
            MWDBG.writeMem <int>((IntPtr)0x905030, 0);
            MWDBG.m[(IntPtr)0x56C5B0 - 0x400000].Execute();

            /*dword_ = SkipFEMaxCops;
             * dword_904FBC = SkipFETrackDirection;
             * dword_ = SkipFERaceType;
             * dword_904FD0 = dword_92609C;
             * dword_905014 = SkipFEDifficulty_0;
             * dword_90500C = SkipFEDifficulty_0;
             * dword_ = SkipFENumPlayerCars;
             * dword_ = SkipFENumAICars;
             * byte_ = SkipFENumAICars + 2;
             * byte_904FEE = dword_8F86D0 != 0;
             * byte_[0] = SkipFENumAICars + 1;*/
        }
Example #2
0
        public static int SetPlayerCar(string carName)
        {
            int ecx    = MWDBG.readMem <int>((IntPtr)0x9B08F8);
            int result = MWDBG.m[(IntPtr)0x755340, false].Execute <int>(CallingConventions.Thiscall, ecx, carName);

            return(result);
        }
Example #3
0
        public static GameCord GetCurrentCords(int offset)
        {
            GameCord c = new GameCord();

            c.x  = MWDBG.readMem <float>(Info.Object.X + MWDBG.GetOffsetId(offset));
            c.y  = MWDBG.readMem <float>(Info.Object.Y + MWDBG.GetOffsetId(offset));
            c.z  = MWDBG.readMem <float>(Info.Object.Z + MWDBG.GetOffsetId(offset));
            c.r1 = MWDBG.readMem <float>(Info.Object.RotX + MWDBG.GetOffsetId(offset));
            c.r2 = MWDBG.readMem <float>(Info.Object.RotY + MWDBG.GetOffsetId(offset));
            c.r3 = MWDBG.readMem <float>(Info.Object.RotZ + MWDBG.GetOffsetId(offset));
            c.r4 = MWDBG.readMem <float>(Info.Object.RotW + MWDBG.GetOffsetId(offset));
            return(c);
        }
Example #4
0
 public static void SkipFE_Load()
 {
     if (MWDBG.readMem <int>(Info.GameState) != 3)
     {
         MWDBG.m[(IntPtr)0x6052B0 - 0x400000].Execute();
         while (MWDBG.readMem <int>(Info.GameState) != 3)
         {
             Thread.Sleep(20);
         }
     }
     MWDBG.writeMem <int>(Info.SkipFE.Enabled, 1);
     MWDBG.m[(IntPtr)0x56C5B0 - 0x400000].Execute();
 }
Example #5
0
        private void CallFEBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((bool)fngCallActivate.IsChecked)
            {
                MWDBG.m.Windows.MainWindow.Activate();
            }
            MWDBG.m.Assembly.Inject("nop", (IntPtr)0x005C50B1);
            MWDBG.m.Assembly.Inject("nop", (IntPtr)0x005C50B2);
            MWDBG.m.Assembly.Inject("nop", (IntPtr)0x005C50B3);

            //MWDBG.m.Assembly.Inject("xor al, al", (IntPtr)0x0057DBB0);
            //MWDBG.m.Assembly.Inject("ret", (IntPtr)0x0057DBB1);

            CallFngResult.Text = "";
            Int32 cfeng = MWDBG.readMem <Int32>((IntPtr)0x91CADC);

            if ((bool)asMessage.IsChecked)
            {
                Int32 callResult = MWDBG.m[(IntPtr)0x516BE0, false].Execute <Int32>(Binarysharp.MemoryManagement.Assembly.CallingConvention.CallingConventions.Thiscall, cfeng, 0, FngNameBox.Text, -4, 255);
                CallFngResult.Text += "FNG Msg: " + callResult;
            }
            else
            {
                if ((bool)switchPackage.IsChecked)
                {
                    Int32 callResult = MWDBG.m[(IntPtr)0x525940, false].Execute <Int32>(Binarysharp.MemoryManagement.Assembly.CallingConvention.CallingConventions.Thiscall, cfeng, FngNameBox.Text, (Int32)0, (uint)0, 0);
                    CallFngResult.Text += "FNG Call 1: " + callResult;
                }
                else if ((bool)noControlP.IsChecked)
                {
                    Int32 callResult = MWDBG.m[(IntPtr)0x516990, false].Execute <Int32>(Binarysharp.MemoryManagement.Assembly.CallingConvention.CallingConventions.Thiscall, cfeng, FngNameBox.Text, 0x64);
                    CallFngResult.Text += "FNG Call 2: " + callResult;
                }
                else if ((bool)unkFnk.IsChecked)
                {
                    Int32 callResult = MWDBG.m[(IntPtr)0x5257F0, false].Execute <Int32>(Binarysharp.MemoryManagement.Assembly.CallingConvention.CallingConventions.Thiscall, cfeng, FngNameBox.Text, 0, 0, 0);
                    CallFngResult.Text += "FNG Call 3: " + callResult;
                }
            }
        }
        public static void SpawnCar(uint CarHash, Vector3 position, Vector3 rotation, uint driverClass = 3, uint customization = 0, uint AIRelated = 0, uint importanceRelated = 2)
        {
            //0x06465EB2 - hash
            IntPtr posV      = Vector3c.Allocate(position);
            IntPtr rotV      = Vector3c.Allocate(rotation);
            IntPtr vehParams = AllocateVehicleParams(CarHash, posV, rotV, driverClass, customization, AIRelated, importanceRelated);

            MWDBG.mWnd.AppendLog("Position = 0x" + posV.ToString("X4"));
            MWDBG.mWnd.AppendLog("Rotation = 0x" + rotV.ToString("X4"));
            MWDBG.mWnd.AppendLog("vehParams = 0x" + vehParams.ToString("X4"));
            MWDBG.mWnd.AppendLog("    ");
            MWDBG.mWnd.AppendLog("rot[0] from mem: " + MWDBG.readMem <float>(rotV));
            MWDBG.mWnd.AppendLog("rot[1] from mem: " + MWDBG.readMem <float>(rotV + 4));
            MWDBG.mWnd.AppendLog("rot[2] from mem: " + MWDBG.readMem <float>(rotV + 4 + 4));
            MWDBG.mWnd.AppendLog("    ");
            MWDBG.mWnd.AppendLog("mem vehP[0]: 0x" + MWDBG.readMem <uint>(vehParams).ToString("X4"));
            MWDBG.mWnd.AppendLog("mem vehP[1]: 0x" + MWDBG.readMem <uint>(vehParams + 4).ToString("X4"));
            MWDBG.mWnd.AppendLog("mem vehP[2]: 0x" + MWDBG.readMem <uint>(vehParams + 4 + 4).ToString("X4"));
            MWDBG.mWnd.AppendLog("mem vehP[3]: 0x" + MWDBG.readMem <uint>(vehParams + 4 + 4 + 4).ToString("X4"));
            MWDBG.mWnd.AppendLog("mem vehP[4]: 0x" + MWDBG.readMem <uint>(vehParams + 4 + 4 + 4 + 4).ToString("X4"));

            //MWDBG.m[(IntPtr)0x689820, false].Execute(Binarysharp.MemoryManagement.Assembly.CallingConvention.CallingConventions.Cdecl, vehParams, 0x0A6B47FAC);
        }
Example #7
0
 public static float Get(MemorySharp m)
 {
     return(MWDBG.readMem <float>(Info.GameSpeed));
 }