private static void DisableFog(
            Process process,
            int fogAddress,
            int float512Address,
            int mapSkyDistanceAddress)
        {
            IntPtr num = FogRemover.OpenProcess(56, false, process.Id);

            try
            {
                FogRemover.CheckToggleMemory(fogAddress, FogRemover.jmpFog, FogRemover.nope6, num);
                FogRemover.CheckToggleMemory(float512Address, FogRemover.codeF512, FogRemover.float512, num);
                FogRemover.CheckToggleMemory(mapSkyDistanceAddress, FogRemover.jmpMapSkyDistance, FogRemover.nope6, num);
            }
            finally
            {
                FogRemover.CloseHandle(num);
            }
        }
        private static bool CheckToggleMemory(
            int addr,
            byte[] checkVal,
            byte[] setVal,
            IntPtr pHandle)
        {
            byte[] lpBuffer = new byte[checkVal.Length];
            int    lpNumberOfBytesRead;

            if (!FogRemover.ReadProcessMemory(pHandle, addr, lpBuffer, lpBuffer.Length, out lpNumberOfBytesRead) || lpNumberOfBytesRead != lpBuffer.Length || !((IEnumerable <byte>)lpBuffer).SequenceEqual <byte>((IEnumerable <byte>)checkVal))
            {
                return(false);
            }
            int lpflOldProtect;

            FogRemover.VirtualProtectEx(pHandle, addr, setVal.Length, 64, out lpflOldProtect);
            int num1;
            int num2 = FogRemover.WriteProcessMemory(pHandle, addr, setVal, setVal.Length, out num1) ? 1 : 0;

            FogRemover.VirtualProtectEx(pHandle, addr, setVal.Length, lpflOldProtect, out num1);
            return(num2 != 0);
        }
 public static void DisableFog(Process process)
 {
     FogRemover.DisableFog(process, 7624048, 8796952, 7631050);
     FogRemover.DisableFog(process, 8553200, 11490504, 8561466);
 }