Exemple #1
0
 /// <summary>
 /// Reads the data-block from a stream.
 /// </summary>
 public override void Read(ResourceDataReader reader, params object[] parameters)
 {
     // read structure data
     this.Unknown_0h = reader.ReadUInt32();
     this.len1       = reader.ReadUInt32();
     this.len2       = reader.ReadUInt32();
     this.len3       = reader.ReadUInt16();
     this.Unknown_Eh = reader.ReadUInt16();
     this.Data1      = reader.ReadBytes((int)len1);
     this.Data2      = reader.ReadBytes((int)len2);
     this.Data3      = reader.ReadBytes((int)len3);
 }
Exemple #2
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            int datalength = ItemCount * StructureSize;

            byte[] data = reader.ReadBytes(datalength);
            Items = MetaTypes.ConvertDataArray <T>(data, 0, ItemCount);
        }
Exemple #3
0
        //public uint PadCount { get; set; }
        //public byte[] PadData { get; set; }
        //public string[] TestStrings { get; set; }


        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            Count         = MetaTypes.SwapBytes(reader.ReadUInt32()); //okay. so this is big endian
            EncryptedData = reader.ReadBytes((int)Count);
            //PadCount = (uint)((8 - (reader.Position % 8)) % 8);//maybe next block just needs to be aligned instead?
            //PadData = reader.ReadBytes((int)PadCount);


            ////none of these work :(
            //var strs = new List<string>();
            //foreach (var key in GTA5Keys.PC_NG_KEYS)
            //{
            //    var decr = GTACrypto.DecryptNG(EncryptedData, key);
            //    strs.Add(Encoding.ASCII.GetString(decr));
            //}
            //TestStrings = strs.ToArray();
        }
Exemple #4
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            uint format = Convert.ToUInt32(parameters[0]);
            int  Width  = Convert.ToInt32(parameters[1]);
            int  Height = Convert.ToInt32(parameters[2]);
            int  Levels = Convert.ToInt32(parameters[3]);
            int  Stride = Convert.ToInt32(parameters[4]);

            int fullLength = 0;
            int length     = Stride * Height;

            for (int i = 0; i < Levels; i++)
            {
                fullLength += length;
                length     /= 4;
            }

            FullData = reader.ReadBytes(fullLength);
        }
Exemple #5
0
 public override void Read(ResourceDataReader reader, params object[] parameters)
 {
     Data = reader.ReadBytes(DataLength);
 }
Exemple #6
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.Unknown_0h  = reader.ReadUInt32();
            this.Data1Length = reader.ReadUInt32();
            this.Data2Length = reader.ReadUInt32();
            this.Data3Length = reader.ReadUInt16();
            this.Unknown_Eh  = reader.ReadUInt16();
            this.Data1       = reader.ReadBytes((int)Data1Length);
            this.Data2       = reader.ReadBytes((int)Data2Length);
            this.Data3       = reader.ReadBytes((int)Data3Length);


            var treereader = new ExpressionTreeReader(Data1, Data2, Data3);

            Items = treereader.ReadItems();
            Roots = treereader.ReadTree();

            #region testing
            //switch (Unknown_Eh)
            //{
            //    case 2:
            //    case 8:
            //    case 4:
            //    case 6:
            //    case 59:
            //    case 5:
            //    case 12:
            //    case 58:
            //    case 20:
            //    case 10:
            //    case 9:
            //    case 1:
            //    case 50:
            //    case 14:
            //    case 19:
            //    case 7:
            //    case 25:
            //    case 15:
            //    case 13:
            //    case 28:
            //    case 17:
            //    case 22:
            //    case 26:
            //    case 18:
            //    case 21:
            //    case 23:
            //    case 11:
            //    case 24:
            //    case 27:
            //    case 30:
            //    case 16:
            //    case 377:
            //    case 31:
            //    case 125:
            //    case 32:
            //    case 34:
            //    case 52:
            //    case 51:
            //    case 345:
            //    case 399:
            //        break;
            //    default:
            //        break;//no hit
            //}
            #endregion
        }