Example #1
0
        public string Decompile(MSCScript script)
        {
            var analyzer = new MSCAnalyzer(script);

            analyzer.Analyze_1();
            Target  = script;
            Manager = new MSCCommandManager(Target);
            StringBuilder sb = new StringBuilder();

            while (!Manager.End)
            {
                MSCCommand cmd = Manager.Next();

                // Do ending brackets
                while (INDENT_STACK.Contains(cmd.FileOffset - 0x30))
                {
                    INDENT_STACK.Remove(cmd.FileOffset - 0x30);
                    sb.Append(DoIndent("}\n"));
                }

                // If the command is passed to the next add it to the assignment stack
                if (cmd.Returns)
                {
                    COMMANDS.Push(cmd);
                    continue;
                }

                sb.Append(DecompileCMD(cmd) + "\n");
            }
            return(sb.ToString());
        }
Example #2
0
 public MSCAnalyzer(MSCScript script)
 {
     Target    = script;
     _commands = new List <Tuple <int, MSCCommand> >();
     Manager   = new MSCCommandManager(Target);
 }