public void decompileMainModule() { string sourceCodeFile = DI.config.TempFileNameInTempDirectory + ".cs"; string testExe = new CreateTestExe().createBasicHelloWorldExe().save(); Assert.IsTrue(File.Exists(testExe), "Test script was not created"); string sourceCode = new CecilDecompiler().getSourceCode(testExe); Assert.IsNotEmpty(sourceCode, "main module source code was empty"); Files.WriteFileContent(sourceCodeFile, sourceCode); Assert.IsTrue(File.Exists(sourceCodeFile), "Source code was not created"); }
private void tvDirectoriesAndFiles_AfterSelect(object sender, EventArgs e) { if (tvDirectoriesAndFiles.SelectedNode != null && tvDirectoriesAndFiles.SelectedNode.Tag is MethodDefinition) { var methodDefinition = (MethodDefinition)tvDirectoriesAndFiles.SelectedNode.Tag; // add source code var sourceCode = new CecilDecompiler().getSourceCode(methodDefinition); sourceCodeEditor.setDocumentContents(sourceCode, "aaa.cs"); // add ControFlowGraph tvControlFlowGraph.clear(); var controlFlowGraph = ControlFlowGraph.Create(methodDefinition); tvControlFlowGraph.add_Node(controlFlowGraph.ToString(), controlFlowGraph, true); } }