예제 #1
0
        public int ReadFunctionfromBlob(ref byte[] blob, int offset)
        {
            int c = offset;
            FunctionType = BitConverter.ToInt32(blob, c);
            c += 4;
            Target = BitConverter.ToInt32(blob, c);
            c += 4;
            TickCount = BitConverter.ToInt32(blob, c);
            c += 4;
            TickInterval = BitConverter.ToUInt32(blob, c);
            c += 4;

            // Function Arguments
            int c2 = BitConverter.ToInt32(blob, c);
            int c4;
            string temps;
            byte tb;
            Single tempf;
            c += 4;
            while (c2 > 0)
            {
                tb = blob[c++];
                switch (tb)
                {
                    case 0x53:
                        temps = "";
                        c4 = BitConverter.ToInt32(blob, c);
                        c += 4;
                        while (c4 > 0)
                        {
                            temps += (char)blob[c++];
                            c4--;
                        }
                        Arguments.Add(new object());
                        Arguments[Arguments.Count - 1] = temps;
                        break;
                    case 0x49:
                        Arguments.Add(new object());
                        Arguments[Arguments.Count - 1] = BitConverter.ToInt32(blob, c);
                        c += 4;
                        break;
                    case 0x73:
                        tempf = BitConverter.ToSingle(blob, c);
                        Arguments.Add(new object());
                        Arguments[Arguments.Count - 1] = tempf;
                        c += 4;
                        break;
                }
                c2--;
            }
            c2 = BitConverter.ToInt32(blob, c);
            c += 4;
            AORequirements m_a;
            while (c2 > 0)
            {
                m_a = new AORequirements();
                c = m_a.readRequirementfromBlob(ref blob, c);
                Requirements.Add(m_a);
                c2--;
            }
            return c;
        }