private static void disableGravity() { if (gravBool) { playerDMA = GetDMA(); ProcessMemoryReaderLib.ProcessMemoryReader pReader = GetAoCProcess(); pReader.OpenProcess(); int writtenBytes; byte[] gravBuffer = { 0xD9, 0x5E, 0x48, 0x83 }; // write back proper instructions byte[] jumpBuffer = { 0x0f, 0x13, 0x46, 0x48 }; // Jump power instructions pReader.WriteProcessMemory((IntPtr)((int)gravDMA), gravBuffer, out writtenBytes); pReader.WriteProcessMemory((IntPtr)((int)jumpDMA), jumpBuffer, out writtenBytes); pReader.CloseHandle(); } else { playerDMA = GetDMA(); ProcessMemoryReaderLib.ProcessMemoryReader pReader = GetAoCProcess(); pReader.OpenProcess(); int writtenBytes; byte[] gravBuffer = { 0x90, 0x90, 0x90, 0x83 }; // nop = 0x90 byte[] jumpBuffer = { 0x90, 0x90, 0x90, 0x90 }; byte[] fallBuffer = new byte[4]; fallBuffer = BitConverter.GetBytes(0); //Set to 0 for true zero grav. pReader.WriteProcessMemory((IntPtr)((int)gravDMA), gravBuffer, out writtenBytes); pReader.WriteProcessMemory((IntPtr)((int)jumpDMA), jumpBuffer, out writtenBytes); pReader.WriteProcessMemory((IntPtr)((int)playerDMA + noGravOffset), fallBuffer, out writtenBytes); pReader.CloseHandle(); } gravBool = !gravBool; }
private static void setRunSpeed(float runSpeed) { playerDMA = GetDMA(); ProcessMemoryReaderLib.ProcessMemoryReader pReader = GetAoCProcess(); pReader.OpenProcess(); int writtenBytes; byte[] buffer = BitConverter.GetBytes(runSpeed); pReader.WriteProcessMemory((IntPtr)((int)playerDMA + runspeedOffset), buffer, out writtenBytes); pReader.CloseHandle(); }
private static void setZAxis(float zAxisDiff) { ProcessMemoryReaderLib.ProcessMemoryReader pReader = GetAoCProcess(); pReader.OpenProcess(); int writtenBytes, readBytes; byte[] axisBuffer = pReader.ReadProcessMemory((IntPtr)((int)playerDMA + zAxisOffset), 4, out readBytes); float zAxis = BitConverter.ToSingle(axisBuffer, 0); byte[] buffer = BitConverter.GetBytes(zAxis + zAxisDiff); pReader.WriteProcessMemory((IntPtr)((int)playerDMA + zAxisOffset), buffer, out writtenBytes); pReader.CloseHandle(); }
private static void noFallToggle(bool isChecked) { ProcessMemoryReaderLib.ProcessMemoryReader pReader = GetAoCProcess(); pReader.OpenProcess(); int writtenBytes; byte[] buffer = new byte[4]; if (isChecked) { buffer = BitConverter.GetBytes(0); } else { buffer = BitConverter.GetBytes(1); } pReader.WriteProcessMemory((IntPtr)((int)playerDMA + noFallOffset), buffer, out writtenBytes); pReader.CloseHandle(); }