Beispiel #1
0
 public S13(
     S14 s14,
     S15 s15,
     S16 s16,
     S17 s17,
     S18 s18,
     S19 s19,
     S20 s20,
     S21 s21,
     S22 s22,
     S23 s23,
     S24 s24,
     S25 s25,
     S26 s26,
     S27 s27,
     S28 s28,
     S29 s29,
     S30 s30,
     S31 s31,
     S32 s32,
     S33 s33,
     S34 s34,
     S35 s35,
     S36 s36)
 {
 }
Beispiel #2
0
    public static int Main()
    {
        S4   s4   = new S4();
        S24  s24  = new S24(1, s4);
        S24W s24W = new S24W(s24);
        S24  s24X = s24;

        int fI2  = s24.FI2;
        int fI2W = s24W.FS24.FI2;
        int fI2X = s24X.FI2;

        M();

        if ((fI2 == 1) && (fI2W == 1) && (fI2X == 1))
        {
            System.Console.WriteLine("Passed");
            return(100);
        }
        else
        {
            // Before the fix we would fail with:
            //
            System.Console.WriteLine(fI2);   // 1 in debug, 1 in release  OK
            System.Console.WriteLine(fI2W);  // 1 in debug, 0 in release  BAD
            System.Console.WriteLine(fI2X);  // 1 in debug, 1 in release  OK

            System.Console.WriteLine("Failed");
            return(101);
        }
    }
Beispiel #3
0
 public S07(
     S08 s08,
     S09 s09,
     S10 s10,
     S11 s11,
     S12 s12,
     S13 s13,
     S14 s14,
     S15 s15,
     S16 s16,
     S17 s17,
     S18 s18,
     S19 s19,
     S20 s20,
     S21 s21,
     S22 s22,
     S23 s23,
     S24 s24,
     S25 s25,
     S26 s26,
     S27 s27,
     S28 s28,
     S29 s29,
     S30 s30,
     S31 s31,
     S32 s32,
     S33 s33,
     S34 s34,
     S35 s35,
     S36 s36)
 {
 }
Beispiel #4
0
 public S23(
     S24 s24,
     S25 s25,
     S26 s26,
     S27 s27,
     S28 s28,
     S29 s29,
     S30 s30,
     S31 s31,
     S32 s32,
     S33 s33,
     S34 s34,
     S35 s35,
     S36 s36)
 {
 }
Beispiel #5
0
 /// <summary>
 ///
 /// </summary>
 /// <returns>
 /// 0 = Magnitudes, 1 = Phases
 /// </returns>
 public double[][][] GetS4pFile()
 {
     double[][] sParamMagnitudes =
     {
         S11.ToArray(), S12.ToArray(), S13.ToArray(), S14.ToArray(), S21.ToArray(), S22.ToArray(), S23.ToArray(),
         S24.ToArray(), S31.ToArray(), S32.ToArray(), S33.ToArray(), S34.ToArray(), S41.ToArray(), S42.ToArray(),
         S43.ToArray(), S44.ToArray()
     };
     double[][] sParamPhase =
     {
         F11.ToArray(), F12.ToArray(), F13.ToArray(), F14.ToArray(), F21.ToArray(), F22.ToArray(), F23.ToArray(),
         F24.ToArray(), F31.ToArray(), F32.ToArray(), F33.ToArray(), F34.ToArray(), F41.ToArray(), F42.ToArray(),
         F43.ToArray(), F44.ToArray()
     };
     double[][][] sParams = { sParamMagnitudes, sParamPhase };
     return(sParams);
 }
Beispiel #6
0
        //public uint WriteParameters(byte[] code, uint index)
        public void WriteParameters(BinaryWriter output)
        {
            for (int i = 0; i < _parameterCount; ++i)
            {
                switch (_types[i])
                {
                case ParameterType.U30:
                    U30 _u30 = (U30)_parameters[i];
                    Primitives.WriteU30(output, _u30);
                    break;

                case ParameterType.U8:
                    output.Write((byte)_parameters[i]);
                    break;

                case ParameterType.S24:
                    S24 _s24 = (S24)_parameters[i];
                    Primitives.WriteS24(output, _s24);
                    break;

                case ParameterType.UInt:
                    U32 _u32 = (U32)_parameters[i];
                    Primitives.WriteU32(output, _u32);
                    break;

                case ParameterType.Dynamic:
                    S24 d_s24 = (S24)_parameters[0];
                    Primitives.WriteS24(output, d_s24);

                    U30 c_u30 = (U30)_parameters[1];
                    Primitives.WriteU30(output, c_u30);

                    for (int j = 0; j <= c_u30.Value; ++j)
                    {
                        S24 j_s24 = (S24)_parameters[2 + j];
                        Primitives.WriteS24(output, j_s24);
                    }

                    break;
                }
            }
        }
Beispiel #7
0
 public S19(
     S20 s20,
     S21 s21,
     S22 s22,
     S23 s23,
     S24 s24,
     S25 s25,
     S26 s26,
     S27 s27,
     S28 s28,
     S29 s29,
     S30 s30,
     S31 s31,
     S32 s32,
     S33 s33,
     S34 s34,
     S35 s35,
     S36 s36)
 {
 }
Beispiel #8
0
 public S24W(S24 s) : this()
 {
     FS24 = s;
 }
Beispiel #9
0
        public uint ReadParameters(byte[] code, uint index)
        {
            _parameters.Clear();

            uint p = index;

            for (int i = 0; i < _parameterCount; ++i)
            {
                switch (_types[i])
                {
                case ParameterType.U30:
                    U30 _u30 = Primitives.ReadU30(code, p);

                    p += _u30.Length;

                    _parameters.Add(_u30);
                    break;

                case ParameterType.U8:
                    _parameters.Add(code[p++]);
                    break;

                case ParameterType.S24:
                    S24 _s24 = Primitives.ReadS24(code, p);

                    p += _s24.Length;

                    _parameters.Add(_s24);
                    break;

                case ParameterType.UInt:
                    U32 _u32 = Primitives.ReadU32(code, p);

                    p += _u32.Length;

                    _parameters.Add(_u32);
                    break;

                case ParameterType.Dynamic:
                    S24 d_s24 = Primitives.ReadS24(code, p);

                    p += d_s24.Length;

                    _parameters.Add(d_s24);

                    U30 c_u30 = Primitives.ReadU30(code, p);

                    p += c_u30.Length;

                    _parameters.Add(c_u30);

                    for (int j = 0; j <= c_u30.Value; ++j)
                    {
                        S24 j_s24 = Primitives.ReadS24(code, p);

                        p += j_s24.Length;

                        _parameters.Add(j_s24);
                    }

                    break;
                }
            }

            return(p - index);
        }
Beispiel #10
0
        protected void PatchBody(Abc46 abc, MethodBodyInfo body, int bodyId)
        {
            AVM2Command command;
            AVM2Command inlineCommand;
            Dictionary <string, Label> labels = new Dictionary <string, Label>();
            ArrayList instructions            = new ArrayList();
            Label     label;
            string    labelId;

            byte[] il = body.Code;

            uint i = 0;
            uint n = (uint)il.Length;

            uint addr;

            string name;

            bool hasManualMaxStack   = false;
            uint manualMaxStackValue = 0;

            bool patchBody = false;

            //bool parseInline = false;

            _labelUtil.Clear();


            //
            // We will convert the bytecode into a format that the As3c compiler can understand.
            // When converting labels we will use a ':' in front of them instead of a '.' char for
            // the ones "defined" by the ASC so that we have unique names (label syntax is .label)
            //

            while (i < n)
            {
                addr = i;

                if (_labelUtil.IsMarked(addr))
                {
                    labelId = String.Format(":{0}:", _labelUtil.GetLabelAt(addr).id);
                    label   = new Label(labelId);

                    labels.Add(labelId, label);
                    instructions.Add(label);
                }

                command = Translator.ToCommand(il[i++]);

                if (null == command)
                {
                    throw new Exception("Unknown opcode detected.");
                }

                i += command.ReadParameters(il, i);

                switch (command.OpCode)
                {
                case (byte)Op.Label:

                    labelId = String.Format(":{0}:", _labelUtil.GetLabelAt(addr).id);
                    label   = new Label(labelId);

                    labels.Add(labelId, label);
                    instructions.Add(label);

                    break;

                case (byte)Op.IfEqual:
                case (byte)Op.IfFalse:
                case (byte)Op.IfGreaterEqual:
                case (byte)Op.IfGreaterThan:
                case (byte)Op.IfLessEqual:
                case (byte)Op.IfLowerThan:
                case (byte)Op.IfNotEqual:
                case (byte)Op.IfNotGreaterEqual:
                case (byte)Op.IfNotGreaterThan:
                case (byte)Op.IfNotLowerEqual:
                case (byte)Op.IfNotLowerThan:
                case (byte)Op.IfStrictEqual:
                case (byte)Op.IfStrictNotEqual:
                case (byte)Op.IfTrue:
                case (byte)Op.Jump:
                    // Convert label offset to label reference ...
                    S24 offset = (S24)command.Parameters[0];
                    command.Parameters[0] = String.Format(":{0}:", _labelUtil.GetLabelAt((uint)(addr + 1 + offset.Length + offset.Value)).id);
                    instructions.Add(command);
                    break;

                case (byte)Op.GetLex:
                    name = NameUtil.ResolveMultiname(abc, (MultinameInfo)(abc.ConstantPool.MultinameTable[(int)((U30)command.Parameters[0]).Value]));
                    //Console.WriteLine("Called GetLex {0}", name);
                    instructions.Add(command);
                    break;

                case (byte)Op.FindPropertyStrict:
                    name = NameUtil.ResolveMultiname(abc, (MultinameInfo)(abc.ConstantPool.MultinameTable[(int)((U30)command.Parameters[0]).Value]));
                    #region INLINE Block
                    if (inlineWrapper == name)
                    {
                        bool parse = true;
                        patchBody = true;

#if DEBUG
                        Console.WriteLine("[i] Parsing inline block in method {0}", body.Method.Value);
#endif
                        while (parse && i < n)
                        {
                            inlineCommand = Translator.ToCommand(il[i++]);

                            if (null == inlineCommand)
                            {
                                throw new Exception("Unknown opcode detected.");
                            }

                            i += inlineCommand.ReadParameters(il, i);

                            switch (inlineCommand.OpCode)
                            {
                            //
                            // Debug instructions are kept even if they are in an inline block
                            //

                            case (byte)Op.Debug:
                            case (byte)Op.DebugFile:
                            case (byte)Op.DebugLine:
                                instructions.Add(inlineCommand);
                                break;

                            //
                            // Strings are treated as labels -- but make sure it is actually one!
                            //

                            case (byte)Op.PushString:

                                labelId = ((StringInfo)abc.ConstantPool.StringTable[(int)((U30)inlineCommand.Parameters[0])]).ToString();

                                if (labelId.IndexOf('.') != 0 || labelId.IndexOf(':') != (labelId.Length - 1))
                                {
                                    throw new Exception(String.Format("Invalid string \"{0}\" in an inline block. Labels have the format \".labelName:\"", labelId));
                                }

                                labelId = labelId.Substring(0, labelId.Length - 1);
                                label   = new Label(labelId);

                                labels.Add(labelId, label);
                                instructions.Add(label);
                                break;

                            //
                            // GetLex is the one that will bring public::de.popforge.asm::Op on the stack
                            //

                            case (byte)Op.GetLex:
                                name = NameUtil.ResolveMultiname(abc, (MultinameInfo)(abc.ConstantPool.MultinameTable[(int)((U30)inlineCommand.Parameters[0]).Value]));

                                if (inlineKeyword != name)
                                {
                                    throw new Exception("Malformed inline block. GetLex call with invalid parameters");
                                }

                                List <AVM2Command> args        = new List <AVM2Command>();
                                AVM2Command        userCommand = null;
                                uint argc;

                                while (i < n)
                                {
                                    AVM2Command arg = Translator.ToCommand(il[i++]);

                                    if (null == arg)
                                    {
                                        throw new Exception("Unknown opcode detected.");
                                    }

                                    i += arg.ReadParameters(il, i);

                                    if ((byte)Op.CallProperty == arg.OpCode)
                                    {
                                        name        = NameUtil.ResolveMultiname(abc, (MultinameInfo)(abc.ConstantPool.MultinameTable[(int)((U30)arg.Parameters[0]).Value]));
                                        userCommand = Translator.ToCommand(name, true);
                                        argc        = ((U30)arg.Parameters[1]).Value;

                                        if (null == userCommand)
                                        {
                                            throw new Exception(String.Format("Unknown command {0}.", name));
                                        }

                                        break;
                                    }

                                    args.Add(arg);
                                }

                                if (null == userCommand)
                                {
                                    throw new Exception("Malformed inline block.");
                                }

                                instructions.Add(new Instruction(abc, userCommand, args));

                                break;

                            case (byte)Op.CallPropertyVoid:
                                name = NameUtil.ResolveMultiname(abc, (MultinameInfo)(abc.ConstantPool.MultinameTable[(int)((U30)inlineCommand.Parameters[0]).Value]));
                                if (inlineWrapper == name)
                                {
                                    parse = false;
                                }
                                else
                                {
                                    throw new Exception("Malformed inline block. Method calls are not accepted ...");
                                }
                                break;
                            }
                        }

#if DEBUG
                        Console.WriteLine("[+] Inline block parsed");
#endif
                    }
                    #endregion
                    #region INLINE Marker
                    else if (inlineMarker == name)
                    {
#if DEBUG
                        Console.WriteLine("[i] Body {0} has been marked as inline", body.Method.Value);
#endif

                        bool parse = true;

                        while (parse && i < n)
                        {
                            inlineCommand = Translator.ToCommand(il[i++]);

                            if (null == inlineCommand)
                            {
                                throw new Exception("Unknown opcode detected.");
                            }

                            i += inlineCommand.ReadParameters(il, i);

                            switch (inlineCommand.OpCode)
                            {
                            case (byte)Op.CallPropertyVoid:
                                name = NameUtil.ResolveMultiname(abc, (MultinameInfo)(abc.ConstantPool.MultinameTable[(int)((U30)inlineCommand.Parameters[0]).Value]));
                                if (inlineMarker == name)
                                {
                                    parse = false;
                                }
                                else
                                {
                                    throw new Exception("Malformed inline block. Method calls are not accepted ...");
                                }
                                break;
                            }
                        }

#if DEBUG
                        Console.WriteLine("[+] Inline marker parsed.");
#endif
                        patchBody = true;
                    }
                    #endregion
                    #region MAX_STACK Marker
                    else if (inlineMaxStack == name)
                    {
#if DEBUG
                        Console.WriteLine("[i] Body {0} has a manual maximum stack set.", body.Method.Value);
#endif

                        bool parse = true;

                        uint maxStackValue = 0;
                        bool hasMaxValue   = false;

                        while (parse && i < n)
                        {
                            inlineCommand = Translator.ToCommand(il[i++]);

                            if (null == inlineCommand)
                            {
                                throw new Exception("Unknown opcode detected.");
                            }

                            i += inlineCommand.ReadParameters(il, i);

                            switch (inlineCommand.OpCode)
                            {
                            case (byte)Op.PushByte:
                                maxStackValue = (uint)((byte)inlineCommand.Parameters[0]);
                                hasMaxValue   = true;
                                break;

                            case (byte)Op.PushShort:
                                maxStackValue = (uint)((U30)inlineCommand.Parameters[0]);
                                hasMaxValue   = true;
                                break;

                            case (byte)Op.PushInt:
                                maxStackValue = (uint)((S32)abc.ConstantPool.IntTable[(int)((U30)inlineCommand.Parameters[0]).Value]).Value;
                                hasMaxValue   = true;
                                break;

                            case (byte)Op.PushDouble:
                                throw new Exception("Max stack has to be an integer constant.");

                            case (byte)Op.CallPropertyVoid:

                                name = NameUtil.ResolveMultiname(abc, (MultinameInfo)(abc.ConstantPool.MultinameTable[(int)((U30)inlineCommand.Parameters[0]).Value]));

                                if (inlineMaxStack == name)
                                {
                                    parse = false;
                                }
                                else
                                {
                                    throw new Exception("Malformed inline block. Method calls are not accepted ...");
                                }
                                break;
                            }
                        }

#if DEBUG
                        Console.WriteLine("[+] MaxStack marker parsed.");
#endif
                        if (hasMaxValue)
                        {
                            hasManualMaxStack   = true;
                            manualMaxStackValue = maxStackValue;
                        }

                        patchBody = true;
                    }
                    #endregion
                    else
                    {
                        instructions.Add(command);
                    }
                    break;

                default:
                    instructions.Add(command);
                    break;
                }
            }

            if (patchBody)
            {
                //
                // We have to patch this function ...
                // Note: We do not change the initScopeDepth
                //

#if DEBUG
                Console.WriteLine("[i] Patching body (id: {0})", bodyId);
#endif
                CompilerAs3c compAs3c = new CompilerAs3c();

                compAs3c.Compile(abc, instructions, labels, false);

                // Now .. only patch if we find a correct stack!

                U30 maxStack;

                if (!hasManualMaxStack)
                {
                    maxStack = ByteCodeAnalyzer.CalcMaxStack(compAs3c.Code);
                }
                else
                {
                    maxStack = (U30)manualMaxStackValue;
                }

                if (hasManualMaxStack || 0 == (ByteCodeAnalyzer.Flags & ByteCodeAnalyzer.InvalidStack))
                {
                    MethodInfo method = (MethodInfo)abc.Methods[(int)body.Method.Value];

                    body.MaxStack      = maxStack;
                    body.MaxScopeDepth = body.InitScopeDepth + ByteCodeAnalyzer.CalcScopeDepth(compAs3c.Code);

                    U30 minLocalCount = method.ParameterCount;
                    U30 maxLocalCount = ByteCodeAnalyzer.CalcLocalCount(compAs3c.Code);

                    if (maxLocalCount.Value > minLocalCount.Value)
                    {
                        body.LocalCount = ByteCodeAnalyzer.CalcLocalCount(compAs3c.Code);
                    }
                    //else <- we would have unused parameters in a function...

                    body.Code = compAs3c.Code;
                }
                else
                {
                    //
                    // What else? We will display warnings automatically but what about
                    // telling the guy in which function he has an invalid stack?
                    //
                }

#if DEBUG
                Console.WriteLine("[+] Body patched");
#endif
            }
        }
Beispiel #11
0
 /// <summary>
 /// Возвращает амплитуды S11, S12, S13, S14, S22, S23, S24, S33, S34, S44.
 /// </summary>
 /// <returns>
 /// S11, S12, S13, S14, S22, S23, S24, S33, S34, S44.
 /// </returns>
 public double[][] GetSParamMagnitude()
 {
     double[][] sParamMagnitudes =
     { S11.ToArray(), S12.ToArray(), S13.ToArray(), S14.ToArray(), S22.ToArray(), S23.ToArray(), S24.ToArray(), S33.ToArray(), S34.ToArray(), S44.ToArray() };
     return(sParamMagnitudes);
 }
Beispiel #12
0
        private void PatchBody(Abc46 abc, MethodBodyInfo body, int bodyId)
        {
            AVM2Command command;
            AVM2Command inlineCommand;
            Dictionary <string, Label> labels = new Dictionary <string, Label>();
            ArrayList instructions            = new ArrayList();
            Label     label;
            string    labelId;

            byte[] il = body.Code;

            uint i = 0;
            uint n = (uint)il.Length;

            uint addr;

            string name;

            bool patchBody  = false;
            bool ignoreBody = false;

            _labelUtil.Clear();

            while (i < n)
            {
                addr = i;

                if (_labelUtil.IsMarked(addr))
                {
                    labelId = String.Format(":{0}:", _labelUtil.GetLabelAt(addr).id);
                    label   = new Label(labelId);

                    labels.Add(labelId, label);
                    instructions.Add(label);
                }

                command = Translator.ToCommand(il[i++]);

                if (null == command)
                {
                    throw new Exception("Unknown opcode detected.");
                }

                i += command.ReadParameters(il, i);

                switch (command.OpCode)
                {
                case (byte)Op.Label:
                    labelId = String.Format(":{0}:", _labelUtil.GetLabelAt(addr).id);
                    label   = new Label(labelId);
                    labels.Add(labelId, label);
                    instructions.Add(label);
                    break;

                case (byte)Op.IfEqual:
                case (byte)Op.IfFalse:
                case (byte)Op.IfGreaterEqual:
                case (byte)Op.IfGreaterThan:
                case (byte)Op.IfLessEqual:
                case (byte)Op.IfLowerThan:
                case (byte)Op.IfNotEqual:
                case (byte)Op.IfNotGreaterEqual:
                case (byte)Op.IfNotGreaterThan:
                case (byte)Op.IfNotLowerEqual:
                case (byte)Op.IfNotLowerThan:
                case (byte)Op.IfStrictEqual:
                case (byte)Op.IfStrictNotEqual:
                case (byte)Op.IfTrue:
                case (byte)Op.Jump:
                    S24 offset = (S24)command.Parameters[0];
                    command.Parameters[0] = String.Format(":{0}:", _labelUtil.GetLabelAt((uint)(addr + 1 + offset.Length + offset.Value)).id);
                    instructions.Add(command);
                    break;

                case (byte)Op.GetLex:
                    name = NameUtil.ResolveMultiname(abc, (MultinameInfo)(abc.ConstantPool.MultinameTable[(int)((U30)command.Parameters[0]).Value]));
                    if ("public::Math" == name || "Math" == name)
                    {
                        patchBody = true;
                    }
                    instructions.Add(command);
                    break;

                case (byte)Op.LookupSwitch:
                    ignoreBody = true;
                    instructions.Add(command);
                    break;

                default:
                    instructions.Add(command);
                    break;
                }
            }

            if (ignoreBody)
            {
#if DEBUG
                Console.WriteLine("[-] Have to ignore body because of lookupswitch ...");
#endif
            }

            if (patchBody && !ignoreBody)
            {
                //
                // We have to patch this function ...
                // Note: We do not change the initScopeDepth
                //

#if DEBUG
                Console.WriteLine("[i] Patching body (id: {0})", bodyId);
#endif
                CompilerAs3c compAs3c = new CompilerAs3c();

                compAs3c.Compile(abc, instructions, labels, true);

                // Now .. only patch if we find a correct stack!

                U30 maxStack = maxStack = ByteCodeAnalyzer.CalcMaxStack(compAs3c.Code);

                if (0 == (ByteCodeAnalyzer.Flags & ByteCodeAnalyzer.InvalidStack))
                {
                    MethodInfo method = (MethodInfo)abc.Methods[(int)body.Method.Value];

                    body.MaxStack      = maxStack;
                    body.MaxScopeDepth = body.InitScopeDepth + ByteCodeAnalyzer.CalcScopeDepth(compAs3c.Code);

                    U30 minLocalCount = method.ParameterCount;
                    U30 maxLocalCount = ByteCodeAnalyzer.CalcLocalCount(compAs3c.Code);

                    if (maxLocalCount.Value > minLocalCount.Value)
                    {
                        body.LocalCount = ByteCodeAnalyzer.CalcLocalCount(compAs3c.Code);
                    }
                    //else <- we would have unused parameters in a function...

                    body.Code = compAs3c.Code;
                }
                else
                {
                    //
                    // What else? We will display warnings automatically but what about
                    // telling the guy in which function he has an invalid stack?
                    //
                }

#if DEBUG
                Console.WriteLine("[+] Body patched");
#endif
            }
        }
Beispiel #13
0
        protected void FormatCommand(uint address, AVM2Command cmd)
        {
            string output = "";

            //output += String.Format("{0:X4}\t", address);

            //output += String.Format("{0}\t", address);

            if (((byte)Op.Label == cmd.OpCode) || _labels.IsMarked(address))
            {
                output += String.Format("\r\n.label{0}:\r\n", _labels.GetLabelAt(address).id);
            }

            output += "\t" + cmd.StringRepresentation + "\t\t";

            if (cmd.StringRepresentation.Length < 8)
            {
                output += "\t";
            }

            int n = cmd.Parameters.Count;
            int m = n - 1;

            switch (cmd.OpCode)
            {
            // Param 1: U30 -> Multiname
            case (byte)Op.AsType:
            case (byte)Op.Coerce:
            case (byte)Op.DeleteProperty:
            case (byte)Op.FindProperty:
            case (byte)Op.FindPropertyStrict:
            case (byte)Op.GetDescendants:
            case (byte)Op.GetLex:

            case (byte)Op.GetSuper:
            case (byte)Op.InitProperty:
            case (byte)Op.IsType:
            case (byte)Op.SetProperty:
                output += NameUtil.ResolveMultiname(_abc, GetMultiname(cmd, 0));
                break;

            case (byte)Op.GetProperty:
                output += NameUtil.ResolveMultiname(_abc, GetMultiname(cmd, 0));
                break;

            // Param 1: U30 -> Multiname
            // Param 2: Param count
            case (byte)Op.CallProperty:
            case (byte)Op.CallPropertyLex:
            case (byte)Op.CallPropertyVoid:
            case (byte)Op.CallSuper:
            case (byte)Op.CallSuperVoid:
            case (byte)Op.ConstructProperty:
                output += NameUtil.ResolveMultiname(_abc, GetMultiname(cmd, 0));
                output += ", " + ((U30)cmd.Parameters[1]).Value.ToString();
                break;

            // Param 1: U30 -> MethodInfo
            // Param 2: Param count
            case (byte)Op.CallStatic:
                output += ((StringInfo)(_abc.ConstantPool.StringTable[(int)GetMethod(cmd, 0).Name.Value])).ToString();
                output += ", " + ((U30)cmd.Parameters[1]).Value.ToString();
                break;

            // Param 1: U30 -> InstanceInfo
            case (byte)Op.NewClass:
                InstanceInfo ii = (InstanceInfo)_abc.Instances[(int)((U30)cmd.Parameters[0]).Value];
                output += NameUtil.ResolveClass(_abc, ii);
                break;

            // Param 1: ?
            case (byte)Op.PushNamespace:
                output += GetNamespace(cmd, 0);
                break;

            // Param 1: U30 -> DoubleTable
            case (byte)Op.PushDouble:
                //TODO fix this and do not use replace...
                output += GetDouble(cmd, 0).ToString().Replace(',', '.');
                break;

            // Param 1: U30 -> IntTable
            case (byte)Op.PushInt:
                output += GetInt(cmd, 0);
                break;

            // Param 1: U30 -> UIntTable
            case (byte)Op.PushUInt:
                output += GetUInt(cmd, 0);
                break;

            // Param 1: U30 -> StringTable
            case (byte)Op.DebugFile:
            case (byte)Op.PushString:
                output += '"' + GetString(cmd, 0).ToString() + '"';
                break;

            // Param 1: ?
            case (byte)Op.NewFunction:
                output += ((U30)cmd.Parameters[0]).Value + " ;call to anonymous method " + ((U30)cmd.Parameters[0]).Value;
                break;

            // Param 1: S24 -> Jump Offset
            case (byte)Op.IfEqual:
            case (byte)Op.IfFalse:
            case (byte)Op.IfGreaterEqual:
            case (byte)Op.IfGreaterThan:
            case (byte)Op.IfLessEqual:
            case (byte)Op.IfLowerThan:
            case (byte)Op.IfNotEqual:
            case (byte)Op.IfNotGreaterEqual:
            case (byte)Op.IfNotGreaterThan:
            case (byte)Op.IfNotLowerEqual:
            case (byte)Op.IfNotLowerThan:
            case (byte)Op.IfStrictEqual:
            case (byte)Op.IfStrictNotEqual:
            case (byte)Op.IfTrue:
            case (byte)Op.Jump:
                S24 offset = (S24)cmd.Parameters[0];
                // addr + (1byte opcode) + (offset byte length) + (offset value)
                output += String.Format(".label{0}", _labels.GetLabelAt((uint)(address + 1 + offset.Length + offset.Value)).id) + "\r\n";
                break;

            case (byte)Op.LookupSwitch:
                S24 defaultLabel = (S24)cmd.Parameters[0];
                U30 count        = (U30)cmd.Parameters[1];

                output += String.Format(".label{0}", _labels.GetLabelAt((uint)(address + defaultLabel.Value)).id) + ", ";

                for (int i = 0, o = (int)count.Value + 1; i < o; ++i)
                {
                    S24 offsetLabel = (S24)cmd.Parameters[2 + i];

                    output += String.Format(".label{0}", _labels.GetLabelAt((uint)(address + offsetLabel.Value)).id);

                    if (i != o - 1)
                    {
                        output += ", ";
                    }
                }

                output += "\r\n";

                break;

            default:
                for (int i = 0; i < n; ++i)
                {
                    object t = cmd.Parameters[i];

                    if (t is byte)
                    {
                        output += String.Format("{0}", (byte)t);
                    }
                    else if (t is S24)
                    {
                        output += String.Format("{0}", ((S24)t).Value);
                    }
                    else if (t is U30)
                    {
                        output += String.Format("{0}", ((U30)t).Value);
                    }
                    else if (t is U32)
                    {
                        output += String.Format("{0}", ((U32)t).Value);
                    }

                    if (i != m)
                    {
                        output += ", ";
                    }
                }
                break;
            }

            output += "\r\n";

            _output.Add(output);
        }