public void FindModulePtr(ProcessMemoryReader mReader) { string Movepattern = "f30f105b40488d5424304C8b4318488d0d"; string Mappattern2 = "f30f1043044c8d836cffffff0fb705"; SignatureScanner signatureScanner = new SignatureScanner(mReader); Actual_Base_Offset = (long)signatureScanner.ScanMovePtr(Movepattern)[0]; ZoneIDPtr = (long)signatureScanner.ScanPtrBySig(Mappattern2)[0]; if (Base_Offset != Actual_Base_Offset) { DialogResult dialogResult = MessageBox.Show("基址不一致,是否使用增强扫描?", "沙沙沙沙……时空狭缝不需要能量吗?", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { pModule = BitConverter.ToInt64(mReader.ReadByteArray((IntPtr)((long)mReader.process.Modules[0].BaseAddress + Actual_Base_Offset), 8u), 0); } else { pModule = BitConverter.ToInt64(mReader.ReadByteArray((IntPtr)((long)mReader.process.Modules[0].BaseAddress + Base_Offset), 8u), 0); } } else { pModule = BitConverter.ToInt64(mReader.ReadByteArray((IntPtr)((long)mReader.process.Modules[0].BaseAddress + Actual_Base_Offset), 8u), 0); } string FlyingSig = "40534883EC20488BD9488B89********4885C9741BF605********04751233D2E8********84C0488D05"; long F_Offset = (long)mReader.ScanPtrBySig(FlyingSig).FirstOrDefault(); pFlyModule = (long)mReader.process.Modules[0].BaseAddress + F_Offset; }
public void ReadCoord() { byte[] value = mReader.ReadByteArray((IntPtr)(pModule + Offset_X), 4); CurrentCoord.X = BitConverter.ToSingle(value, 0); value = mReader.ReadByteArray((IntPtr)(pModule + Offset_Y), 4); CurrentCoord.Y = BitConverter.ToSingle(value, 0); value = mReader.ReadByteArray((IntPtr)(pModule + Offset_Z), 4); CurrentCoord.Z = BitConverter.ToSingle(value, 0); value = mReader.ReadByteArray((IntPtr)(pModule + Offset_RAD), 4); CurrentCoord.RAD = BitConverter.ToSingle(value, 0); }
public void StartUpdate() { if (!Initialized) { Process p = Process.GetProcessesByName("ffxiv_dx11").ToList().FirstOrDefault(); mReader.process = p; mReader.OpenProcess(); pBaseAddress = mReader.process.MainModule.BaseAddress; pStartPoint = pBaseAddress; IntPtr pEndAddress = IntPtr.Add(pBaseAddress, mReader.process.MainModule.ModuleMemorySize); long ModuleSize = (long)pEndAddress - (long)pBaseAddress; ModuleCopy = mReader.ReadByteArray(pStartPoint, (uint)ModuleSize); pMobArray = SearchMobArrayOffset(); Update = new Thread(() => { while (true) { Thread.Sleep(100); if (Initialized) { combatants = GetCombatantList(new IntPtr(((long)pBaseAddress + (long)pMobArray))); } } }); Update.Start(); Initialized = true; } }
public List <IntPtr> ScanPtrBySig(string pattern = "") { byte?[] array = pattern2SigArray(pattern); List <IntPtr> list = new List <IntPtr>(); if (pattern == null || pattern.Length % 2 != 0) { return(new List <IntPtr>()); } ModuleCopy = mReader.ReadByteArray(pStartPoint, (uint)ModuleSize); for (int i = 0; i < ModuleCopy.Length - array.Length - 4 + 1; i++) { int Checking = 0; for (int j = 0; j < array.Length; j++) { if (!array[j].HasValue) { Checking++; continue; } if (array[j].Value != ModuleCopy[i + j]) { break; } Checking++; } if (Checking == array.Length) { IntPtr item = new IntPtr(BitConverter.ToInt32(ModuleCopy, i + array.Length)); long num3 = pStartPoint.ToInt64() + i + array.Length + 4 + item.ToInt64(); item = new IntPtr(num3 - (long)mReader.process.MainModule.BaseAddress); list.Add(item); } } return(list); }
public int ScanCoolDown(long CDptr) { int CD; bool Availability; if (CDptr != 0) { Availability = BitConverter.ToBoolean(mReader.ReadByteArray((IntPtr)(CDptr - 0x14), 4), 0); if (Availability) { CD = mReader.ReadInt32((IntPtr)(CDptr)); return(CD == -1 ? 0 : CD); } else { return(-1); } } else { return(-2); } }
public void FindModulePtr() { pModule = BitConverter.ToInt64(mReader.ReadByteArray((IntPtr)((long)mReader.process.Modules[0].BaseAddress + Base_Offset), 8), 0); }