示例#1
0
文件: Program.cs 项目: q4a/Gibbed.RED
        private static void DecompileFunction(FunctionDefinition func, TextWriter output, string indent)
        {
            output.WriteLine(indent + func.ToString(false));
            if (func.Instructions == null)
            {
                return;
            }
            output.WriteLine(indent + "{");
            foreach (var local in func.Locals)
            {
                output.WriteLine(indent + "    " + local);
            }
            if (func.Locals.Count > 0)
            {
                output.WriteLine("");
            }
            var decompiler = new FunctionDecompiler(func);
            var statements = decompiler.DecompileStatements();

            foreach (var statement in statements)
            {
                statement.Write(output, indent + "    ");
            }

            output.WriteLine(indent + "}\n");
        }
示例#2
0
        private static void DecompileFunction(FunctionDefinition func, TextWriter output, string indent)
        {
            output.WriteLine(indent + func.ToString(false));
            if (func.Instructions == null) return;
            output.WriteLine(indent + "{");
            foreach(var local in func.Locals)
            {
                output.WriteLine(indent + "    " + local);
            }
            if (func.Locals.Count > 0)
            {
                output.WriteLine("");
            }
            var decompiler = new FunctionDecompiler(func);
            var statements = decompiler.DecompileStatements();
            foreach(var statement in statements)
            {
                statement.Write(output, indent + "    ");
            }
 
            output.WriteLine(indent + "}\n");
        }