コード例 #1
0
        private void ParseData149(RelData d, BinaryReader br)
        {
            //game.dat149.rel

            byte b00 = br.ReadByte();

            switch (b00)
            {
            case 3:
            case 4:
            case 17:
            case 50:
            case 57:
            case 62:
            case 63:
            case 66:
            case 76:
            case 88:
            case 90:
                break;

            default:
                break;
            }
        }
コード例 #2
0
        private void ParseData16(RelData d, BinaryReader br)
        {
            //curves.dat16.rel

            byte b00 = br.ReadByte();

            switch (b00)
            {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 12:
            case 13:
            case 15:
                break;

            default:
                break;
            }
        }
コード例 #3
0
        private void ParseData54(RelData d, BinaryReader br)
        {
            //sounds.dat54.rel

            byte b00 = br.ReadByte();

            switch (b00)
            {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 12:
            case 13:
            case 14:
            case 15:
            case 16:
            case 17:
            case 18:
            case 19:
            case 20:
            case 21:
            case 22:
            case 23:
            case 24:
            case 25:
            case 26:
            case 27:
            case 28:
            case 29:
            case 30:
            case 31:
            case 32:
            case 33:
            case 34:
            case 35:
                break;

            default:
                break;
            }
        }
コード例 #4
0
        private void ParseData22(RelData d, BinaryReader br)
        {
            //categories.dat22.rel

            byte b00 = br.ReadByte();

            switch (b00)
            {
            case 0:
                break;

            default:
                break;
            }
        }
コード例 #5
0
        private void ParseData10(RelData d, BinaryReader br)
        {
            //amp.dat10.rel

            byte b00 = br.ReadByte();

            switch (b00)
            {
            case 1:
            case 3:
                break;

            default:
                break;
            }
        }
コード例 #6
0
        private void ParseData150(RelData d, BinaryReader br)
        {
            //game.dat150.rel

            byte b00 = br.ReadByte();

            switch (b00)
            {
            case 3:
            case 4:
            case 6:
            case 8:
            case 17:
            case 32:
            case 37:
            case 38:
            case 39:
            case 47:
            case 50:
            case 52:
            case 57:
            case 62:
            case 63:
            case 64:
            case 65:
            case 66:
            case 76:
            case 88:
            case 90:
            case 117:
                break;

            default:
                break;
            }
        }
コード例 #7
0
        private void ParseData15(RelData d, BinaryReader br)
        {
            //mix.dat15.rel

            byte b00 = br.ReadByte();

            switch (b00)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
                break;

            default:
                break;
            }
        }
コード例 #8
0
        private void ParseData151(RelData d, BinaryReader br)
        {
            //game.dat151.rel

            byte b00 = br.ReadByte(); //???

            switch (b00)
            {
            case 1:    //new
            case 2:    //new
            case 3:
            case 4:
            case 5:    //new
            case 6:
            case 7:    //new
            case 8:    //
            case 9:    //new
            case 11:   //new
            case 12:   //new
            case 13:   //new
            case 14:   //new
            case 15:   //new
            case 16:   //new
            case 17:
            case 18:   //new
            case 22:   //new
            case 23:   //new
            case 24:   //new
            case 25:   //new
            case 26:   //new
            case 27:   //new
            case 28:   //new
            case 29:   //new
            case 30:   //new
            case 31:   //new
            case 32:   //
            case 33:   //new
            case 35:   //new
            case 36:   //new
            case 37:   //
            case 38:   //
            case 39:   //
            case 40:   //new
            case 41:   //new
            case 42:   //new
            case 44:   //new
            case 45:   //new
            case 46:   //new
            case 47:   //
            case 48:   //new
            case 49:   //new
            case 50:
            case 51:   //new
            case 52:   //
            case 53:   //new
            case 54:   //new
            case 55:   //new
            case 56:   //new
            case 57:
            case 59:   //new
            case 62:
            case 63:
            case 64:
            case 65:    //
            case 66:
            case 67:    //new
            case 68:    //new
            case 69:    //new
            case 70:    //new
            case 71:    //new
            case 72:    //new
            case 73:    //new
            case 74:    //new
            case 75:    //new
            case 76:
            case 77:    //new
            case 78:    //new
            case 79:    //new
            case 80:    //new
            case 81:    //new
            case 82:    //new
            case 83:    //new
            case 84:    //new
            case 85:    //new
            case 86:    //new
            case 87:    //new
            case 88:
            case 90:
            case 91:    //new
            case 92:    //new
            case 93:    //new
            case 94:    //new
            case 95:    //new
            case 96:    //new
            case 98:    //new
            case 99:    //new
            case 100:   //new
            case 101:   //new
            case 102:   //new
            case 103:   //new
            case 104:   //new
            case 105:   //new
            case 106:   //new
            case 107:   //new
            case 108:   //new
            case 109:   //new
            case 110:   //new
            case 111:   //new
            case 112:   //new
            case 113:   //new
            case 114:   //new
            case 115:   //new
            case 116:   //new
            case 117:
            case 118:   //new
            case 119:   //new
            case 120:   //new
            case 121:   //new
                break;

            default:
                break;
            }
        }
コード例 #9
0
        private void ParseData4(RelData d, BinaryReader br)
        {
            //speech.dat4.rel, audioconfig.dat4.rel

            if (d.Length == 1)
            {
                byte b = br.ReadByte();
                switch (b)
                {
                case 0:
                case 25:
                case 28:
                case 34:
                case 89:
                case 94:
                case 178:
                    break;

                default:
                    break;
                }
                return;
            }
            if (d.Length == 2)
            {
                byte b = br.ReadByte();
                switch (b)
                {
                case 4:
                case 1:
                case 15:
                case 12:
                case 3:
                case 2:
                case 7:
                case 5:
                case 158:
                case 25:
                case 16:
                case 64:
                case 6:
                case 8:
                case 14:
                case 22:
                case 18:
                case 20:
                case 32:
                case 17:
                case 30:
                case 9:
                case 0:
                case 47:
                case 224:
                case 200:
                case 136:
                case 45:
                case 54:
                case 28:
                case 19:
                case 37:
                case 61:
                case 38:
                case 128:
                case 24:
                case 26:
                case 40:
                case 13:
                case 36:
                case 78:
                case 34:
                case 10:
                case 21:
                case 192:
                case 60:
                case 29:
                case 33:
                case 72:
                case 57:
                case 133:
                case 11:
                    break;

                default:
                    break;
                }
                return;
            }
            if (d.Length == 4)
            {
                uint h = br.ReadUInt32();
                return;
            }


            byte b00 = br.ReadByte();

            switch (b00)
            {
            case 4:
            case 1:
            case 0:
            case 6:
            case 3:
            case 2:
            case 5:
            case 7:
            case 15:
            case 10:
            case 8:
            case 9:
                break;

            case 23:
            case 12:
            case 11:
            case 16:
            case 13:
            case 36:
            case 30:
            case 31:
            case 27:
            case 20:
            case 19:
            case 14:
            case 40:
            case 46:
            case 22:
            case 18:
            case 21:
            case 45:
            case 17:
            case 48:
            case 87:
            case 38:
            case 28:
            case 29:
            case 43:
            case 69:
            case 50:
            case 25:
            case 32:
            case 35:
            case 34:
                break;

            default:
                break;
            }
        }
コード例 #10
0
        private void ParseDataBlock()
        {
            MemoryStream ms = new MemoryStream(DataBlock);
            BinaryReader br = new BinaryReader(ms);

            DataUnkVal = br.ReadUInt32(); //3 bytes used... for? ..version?
            switch (DataUnkVal)
            {
            case 5252715:     //dlcbusiness_amp.dat10.rel
            case 5301323:     //dlcbeach_game.dat149.rel
            case 5378673:     //dlcmpheist_game.dat150.rel
            case 5750395:     //dlcbeach_game.dat150.rel
            case 6353778:     //dlcbeach_game.dat151.rel
            case 6894089:     //dlcpilotschool_game.dat151.rel
            case 6978435:     //dlcxmas2_amp.dat10.rel
            case 7126027:     //audioconfig.dat4.rel
            case 7314721:     //dlcmpheist_amp.dat10.rel
            case 7516460:     //dlcpd03_game.dat151.rel
            case 7917027:     //dlcluxe_amp.dat10.rel
            case 7921508:     //dlcluxe_game.dat151.rel
            case 8149475:     //dlcluxe2_amp.dat10.rel
            case 8751734:     //dlcsfx1_game.dat151.rel
            case 9028036:     //dlchalloween_amp.dat10.rel
            case 9037528:     //dlclowrider_amp.dat10.rel
            case 9458585:     //dlcapartment_amp.dat10.rel
            case 9486222:     //dlcapartment_mix.dat15.rel
            case 9806108:     //mpvalentines2_amp.dat10.rel
            case 9813679:     //dlcjanuary2016_amp.dat10.rel
            case 10269543:    //dlclow2_amp.dat10.rel
            case 10891463:    //dlcexec1_amp.dat10.rel
            case 11171338:    //dlcstunt_amp.dat10.rel
            case 11918985:    //dlcbiker_amp.dat10.rel
            case 12470522:    //dlcimportexport_amp.dat10.rel
            case 12974726:    //audioconfig.dat4.rel
            case 13117164:    //dlcspecialraces_amp.dat10.rel
                break;

            default:
                break;
            }


            List <RelData> reldatas = new List <RelData>();

            if (IndexHashes != null)
            {
                foreach (var indexhash in IndexHashes)
                {
                    ms.Position = indexhash.Offset;
                    RelData d = new RelData();
                    d.NameHash = indexhash.Name;
                    d.Offset   = indexhash.Offset;
                    d.Length   = indexhash.Length;
                    d.Data     = br.ReadBytes((int)indexhash.Length);
                    reldatas.Add(d);
                }
            }
            else if (IndexStrings != null)
            {
                foreach (var indexstr in IndexStrings)
                {
                    ms.Position = indexstr.Offset;
                    RelData d = new RelData();
                    d.Name   = indexstr.Name;
                    d.Offset = indexstr.Offset;
                    d.Length = indexstr.Length;
                    d.Data   = br.ReadBytes((int)indexstr.Length);
                    reldatas.Add(d);
                }
            }
            RelDatas = reldatas.ToArray();

            reldatas.Sort((d1, d2) => d1.Offset.CompareTo(d2.Offset));
            RelDatasSorted = reldatas.ToArray();


            br.Dispose();
            ms.Dispose();


            foreach (var d in RelDatas)
            {
                using (BinaryReader dbr = new BinaryReader(new MemoryStream(d.Data)))
                {
                    switch (Type)
                    {
                    case 4:       //00000100  //speech.dat4.rel, audioconfig.dat4.rel
                        ParseData4(d, dbr);
                        break;

                    case 10:      //00001010  //amp.dat10.rel
                        ParseData10(d, dbr);
                        break;

                    case 15:      //00001111  //mix.dat15.rel
                        ParseData15(d, dbr);
                        break;

                    case 16:      //00010000  //curves.dat16.rel
                        ParseData16(d, dbr);
                        break;

                    case 22:      //00010110  //categories.dat22.rel
                        ParseData22(d, dbr);
                        break;

                    case 54:      //00110110  //sounds.dat54.rel
                        ParseData54(d, dbr);
                        break;

                    case 149:     //10010101  //game.dat149.rel
                        ParseData149(d, dbr);
                        break;

                    case 150:     //10010110  //game.dat150.rel
                        ParseData150(d, dbr);
                        break;

                    case 151:     //10010111  //game.dat151.rel
                        ParseData151(d, dbr);
                        break;

                    default:
                        break;
                    }
                }
            }
        }