public GeneralReportWindow(TargetPE pe) { if (pe == null) { throw new ArgumentNullException(); } _pe = pe; InitializeComponent(); string cryptoType = _pe.CryptoPatches.CryptoType == CryptoType.XOR ? "XOR Cipher" : "DES + XOR Cipher"; generalInfo = new Dictionary <string, string> { { "Patches Count", $"{_pe.CryptoPatches.Count}" }, { "Target Executable", $"{_pe.FilePath}" }, { "Client Internal Version", $"{_pe.ClientVersion}" }, { "Linker Version", $"MSVC-{_pe.MajorLinkerVersion}.0 (Microsoft Visual C++)" }, { "Inlined Functions Count", $"{_pe.CryptoPatches.Count(p => p.Inlined)}" }, { "Encryption Algorithm", cryptoType } }; Text = $" v{_pe.ClientVersion} Client {Text} (ko4life.net - v{Application.ProductVersion})"; }
public MainWindow() { InitializeComponent(); _targetFile = null; _previousKeys = null; Text += $" v{Application.ProductVersion}"; }
public ViewOffsetsWindow(TargetPE pe) { if (pe == null) { throw new ArgumentNullException(); } _pe = pe; InitializeComponent(); }
private void LoadPE(string filePath) { Log.Info($"Loading PE file {filePath}"); panelDragArea.BackColor = SystemColors.Control; void failed(string message, string title) { Log.Error(message); DisableControls(); MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Error); lblStatus.Text = "Waiting for user action."; tbxKey1.Text = tbxKey2.Text = tbxKey3.Text = "0xFFFF"; } _targetFile = new TargetPE(filePath); if (!_targetFile.IsValid) { failed("Invalid File Path or Extension.", "Invalid File"); return; } var result = _targetFile.Initialize(cbxSkipKOValidation.Checked, cbxSkipClientVersion.Checked); if (result != null) { failed("Failed to initialize target executable. Reason:\n" + result.Reason, "Invalid File"); return; } Log.Info("File successfully loaded and initialized keys."); tbxKey1.Text = tbxKey2.Text = tbxKey3.Text = "0x"; var samplePatch = _targetFile.CryptoPatches.Find(p => !p.Inlined); tbxKey1.Text += samplePatch[0].Key.ToString("X4"); tbxKey2.Text += samplePatch[1].Key.ToString("X4"); tbxKey3.Text += samplePatch[2].Key.ToString("X4"); Log.Info("Caching loaded crypto keys: " + samplePatch.GetKeysFormatted()); _previousKeys = new short[CryptoPatch.KEYS_COUNT]; for (int i = 0; i < CryptoPatch.KEYS_COUNT; i++) { _previousKeys[i] = (short)samplePatch.Keys[i].Key; } tbxKey2.Enabled = _targetFile.CanUpdateKey2; lblStatus.Text = $"[v{_targetFile.ClientVersion}]: Loaded: {filePath}"; EnableControls(); // DES encryption won't be supported for batch updating client tbls. btnUpdateData.Enabled = _targetFile.CryptoPatches.CryptoType == CryptoType.XOR; }