private static MetaStructure MakeStructureWithComplexReferencedData() { var structureWithComplexReferenceDataInfo = new StructureInfo_GTA5_pc(); var structureWithComplexReferenceData = new MetaStructure(null, structureWithComplexReferenceDataInfo); structureWithComplexReferenceData.Values = new Dictionary <int, IMetaValue>(); structureWithComplexReferenceData.Values.Add(unchecked ((int)0x6F004ECC), MakeStructureArray()); structureWithComplexReferenceData.Values.Add(unchecked ((int)0x8F3E7BA7), MakeStructurePointerArray()); return(structureWithComplexReferenceData); }
public static EnumInfo_GTA5_pc GetEnumInfo(Meta_GTA5_pc meta, int structureKey) { EnumInfo_GTA5_pc info = null; foreach (var x in meta.EnumInfos) { if (x.EnumNameHash == structureKey) { info = x; } } return(info); }
public static StructureInfo_GTA5_pc GetStructureInfo(Meta_GTA5_pc meta, int structureKey) { StructureInfo_GTA5_pc info = null; foreach (var x in meta.StructureInfos) { if (x.StructureNameHash == structureKey) { info = x; } } return(info); }
public static MetaStructure MakeDataset() { var valueInfo = new StructureInfo_GTA5_pc(); valueInfo.StructureNameHash = 0x22DD6F04; var rootStructure = new MetaStructure(null, valueInfo); rootStructure.Values = new Dictionary <int, IMetaValue>(); rootStructure.Values.Add(unchecked ((int)0x38C62F77), MakeStructureWithSimpleData()); rootStructure.Values.Add(unchecked ((int)0x97CC848A), MakeStructureWithEnumData()); rootStructure.Values.Add(0x3A5B9F33, MakeStructureWithSimpleReferencedData()); rootStructure.Values.Add(0x53663957, MakeStructureWithComplexReferencedData()); return(rootStructure); }
private static MetaStructure MakeStructureWithSimpleData() { var structureWithSimpleTypesInfo = new StructureInfo_GTA5_pc(); var structureWithSimpleTypes = new MetaStructure(null, structureWithSimpleTypesInfo); structureWithSimpleTypes.Values = new Dictionary <int, IMetaValue>(); structureWithSimpleTypes.Values.Add(unchecked ((int)0x36C55540), new MetaBoolean(false)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x707975FF), new MetaBoolean(true)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x96142337), new MetaByte_A(-128)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xD4D9059D), new MetaByte_A(-127)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x710D0955), new MetaByte_A(126)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x860ACDD8), new MetaByte_A(127)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xCDFD7789), new MetaByte_B(0)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x7DCCF225), new MetaByte_B(1)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xA0AB9B78), new MetaByte_B(254)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x3A223898), new MetaByte_B(255)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x2F07F270), new MetaInt16_A(-32768)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x83E5053E), new MetaInt16_A(-32767)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x86F3BC1E), new MetaInt16_A(32766)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x2C916F02), new MetaInt16_A(32767)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x1972DD39), new MetaInt16_B(0)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x1433E9A2), new MetaInt16_B(1)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xABF22E97), new MetaInt16_B(65534)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xCAD920FA), new MetaInt16_B(65535)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x96AA9C22), new MetaInt32_A(-2147483648)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xBE498F77), new MetaInt32_A(-2147483647)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xDEA66123), new MetaInt32_A(2147483646)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xA7A347FE), new MetaInt32_A(2147483647)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x5940A2C4), new MetaInt32_B(0)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x7AE8E34B), new MetaInt32_B(1)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x48758F24), new MetaInt32_B(4294967294)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x2DCCF53B), new MetaInt32_B(4294967295)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x7C6BAA24), new MetaFloat(1.2f)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xC81C39E6), new MetaFloat(12.0f)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xC599B2B0), new MetaFloat4_XYZ(1.2f, 3.4f, 5.6f)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xA2B4F045), new MetaFloat4_XYZ(12.0f, 34.0f, 56.0f)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xE0B18333), new MetaFloat4_XYZW(1.2f, 3.4f, 5.6f, 7.8f)); structureWithSimpleTypes.Values.Add(unchecked ((int)0xA7E3D660), new MetaFloat4_XYZW(12.0f, 34.0f, 56.0f, 78.0f)); structureWithSimpleTypes.Values.Add(unchecked ((int)0x3B8AF0C2), new MetaArrayOfBytes(new byte[] { 0, 1, 254, 255 })); var charinfo = new StructureEntryInfo_GTA5_pc(); charinfo.ReferenceKey = 64; structureWithSimpleTypes.Values.Add(unchecked ((int)0x8FF34AB5), new MetaArrayOfChars(charinfo, "A String")); structureWithSimpleTypes.Values.Add(unchecked ((int)0x17525AB1), new MetaInt32_Hash(unchecked ((int)0xF63A8BC0))); structureWithSimpleTypes.Values.Add(unchecked ((int)0x10D59C62), new MetaInt32_Hash(0)); return(structureWithSimpleTypes); }
private static MetaStructure MakeStructureWithEnumData() { var structureWithEnumsInfo = new StructureInfo_GTA5_pc(); var structureWithEnums = new MetaStructure(null, structureWithEnumsInfo); structureWithEnums.Values = new Dictionary <int, IMetaValue>(); structureWithEnums.Values.Add(unchecked ((int)0x2300AF3B), MakeByteEnum()); structureWithEnums.Values.Add(unchecked ((int)0x56E94C50), MakeIntEnumA()); structureWithEnums.Values.Add(unchecked ((int)0x43F0EEF4), MakeIntEnumB()); structureWithEnums.Values.Add(unchecked ((int)0xB4B7824B), MakeShortFlagsA()); structureWithEnums.Values.Add(unchecked ((int)0x1B3098A9), MakeShortFlagsB()); structureWithEnums.Values.Add(unchecked ((int)0xA51CF61E), MakeIntFlags1A()); structureWithEnums.Values.Add(unchecked ((int)0x11045D33), MakeIntFlags1B()); structureWithEnums.Values.Add(unchecked ((int)0xC66A7EC6), MakeIntFlags2A()); structureWithEnums.Values.Add(unchecked ((int)0x53C471C0), MakeIntFlags2B()); structureWithEnums.Values.Add(unchecked ((int)0x89D91A45), MakeIntFlags2C()); return(structureWithEnums); }
private static MetaStructure MakeStructureWithSimpleReferencedData() { var structureWithSimpleReferenceDataInfo = new StructureInfo_GTA5_pc(); var structureWithSimpleReferenceData = new MetaStructure(null, structureWithSimpleReferenceDataInfo); structureWithSimpleReferenceData.Values = new Dictionary <int, IMetaValue>(); structureWithSimpleReferenceData.Values.Add(unchecked ((int)0xEF099C3A), MakeCharArray()); structureWithSimpleReferenceData.Values.Add(unchecked ((int)0x79FE4E42), MakeShortArray()); structureWithSimpleReferenceData.Values.Add(unchecked ((int)0x62AFD2A7), MakeIntArray()); structureWithSimpleReferenceData.Values.Add(unchecked ((int)0x8FD208FE), MakeFloatArray()); structureWithSimpleReferenceData.Values.Add(unchecked ((int)0xD094EFE2), MakeFloatVectorArray()); structureWithSimpleReferenceData.Values.Add(unchecked ((int)0x68B43521), MakeHashArray()); structureWithSimpleReferenceData.Values.Add(unchecked ((int)0x3A6E4591), new MetaCharPointer("A String")); structureWithSimpleReferenceData.Values.Add(unchecked ((int)0xC9811541), new MetaCharPointer(null)); structureWithSimpleReferenceData.Values.Add(unchecked ((int)0xC8C01542), new MetaDataBlockPointer(null, new byte[] { 0, 1, 254, 255 })); structureWithSimpleReferenceData.Values.Add(unchecked ((int)0x2FCAB965), new MetaDataBlockPointer(null, null)); return(structureWithSimpleReferenceData); }
private static MetaArray MakeStructurePointerArray() { var metainf111 = new StructureInfo_GTA5_pc(); metainf111.StructureNameHash = 0x2D8B6A9C; MetaStructure metasubstr1 = new MetaStructure(null, metainf111); metasubstr1.Values = new Dictionary <int, IMetaValue>(); metasubstr1.Values.Add(unchecked ((int)0x04792618), new MetaBoolean(false)); metasubstr1.Values.Add(unchecked ((int)0xD302778A), new MetaBoolean(true)); MetaGeneric pointerValue1 = new MetaGeneric(); pointerValue1.Value = metasubstr1; var metainf222 = new StructureInfo_GTA5_pc(); metainf222.StructureNameHash = unchecked ((int)0xA71A1B09); MetaStructure metasubstr2 = new MetaStructure(null, metainf222); metasubstr2.Values = new Dictionary <int, IMetaValue>(); metasubstr2.Values.Add(unchecked ((int)0x8705BF6F), new MetaBoolean(true)); metasubstr2.Values.Add(unchecked ((int)0x981F3DBC), new MetaBoolean(false)); MetaGeneric pointerValue2 = new MetaGeneric(); pointerValue2.Value = metasubstr2; MetaGeneric pointerValue3 = new MetaGeneric(); pointerValue3.Value = null; MetaArray pointerArray = new MetaArray(); pointerArray.info = new StructureEntryInfo_GTA5_pc(); pointerArray.info.DataType = StructureEntryDataType.Structure; pointerArray.Entries = new List <IMetaValue>(); pointerArray.Entries.Add(pointerValue1); pointerArray.Entries.Add(pointerValue2); pointerArray.Entries.Add(pointerValue3); return(pointerArray); }
public MetaStructure(Meta_GTA5_pc meta, StructureInfo_GTA5_pc info) { this.meta = meta; this.info = info; }
private void MetaBuildStructureInfos(MetaInformationXml xmlInfo) { strList = new ResourceSimpleArray <StructureInfo_GTA5_pc>(); foreach (var xmlStructureInfo in xmlInfo.Structures) { var structureInfo = new StructureInfo_GTA5_pc(); structureInfo.StructureNameHash = xmlStructureInfo.NameHash; structureInfo.StructureKey = xmlStructureInfo.Key; structureInfo.Unknown_8h = xmlStructureInfo.Unknown; structureInfo.StructureLength = xmlStructureInfo.Length; structureInfo.Entries = new ResourceSimpleArray <StructureEntryInfo_GTA5_pc>(); foreach (var xmlStructureEntryInfo in xmlStructureInfo.Entries) { var xmlArrayTypeStack = new Stack <MetaStructureArrayTypeXml>(); var xmlArrayType = xmlStructureEntryInfo.ArrayType; while (xmlArrayType != null) { xmlArrayTypeStack.Push(xmlArrayType); xmlArrayType = xmlArrayType.ArrayType; } while (xmlArrayTypeStack.Count > 0) { xmlArrayType = xmlArrayTypeStack.Pop(); var arrayStructureEntryInfo = new StructureEntryInfo_GTA5_pc(); arrayStructureEntryInfo.EntryNameHash = 0x100; arrayStructureEntryInfo.DataOffset = 0; arrayStructureEntryInfo.DataType = (StructureEntryDataType)xmlArrayType.Type; arrayStructureEntryInfo.Unknown_9h = 0; if (arrayStructureEntryInfo.DataType == StructureEntryDataType.Array) { arrayStructureEntryInfo.ReferenceTypeIndex = (short)(structureInfo.Entries.Count - 1); } else { arrayStructureEntryInfo.ReferenceTypeIndex = 0; } arrayStructureEntryInfo.ReferenceKey = xmlArrayType.TypeHash; structureInfo.Entries.Add(arrayStructureEntryInfo); } var structureEntryInfo = new StructureEntryInfo_GTA5_pc(); structureEntryInfo.EntryNameHash = xmlStructureEntryInfo.NameHash; structureEntryInfo.DataOffset = xmlStructureEntryInfo.Offset; structureEntryInfo.DataType = (StructureEntryDataType)xmlStructureEntryInfo.Type; structureEntryInfo.Unknown_9h = (byte)xmlStructureEntryInfo.Unknown; if (structureEntryInfo.DataType == StructureEntryDataType.Array) { structureEntryInfo.ReferenceTypeIndex = (short)(structureInfo.Entries.Count - 1); } else { structureEntryInfo.ReferenceTypeIndex = 0; } structureEntryInfo.ReferenceKey = xmlStructureEntryInfo.TypeHash; structureInfo.Entries.Add(structureEntryInfo); } strList.Add(structureInfo); } }