protected void Application_Start() { TimerCheck timer = new TimerCheck(); timer.TimerStart(); Database.SetInitializer(new SportSeeder()); //Database.SetInitializer(new DropCreateDatabaseIfModelChaes<MatchDBContext>()); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); try { SqlDependency.Start(con); } catch { } }
//##################################################################################################################### #endregion public MainForm() { InitializeComponent(); #if ESL this.Text = "ESL Ghosts FoV Changer"; #endif // string updtmess = HttpUtility.HtmlEncode(Regex.Escape("This is a test message\nhello\n123")); // MessageBox.Show(updtmess); // Clipboard.SetText(updtmess); ////this.numFoV.Maximum = Convert.ToDecimal(DefaultGameMode.c_FoV_upperLimit); //new decimal(new int[] { c_FoV_upperLimit, 0, 0, 0 }); ////this.numFoV.Minimum = Convert.ToDecimal(DefaultGameMode.c_FoV_lowerLimit); //new decimal(new int[] { c_FoV_lowerLimit, 0, 0, 0 }); //MessageBox.Show(pFoV.ToString("x8")); ////if (File.Exists(settingsFile)) ReadSettings(); ////lblVersion.Text = "v" + c_toolVer; ////lblVersion.Visible = true; saveSettings = false; ReadGameMode(); saveSettings = true; ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule; objKeyboardProcess = new LowLevelKeyboardProc(captureKey); ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0); ////IsGameInstalled(); //MessageBox.Show(Path.GetTempPath()); //if (gameFound) //{ /*string dirName = Path.Combine(Path.GetTempPath(), "MW3_fov_lib"); * if (!Directory.Exists(dirName)) * Directory.CreateDirectory(dirName); * string dllPath = Path.Combine(dirName, "MW3_fov_lib.dll"); * * using (Stream stm = Assembly.GetExecutingAssembly().GetManifestResourceStream(Assembly.GetExecutingAssembly().GetName().Name + ".Resources.MW3_fov_lib.dll")) * { * try * { * using (Stream outFile = File.Create(dllPath)) * { * const int sz = 4096; * byte[] buf = new byte[sz]; * while (true) * { * int nRead = stm.Read(buf, 0, sz); * if (nRead < 1) * break; * outFile.Write(buf, 0, nRead); * } * } * } * catch { } * } * * if (!debug) * { * IntPtr h = LoadLibrary(dllPath); * if (h == IntPtr.Zero) * { * MessageBox.Show("Unable to load library " + dllPath, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); * Application.Exit(); * } * }*/ ////numFoV.Value = Convert.ToDecimal(fFoV); ////numFoV.Enabled = true; ////ToggleButton(!isRunning(false)); TimerCheck.Start(); //} }
private void TimerVerif_Tick(object sender, EventArgs e) { if (proc != null && mem != null && isRunning(false)) { if (btnStartGame.Enabled) { ToggleButton(false); } proc.Refresh(); try { if (proc.PagedMemorySize64 > 0x2000000) { byte step = 0; try { mem.FindFoVOffset(ref pFoV, ref step); if (!isOffsetWrong(pFoV)) { progStart(); } else if (proc.PagedMemorySize64 > (dword_ptr)gameMode.GetValue("c_memSearchRange")) { TimerVerif.Stop(); TimerCheck.Stop(); //bool offsetFound = false; //int ptrSize = IntPtr.Size * 4; /*for (int i = -0x50000; i < 0x50000 && !offsetFound; i += 16) * { * if (mem.ReadFloat(true, pFoV + i) == 65f && !isOffsetWrong(pFoV + i)) * { * pFoV += i; * offsetFound = true; * } * * if (i % 50000 == 0) * { * label1.Text = i.ToString(); * Update(); * } * }*/ //Console.Beep(5000, 100); //MessageBox.Show("find " + pFoV.ToString("X8")); if (isRunning(false) && !mem.FindFoVOffset(ref pFoV, ref step)) { string memory = BitConverter.ToString(BitConverter.GetBytes(mem.ReadFloat(pFoV))); MessageBox.Show(this, "The memory research pattern wasn't able to find the FoV offset in your " + gameMode.GetValue("c_supportMessage") + ".\n" + "Please look for an updated version of this FoV Changer tool.\n\n" + "If you believe this might be a bug, please send me an email at [email protected], and include a screenshot of this:\n" + "\n" + c_toolVer + "\nWorking Set: 0x" + proc.WorkingSet64.ToString("X8") + "\nPaged Memory: 0x" + proc.PagedMemorySize64.ToString("X8") + "\nVirtual Memory: 0x" + proc.VirtualMemorySize64.ToString("X8") + "\nStep: " + step.ToString() + "\nFoV pointer: 0x" + (pFoV - c_pOffset).ToString("X8") + " = " + memory, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); pFoV = (dword_ptr)gameMode.GetValue("c_pFoV"); Application.Exit(); } else { //Console.Beep(5000, 100); SaveSettings(); proc = null; TimerCheck.Start(); } } } catch (Exception ex) { ErrMessage(ex); Application.Exit(); } } } catch (InvalidOperationException) { } } }
/*int[] pSnipersFoV = {0x24180C48, // Barrett * 0x24189A10, // L118 * 0x2417BF54, // Dragunov * 0x2417E284, // AS50 * 0x24179530, // RSASS * 0x24181B20}; // MSR * * float[] fSnipersFoV = {15, // Barrett * 15, // L118 * 15, // Dragunov * 30, // AS50 * 15, // RSASS * 15}; // MSR*/ #endregion public MainForm() { InitializeComponent(); this.numFoV.Maximum = new decimal(new int[] { c_FoV_upperLimit, 0, 0, 0 }); this.numFoV.Minimum = new decimal(new int[] { c_FoV_lowerLimit, 0, 0, 0 }); //MessageBox.Show(pFoV.ToString("x8")); if (File.Exists(settingsFile)) { ReadData(); } lblVersion.Text = "v" + c_toolVer; lblVersion.Visible = true; ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule; objKeyboardProcess = new LowLevelKeyboardProc(captureKey); ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0); string tryPath = Path.Combine(ProgramFilesx86(), @"Steam\" + c_exeDirectory + @"\" + c_exe + ".exe"); TryPath(tryPath); if (!gameFound) { object steamPath = Registry.CurrentUser.OpenSubKey(@"Software\Valve\Steam").GetValue("SteamPath"); if (steamPath != null && !String.IsNullOrEmpty(steamPath.ToString())) { tryPath = Path.Combine(steamPath.ToString(), c_exeDirectory + @"\" + c_exe + ".exe"); TryPath(tryPath); } } //MessageBox.Show(Path.GetTempPath()); //if (gameFound) //{ /*string dirName = Path.Combine(Path.GetTempPath(), "MW3_fov_lib"); * if (!Directory.Exists(dirName)) * Directory.CreateDirectory(dirName); * string dllPath = Path.Combine(dirName, "MW3_fov_lib.dll"); * * using (Stream stm = Assembly.GetExecutingAssembly().GetManifestResourceStream(c_projName + ".Resources.MW3_fov_lib.dll")) * { * try * { * using (Stream outFile = File.Create(dllPath)) * { * const int sz = 4096; * byte[] buf = new byte[sz]; * while (true) * { * int nRead = stm.Read(buf, 0, sz); * if (nRead < 1) * break; * outFile.Write(buf, 0, nRead); * } * } * } * catch { } * } * * if (!debug) * { * IntPtr h = LoadLibrary(dllPath); * if (h == IntPtr.Zero) * { * MessageBox.Show("Unable to load library " + dllPath, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); * Application.Exit(); * } * }*/ numFoV.Value = (decimal)fFoV; numFoV.Enabled = true; ToggleButton(!isRunning(false)); TimerCheck.Start(); //} }