private void BrowseForm_Load(object sender, EventArgs e) { var info = DetailsPropertyGrid.GetType().GetProperty("Controls"); var collection = info.GetValue(DetailsPropertyGrid, null) as Control.ControlCollection; foreach (var control in collection) { var ctyp = control.GetType(); if (ctyp.Name == "PropertyGridView") { var prop = ctyp.GetField("labelRatio"); var val = prop.GetValue(control); prop.SetValue(control, 4.0); //somehow this sets the width of the property grid's label column... } } FolderTextBox.Text = Settings.Default.GTAFolder; DataHexLineCombo.Text = "16"; DataTextBox.SetTabStopWidth(3); HideTexturesTab(); try { GTA5Keys.LoadFromPath(Settings.Default.GTAFolder); KeysLoaded = true; UpdateStatus("Ready to scan..."); } catch { UpdateStatus("Keys not loaded! This should not happen."); } }
private void BeginButton_Click(object sender, EventArgs e) { if (InProgress) { return; } if (KeysLoaded) { if (MessageBox.Show("Keys are already loaded. Do you wish to do the extraction anyway?", "Keys already loaded", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } } InProgress = true; AbortOperation = false; string exepath = ExeTextBox.Text; Task.Run(() => { try { if (AbortOperation) { UpdateStatus("Key extraction aborted."); return; } FileInfo dmpfi = new FileInfo(exepath); UpdateStatus(string.Format("Scanning {0} for keys...", dmpfi.Name)); byte[] exedat = File.ReadAllBytes(exepath); GTA5Keys.GenerateV2(exedat, UpdateStatus); UpdateStatus("Saving found keys..."); Settings.Default.Key = Convert.ToBase64String(GTA5Keys.PC_AES_KEY); Settings.Default.Save(); //GTA5Keys.SaveToPath(); UpdateStatus("Keys extracted successfully."); KeysLoaded = true; InProgress = false; } catch (Exception ex) { UpdateStatus("Error - " + ex.ToString()); InProgress = false; } }); }
private void FindKeysButton_Click(object sender, EventArgs e) { if (InProgress) { return; } if (KeysLoaded) { if (MessageBox.Show("Keys are already loaded. Do you wish to scan the exe dump anyway?", "Keys already loaded", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } } InProgress = true; AbortOperation = false; string dmppath = DumpTextBox.Text; Task.Run(() => { try { if (AbortOperation) { UpdateDumpStatus("Dump scan aborted."); return; } FileInfo dmpfi = new FileInfo(dmppath); UpdateDumpStatus(string.Format("Scanning {0} for keys...", dmpfi.Name)); byte[] exedat = File.ReadAllBytes(dmppath); GTA5Keys.Generate(exedat, UpdateDumpStatus); UpdateDumpStatus("Saving found keys..."); GTA5Keys.SaveToPath(); UpdateDumpStatus("Keys loaded."); UpdateExtractStatus("Keys loaded, ready to extract."); KeysLoaded = true; InProgress = false; } catch (Exception ex) { UpdateDumpStatus("Error - " + ex.ToString()); InProgress = false; } }); }
private void ExtractRawForm_Load(object sender, EventArgs e) { FolderTextBox.Text = GTAFolder.CurrentGTAFolder; OutputFolderTextBox.Text = Settings.Default.ExtractedRawFilesFolder; try { GTA5Keys.LoadFromPath(GTAFolder.CurrentGTAFolder, Settings.Default.Key); KeysLoaded = true; UpdateExtractStatus("Ready to extract."); } catch { UpdateExtractStatus("Keys not found! This shouldn't happen."); } }
private void ExtractKeysForm_Load(object sender, EventArgs e) { FolderTextBox.Text = GTAFolder.CurrentGTAFolder; try { GTA5Keys.LoadFromPath(GTAFolder.CurrentGTAFolder, Settings.Default.Key); KeysLoaded = true; UpdateStatus("Keys loaded. Nothing to do here!"); } catch { //default label text has this case //UpdateStatus("Keys not found! Please scan a GTA 5 exe..."); } }
private void ExtractForm_Load(object sender, EventArgs e) { DumpTextBox.Text = Settings.Default.GTAExeDumpFile; FolderTextBox.Text = GTAFolder.CurrentGTAFolder; OutputFolderTextBox.Text = Settings.Default.CompiledScriptFolder; try { GTA5Keys.LoadFromPath(GTAFolder.CurrentGTAFolder, Settings.Default.Key); KeysLoaded = true; UpdateDumpStatus("Ready."); UpdateExtractStatus("Ready to extract."); } catch { UpdateDumpStatus("Keys not found! This shouldn't happen."); } }
private void BinarySearchForm_Load(object sender, EventArgs e) { FileSearchFolderTextBox.Text = Settings.Default.CompiledScriptFolder; DataHexLineCombo.Text = "16"; DataTextBox.SetTabStopWidth(3); if (RpfMan == null) { Task.Run(() => { GTA5Keys.LoadFromPath(GTAFolder.CurrentGTAFolder, Settings.Default.Key); RpfMan = new RpfManager(); RpfMan.Init(GTAFolder.CurrentGTAFolder, UpdateStatus, UpdateStatus, false, false); RPFScanComplete(); }); } else { RPFScanComplete(); } }
public JenkIndForm(GameFileCache gameFileCache = null) { InitializeComponent(); if (GlobalText.FullIndexBuilt) { IndexBuildComplete(); } else { MainPanel.Enabled = false; Cursor = Cursors.WaitCursor; if ((gameFileCache == null) || (gameFileCache.IsInited == false)) { Task.Run(() => { GTA5Keys.LoadFromPath(GTAFolder.CurrentGTAFolder, Settings.Default.Key); GameFileCache gfc = GameFileCacheFactory.Create(); gfc.DoFullStringIndex = true; gfc.Init(UpdateStatus, UpdateStatus); IndexBuildComplete(); }); } else { Task.Run(() => { UpdateStatus("Loading strings..."); gameFileCache.DoFullStringIndex = true; gameFileCache.InitStringDicts(); IndexBuildComplete(); }); } } }
private void ContentThread() { //main content loading thread. running = true; UpdateStatus("Scanning..."); try { GTA5Keys.LoadFromPath(GTAFolder.CurrentGTAFolder, Settings.Default.Key); } catch { MessageBox.Show("Keys not found! This shouldn't happen."); Close(); return; } GameFileCache.EnableDlc = true; GameFileCache.EnableMods = true; GameFileCache.LoadPeds = false; GameFileCache.LoadVehicles = true; GameFileCache.LoadArchetypes = false; //to speed things up a little GameFileCache.BuildExtendedJenkIndex = false; //to speed things up a little GameFileCache.DoFullStringIndex = true; //to get all global text from DLC... GameFileCache.Init(UpdateStatus, LogError); //UpdateDlcListComboBox(gameFileCache.DlcNameList); //EnableCacheDependentUI(); UpdateGlobalVehiclesUI(); LoadWorld(); //initialised = true; //EnableDLCModsUI(); //UpdateStatus("Ready"); Task.Run(() => { while (formopen && !IsDisposed) //renderer content loop { bool rcItemsPending = Renderer.ContentThreadProc(); if (!rcItemsPending) { Thread.Sleep(1); //sleep if there's nothing to do } } }); while (formopen && !IsDisposed) //main asset loop { bool fcItemsPending = GameFileCache.ContentThreadProc(); if (!fcItemsPending) { Thread.Sleep(1); //sleep if there's nothing to do } } GameFileCache.Clear(); running = false; }