1
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-12-12 05:41:21 +04:00

Improve decompiler output and reduce verbosity

This commit is contained in:
bird_egop
2025-04-18 21:42:25 +03:00
parent c7fd962d90
commit 883f3a2659
3 changed files with 375 additions and 63 deletions

View File

@@ -81,20 +81,34 @@ public class Program
// Console.WriteLine(linearInstructions[i]);
// }
//
// // Print a summary of how many more instructions there are
// if (linearInstructions.Count > linearCount)
// {
// Console.WriteLine($"... ({linearInstructions.Count - linearCount} more instructions not shown)");
// }
// disassemble entry point
var disassembler = new BlockDisassembler(codeBytes, section.VirtualAddress);
var asmFunction = disassembler.DisassembleFromAddress(peFile.OptionalHeader.AddressOfEntryPoint);
Console.WriteLine(asmFunction);
_ = 5;
// Run all analyzers on the function
asmFunction.Analyze();
// Create a decompiler engine
var decompiler = new DecompilerEngine(peFile);
try
{
// Decompile the entry point function
var function = decompiler.DecompileFunction(peFile.OptionalHeader.AddressOfEntryPoint);
// Generate pseudocode
string pseudocode = decompiler.GeneratePseudocode(function);
Console.WriteLine("\nGenerated Pseudocode:\n");
Console.WriteLine(pseudocode);
}
catch (Exception ex)
{
Console.WriteLine($"Error decompiling function: {ex.Message}");
}
// Skip displaying detailed loop information to keep output concise
}
// Console.WriteLine("\nPress Enter to exit...");