Example #1
0
        private void ParseAig()
        {
            //Entry offset+count
            int offset = BitConverter.ToInt32(rawBytes, 12) + 16;
            int count  = BitConverter.ToInt32(rawBytes, offset);

            offset += BitConverter.ToInt32(rawBytes, offset + 4);

            I_06 = BitConverter.ToUInt16(rawBytes, 6);
            I_08 = BitConverter.ToInt32(rawBytes, 8);

            //Entries
            int         strOffset = 16;
            List <byte> _bytes    = rawBytes.ToList();

            for (int i = 0; i < count; i++)
            {
                AigEntries.Add(new AIG_Entry()
                {
                    Name = Utils.GetString(_bytes, strOffset),
                    I_00 = BitConverter.ToInt32(rawBytes, offset + 0),
                    F_04 = BitConverter.ToSingle(rawBytes, offset + 4),
                    F_08 = BitConverter.ToSingle(rawBytes, offset + 8),
                    F_12 = BitConverter.ToSingle(rawBytes, offset + 12),
                    F_16 = BitConverter.ToSingle(rawBytes, offset + 16),
                    I_20 = BitConverter.ToInt32(rawBytes, offset + 20),
                    I_24 = BitConverter.ToInt32(rawBytes, offset + 24),
                    I_28 = BitConverter.ToUInt16(rawBytes, offset + 28),
                    I_30 = BitConverter.ToUInt16(rawBytes, offset + 30),
                    I_32 = BitConverter.ToUInt16(rawBytes, offset + 32),
                    I_34 = BitConverter.ToUInt16(rawBytes, offset + 34),
                    I_36 = BitConverter.ToInt32(rawBytes, offset + 36),
                    I_40 = BitConverter.ToInt32(rawBytes, offset + 40),
                });
                strOffset += AigEntries[i].Name.Length + 1;
                offset    += 44;
            }
        }