void Decode_Click(object sender, RoutedEventArgs e) { bool error = false; if (optSym.IsChecked ?? true) { var path = PathBox.Text.Trim(' ', '"'); string shortPath = path; if (path.Length > 35) { shortPath = "..." + path.Substring(path.Length - 35, 35); } try { _messageDeobfuscator = MessageDeobfuscator.Load(path); status.Content = "Loaded symbol map from '" + shortPath + "' successfully."; } catch { status.Content = "Failed to load symbol map from '" + shortPath + "'."; error = true; } } else { _messageDeobfuscator = new MessageDeobfuscator(PassBox.Password); } if (!error) { stackTrace.Text = _messageDeobfuscator.Deobfuscate(stackTrace.Text); } }
public async Task MessageDeobfuscationWithPassword() { var expectedObfuscatedOutput = new[] { "Exception", " at oQmpV$y2k2b9P3d6GP1cxGPuRtKaNIZvZcKpZXSfKFG8.V1M$X52eDxP6ElgdFrRDlF0KSZU31AmQaiXXgzyoeJJ4KV64JBpi0Bh25Xdje$vCxw.fUHV$KyBiFTUH0$GNDHVx6XvtlZWHnzVgRO9N2M$jw5ysYWJWaUSMQYtPDT$wa$6MarZQoNxnbR_9cn$A2XXvRY(String )", " at EbUjRcrC76NnA7RJlhQffrfp$vMGHdDfqtVFtWrAOPyD.swzvaIVl3W8yDi8Ii3P1j_V9JC8eVu2JgvNNjeVDYc4bOHH37cCBf0_3URE_8UcWPQ()" }; string password = "******"; await Run( "MessageDeobfuscation.exe", expectedObfuscatedOutput, new SettingItem <Protection>("rename") { ["mode"] = "reversible", ["password"] = password }, "Password", postProcessAction : outputPath => { var messageDeobfuscator = new MessageDeobfuscator(password); var deobfuscated = messageDeobfuscator.Deobfuscate(string.Join(Environment.NewLine, expectedObfuscatedOutput)); Assert.Equal(_expectedDeobfuscatedOutput, deobfuscated); return(Task.Delay(0)); } ); }