Exemplo n.º 1
0
        /// <summary>
        ///     暂存当前标点
        /// </summary>
        public void SaveWaymark()
        {
            tempMarks = new WayMarks();

            Waymark ReadWaymark(IntPtr addr, WaymarkID id) => new Waymark
            {
                X      = Memory.Read <float>(addr),
                Y      = Memory.Read <float>(addr + 0x4),
                Z      = Memory.Read <float>(addr + 0x8),
                Active = Memory.Read <byte>(addr + 0x1C) == 1,
                ID     = id
            };

            try
            {
                tempMarks.A     = ReadWaymark(Offsets.Waymarks + 0x00, WaymarkID.A);
                tempMarks.B     = ReadWaymark(Offsets.Waymarks + 0x20, WaymarkID.B);
                tempMarks.C     = ReadWaymark(Offsets.Waymarks + 0x40, WaymarkID.C);
                tempMarks.D     = ReadWaymark(Offsets.Waymarks + 0x60, WaymarkID.D);
                tempMarks.One   = ReadWaymark(Offsets.Waymarks + 0x80, WaymarkID.One);
                tempMarks.Two   = ReadWaymark(Offsets.Waymarks + 0xA0, WaymarkID.Two);
                tempMarks.Three = ReadWaymark(Offsets.Waymarks + 0xC0, WaymarkID.Three);
                tempMarks.Four  = ReadWaymark(Offsets.Waymarks + 0xE0, WaymarkID.Four);
                PluginUI.Log("暂存当前标点");
            }
            catch (Exception ex)
            {
                PluginUI.Log("保存标记错误:" + ex.Message);
            }
        }
Exemplo n.º 2
0
        public static Task GetWorldPtr()
        {
            process = new ProcessSharp(Utilities.BaseProc(), MemoryType.Remote);
            mem     = new ExternalProcessMemory(process.Handle);

            //WorldPtr
            IntPtr addr = Find(process.ModuleFactory.MainModule.Name, MemoryReader.WorldPTR, process).ReadAddress;

            addr = addr + mem.Read <int>(addr + 3) + 7;
            IntPtr WorldPtr = mem.Read <IntPtr>(addr);

            Addresses.WorldPtr = WorldPtr;

            return(Task.CompletedTask);
        }
Exemplo n.º 3
0
        private void initMemory()
        {
            System.Diagnostics.Process dbfz = System.Diagnostics.Process.GetProcessesByName("RED-Win64-Shipping")[0];
            var dbfzproc = new ProcessSharp(dbfz);

            dbfzmem = new ExternalProcessMemory(dbfzproc.Handle);
            var baseaddress = dbfzproc.ModuleFactory.MainModule.BaseAddress;

            framecounter = IntPtr.Add(baseaddress, 0x35EAB48);
            var recordingptr = (IntPtr)dbfzmem.Read <int>(IntPtr.Add(baseaddress, 0x3817BD8));

            recordingStart = IntPtr.Add(recordingptr, 0x718);
            inputbuffer    = IntPtr.Add(baseaddress, 0x35EAC08);
        }
Exemplo n.º 4
0
        public static long GetPlayerModel()
        {
            bool b2189 = Utilities.BaseProc().ProcessName.Contains("b2189");

            //LocalPlayer
            IntPtr LocalPlayer = mem.Read <IntPtr>(Addresses.WorldPtr + 0x8);

            Addresses.LocalPlayer = LocalPlayer;

            //PlayerModel
            IntPtr v1          = mem.Read <IntPtr>(Addresses.LocalPlayer + 0x50);
            IntPtr v2          = b2189 ? mem.Read <IntPtr>(v1 + 0x20) : mem.Read <IntPtr>(v1 + 0x40);
            IntPtr v3          = b2189 ? mem.Read <IntPtr>(v2 + 0x0) : mem.Read <IntPtr>(v2 + 0x8);
            IntPtr v4          = mem.Read <IntPtr>(v3 + 0x20);
            IntPtr PlayerModel = v4 + 0x18;

            Addresses.PlayerModel = PlayerModel;
            return(mem.Read <long>(Addresses.PlayerModel));
        }
Exemplo n.º 5
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (button1.Text.StartsWith("Enable"))
     {
         tok = cts.Token;
         Task mainLoop  = new Task(() => detectPlayback());
         var  reclength = dbfzmem.Read <int>(IntPtr.Add(recordingStart, 4));
         recording = new short[reclength];
         for (var i = 0; i < reclength; i++)
         {
             recording[i] = dbfzmem.Read <short>(IntPtr.Add(recordingStart, 8 + 2 * i));
         }
         mainLoop.Start();
         button1.Text = "Disable Audio Cues";
     }
     else
     {
         cts.Cancel();
         cts          = new CancellationTokenSource();
         button1.Text = "Enable Audio Cues";
     }
 }