private void MainForm_Load(object sender, EventArgs e) { LogFile.WriteToLog("------------- Started DarkLoader -------------"); GoogleAnalyticsApi.TrackPageview("MainForm.cs", "MainForm_Load", ""); txtHaloLaunchArguments.Text = Properties.Settings.Default.HOLaunchArguments; Thread loadPatches = new Thread(MagicPatches.LoadPatches); loadPatches.Start(); WeRunningYup = true; //Set Default Game Mode combo boxes to comboGameModes.SelectedIndex = 2; comboGameTypes.SelectedIndex = 0; //Are we running the new halo_online.exe build? If so, set the exe name accordingly. if (File.Exists(Application.StartupPath + @"\halo_online.exe")) { HaloOnlineEXE = "halo_online"; } //Let's load the maps up and pull out their info string HaloMapDir = Application.StartupPath + @"\maps\"; DirectoryInfo d = new DirectoryInfo(HaloMapDir); foreach (var file in d.GetFiles("*.map")) { byte[] MapHeader = new byte[756]; byte[] BuildVersion = new byte[32]; //0.4.1.327043 cert_MS26_new byte[] MapName = new byte[36]; byte[] MapTagDir = new byte[256]; using (BinaryReader reader = new BinaryReader(new FileStream(HaloMapDir + file.Name, FileMode.Open, FileAccess.Read))) { reader.BaseStream.Seek(0, SeekOrigin.Begin); reader.Read(MapHeader, 0, 756); int MapTagDirOffset = HelperFunctions.SearchBytes(MapHeader, Encoding.ASCII.GetBytes("level")); reader.BaseStream.Seek(284, SeekOrigin.Begin); reader.Read(BuildVersion, 0, 32); reader.BaseStream.Seek(MapTagDirOffset - 36, SeekOrigin.Begin); reader.Read(MapName, 0, 36); reader.BaseStream.Seek(MapTagDirOffset, SeekOrigin.Begin); reader.Read(MapTagDir, 0, 256); } listMapNames.Items.Add(System.Text.Encoding.UTF8.GetString(MapName).Replace("\0", "")); listMapInfo.Items.Add(System.Text.Encoding.UTF8.GetString(BuildVersion).Replace("\0", "") + " " + System.Text.Encoding.UTF8.GetString(MapTagDir).Replace("\0", "")); } //Let's keep an eye out for Halo starting and stopping. Thread haloWatcher = new Thread(IsHaloRunning); haloWatcher.Start(); //Let's keep an eye out for frost so we can kill it and hijack the session tokens Thread frostWatcher = new Thread(FrostWatcher); frostWatcher.Start(); //Let's make sure people are running the greatest latest turd available if (!Program.IsDebug) { Thread checkUpdates = new Thread(CheckForUpdates); checkUpdates.Start(); } }
private void btnFillX_Click(object sender, EventArgs e) { GoogleAnalyticsApi.TrackEvent("PatchEditor.cs", "btnFillX_Click", ""); byte[] searchBytePattern = HelperFunctions.StringToByteArray(txtPatternBytesSearch.Text); txtPatternMatch.Text = HelperFunctions.Repeat("x", searchBytePattern.Length); }