Beispiel #1
0
        /// <summary>
        /// Old blob read, do not delete yet
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="offset"></param>
        /// <returns></returns>
        public int ReadFunctionfromBlob(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(blob, c);
                Requirements.Add(m_a);
                c2--;
            }
            return c;
        }
Beispiel #2
0
        /// Methods to do:
        /// Read Action
        /// 

        #region Action read from blob
        public int readActionfromBlob(byte[] blob, int offset)
        {
            int c = offset;

            ActionType = BitConverter.ToInt32(blob, c);
            c += 4;

            int c2 = BitConverter.ToInt32(blob, c);
            c += 4;

            AORequirements m_aor;

            while (c2 > 0)
            {
                m_aor = new AORequirements();
                c = m_aor.readRequirementfromBlob(blob, c);
                c2--;
            }
            return c;
        }