Example #1
0
        private void ParseXv2Base(int count)
        {
            int offset = 16;

            for (int i = 0; i < count; i++)
            {
                AIT_Entries.Add(new AIT_Entry()
                {
                    I_00  = BitConverter.ToInt32(rawBytes, offset + 0),
                    I_04  = BitConverter.ToInt32(rawBytes, offset + 4),
                    I_08  = BitConverter.ToInt32(rawBytes, offset + 8),
                    I_12  = BitConverter.ToInt32(rawBytes, offset + 12),
                    I_16  = BitConverter.ToInt32(rawBytes, offset + 16),
                    I_20  = BitConverter.ToInt32(rawBytes, offset + 20),
                    I_24  = BitConverter.ToInt32(rawBytes, offset + 24),
                    I_28  = BitConverter.ToInt32(rawBytes, offset + 28),
                    I_32  = BitConverter.ToInt32(rawBytes, offset + 32),
                    I_36  = BitConverter.ToInt32(rawBytes, offset + 36),
                    I_40  = BitConverter.ToInt32(rawBytes, offset + 40).ToString(),
                    I_44  = BitConverter.ToInt32(rawBytes, offset + 44).ToString(),
                    I_48  = BitConverter.ToInt32(rawBytes, offset + 48).ToString(),
                    I_52  = BitConverter.ToInt32(rawBytes, offset + 52).ToString(),
                    I_56  = BitConverter.ToInt32(rawBytes, offset + 56).ToString(),
                    I_60  = BitConverter.ToInt32(rawBytes, offset + 60).ToString(),
                    I_64  = BitConverter.ToInt32(rawBytes, offset + 64).ToString(),
                    I_68  = BitConverter.ToInt32(rawBytes, offset + 68).ToString(),
                    I_72  = BitConverter.ToInt32(rawBytes, offset + 72).ToString(),
                    I_76  = BitConverter.ToInt32(rawBytes, offset + 76).ToString(),
                    I_80  = BitConverter.ToInt32(rawBytes, offset + 80).ToString(),
                    I_84  = BitConverter.ToInt32(rawBytes, offset + 84).ToString(),
                    I_88  = BitConverter.ToInt32(rawBytes, offset + 88).ToString(),
                    I_92  = BitConverter.ToInt32(rawBytes, offset + 92).ToString(),
                    I_96  = BitConverter.ToInt32(rawBytes, offset + 96).ToString(),
                    I_100 = BitConverter.ToInt32(rawBytes, offset + 100).ToString(),
                    I_104 = BitConverter.ToInt32(rawBytes, offset + 104).ToString(),
                    I_108 = BitConverter.ToInt32(rawBytes, offset + 108).ToString(),
                    I_112 = BitConverter.ToInt32(rawBytes, offset + 112).ToString(),
                    I_116 = BitConverter.ToInt32(rawBytes, offset + 116).ToString(),
                    I_120 = BitConverter.ToInt32(rawBytes, offset + 120).ToString(),
                    I_124 = BitConverter.ToInt32(rawBytes, offset + 124).ToString(),
                    I_128 = BitConverter.ToInt32(rawBytes, offset + 128).ToString(),
                    I_132 = BitConverter.ToInt32(rawBytes, offset + 132).ToString(),
                    I_136 = BitConverter.ToInt32(rawBytes, offset + 136).ToString(),
                    I_140 = BitConverter.ToInt32(rawBytes, offset + 140).ToString(),
                    I_144 = BitConverter.ToInt32(rawBytes, offset + 144).ToString()
                });
                offset += 148;
            }
        }
Example #2
0
        private void ParseXv1Base(int count)
        {
            int offset = 16;

            for (int i = 0; i < count; i++)
            {
                AIT_Entries.Add(new AIT_Entry()
                {
                    I_00 = BitConverter.ToInt32(rawBytes, offset + 0),
                    I_04 = BitConverter.ToInt32(rawBytes, offset + 4),
                    I_08 = BitConverter.ToInt32(rawBytes, offset + 8),
                    I_12 = BitConverter.ToInt32(rawBytes, offset + 12),
                    I_16 = BitConverter.ToInt32(rawBytes, offset + 16),
                    I_20 = BitConverter.ToInt32(rawBytes, offset + 20),
                    I_24 = BitConverter.ToInt32(rawBytes, offset + 24),
                    I_28 = BitConverter.ToInt32(rawBytes, offset + 28),
                    I_32 = BitConverter.ToInt32(rawBytes, offset + 32),
                    I_36 = BitConverter.ToInt32(rawBytes, offset + 36)
                });
                offset += 40;
            }
        }
Example #3
0
        //Deserialization
        public void WriteFile(string saveLocation)
        {
            int count = (AIT_Entries != null) ? AIT_Entries.Count() : 0;

            bytes = new List <byte>()
            {
                35, 65, 73, 84, 254, 255, 16, 0
            };
            bytes.AddRange(BitConverter.GetBytes(count));
            bytes.AddRange(BitConverter.GetBytes(I_12));

            switch (AitType)
            {
            case "XV1":
                WriteXv1Base(AIT_Entries);
                break;

            case "XV2_BASE":
                WriteXv2Base(AIT_Entries);
                break;

            case "XV2_DLC5":
                WriteXv2Dlc5(AIT_Entries);
                break;

            case "XV2_DLC6":
                WriteXv2Dlc6(AIT_Entries);
                break;

            default:
                Console.WriteLine(String.Format("Unknown AitType encountered = {0}. Cannot continue.", AitType));
                Utils.WaitForInputThenQuit();
                break;
            }

            File.WriteAllBytes(saveLocation, bytes.ToArray());
        }