public SearchPointContent( System.IO.Stream stream ) { Percentage = stream.ReadUInt32().SwapEndian(); SearchPointItemIndex = stream.ReadUInt32().SwapEndian(); SearchPointItemCount = stream.ReadUInt32().SwapEndian(); Padding = stream.ReadUInt32().SwapEndian(); }
public CharacterModelDefinition( System.IO.Stream stream, uint refStringStart ) { Strings = new string[100]; for ( uint i = 0; i < 100; ++i ) { Strings[i] = stream.ReadAsciiNulltermFromLocationAndReset( stream.ReadUInt32().SwapEndian() + refStringStart ); } CustomIndex = stream.ReadUInt32().SwapEndian(); CustomCount = (byte)stream.ReadByte(); OtherCount = (byte)stream.ReadByte(); Unknown0x20AreaCount = (byte)stream.ReadByte(); Unknown1d = (byte)stream.ReadByte(); OtherIndex = stream.ReadUInt32().SwapEndian(); Unknown0x20AreaIndex = stream.ReadUInt32().SwapEndian(); Unknown4a = (byte)stream.ReadByte(); Unknown4b = (byte)stream.ReadByte(); Unknown4c = (byte)stream.ReadByte(); Unknown4d = (byte)stream.ReadByte(); stream.DiscardBytes( 4 ); Unknown0x80AreaIndex = stream.ReadUInt32().SwapEndian(); Unknown0x80AreaCount = (byte)stream.ReadByte(); Unknown7b = (byte)stream.ReadByte(); stream.DiscardBytes( 2 ); stream.DiscardBytes( 80 ); }
public BattleBookEntry( System.IO.Stream stream ) { UnlockReferenceMaybe = stream.ReadUInt32().SwapEndian(); NameStringDicId = stream.ReadUInt32().SwapEndian(); TextStringDicId = stream.ReadUInt32().SwapEndian(); stream.DiscardBytes( 0x4 ); }
public SkitCondition( System.IO.Stream stream ) { Type = (SkitConditionType)stream.ReadUInt16().SwapEndian(); MathOp = stream.ReadUInt16().SwapEndian(); Value1 = (int)stream.ReadUInt32().SwapEndian(); Value2 = (int)stream.ReadUInt32().SwapEndian(); Value3 = (int)stream.ReadUInt32().SwapEndian(); }
/// <summary> /// Reads the content item from the specified reader. /// </summary> /// <param name="reader">Binary reader to read from.</param> internal override void Read(System.IO.BinaryReader reader, BinaryReadInfo readInfo) { uint length = reader.ReadUInt32(); ID = reader.ReadUInt32(); ResourceType = (BinaryResourceType)reader.ReadUInt32(); Buffer = reader.ReadBytes((int)length - 8); }
/// <summary> /// 読み込み用コンストラクタ /// </summary> /// <param name="reader"></param> public InternalHeader(System.IO.BinaryReader reader) { FileNameLength = reader.ReadUInt32(); Size = reader.ReadUInt32(); Offset = reader.ReadUInt32(); FileName = Encoding.UTF8.GetString(reader.ReadBytes((int)FileNameLength)); HeaderSize = (uint)(4 + 4 + 4 + FileNameLength); }
public UnknownSkitData4( System.IO.Stream stream ) { Unknown1a = stream.ReadUInt16().SwapEndian(); Unknown1b = stream.ReadUInt16().SwapEndian(); Unknown2a = stream.ReadUInt16().SwapEndian(); Unknown2b = stream.ReadUInt16().SwapEndian(); Unknown3 = stream.ReadUInt32().SwapEndian(); Unknown4 = stream.ReadUInt32().SwapEndian(); }
public Title( System.IO.Stream stream ) { ID = stream.ReadUInt32().SwapEndian(); NameStringDicID = stream.ReadUInt32().SwapEndian(); DescStringDicID = stream.ReadUInt32().SwapEndian(); Character = stream.ReadUInt32().SwapEndian(); CostumeString = stream.ReadAscii( 0x10 ).TrimNull(); BunnyGuildPointsMaybe = stream.ReadUInt32().SwapEndian(); stream.DiscardBytes( 0xC ); }
public Unknown0x80byteArea( System.IO.Stream stream, uint refStringStart ) { UnknownUInt = stream.ReadUInt32().SwapEndian(); stream.DiscardBytes( 4 ); UnknownByte1 = (byte)stream.ReadByte(); UnknownByte2 = (byte)stream.ReadByte(); stream.DiscardBytes( 2 ); UnknownFloat1 = stream.ReadUInt32().SwapEndian().UIntToFloat(); UnknownFloat2 = stream.ReadUInt32().SwapEndian().UIntToFloat(); stream.DiscardBytes( 0x6C ); }
public Vector3 vectorT; // T vector, vertical in texture space #endregion Fields #region Methods public void Read(System.IO.BinaryReader source) { vectorS.X = source.ReadSingle(); vectorS.Y = source.ReadSingle(); vectorS.Z = source.ReadSingle(); distS = source.ReadSingle(); vectorT.X = source.ReadSingle(); vectorT.Y = source.ReadSingle(); vectorT.Z = source.ReadSingle(); distT = source.ReadSingle(); texture_id = source.ReadUInt32(); animated = source.ReadUInt32(); }
public NpcFileReference( System.IO.Stream stream, uint refStringStart ) { uint refStringLocation1 = stream.ReadUInt32().SwapEndian(); uint refStringLocation2 = stream.ReadUInt32().SwapEndian(); Filesize = stream.ReadUInt32().SwapEndian(); stream.ReadUInt32(); long pos = stream.Position; stream.Position = refStringStart + refStringLocation1; Map = stream.ReadAsciiNullterm(); stream.Position = refStringStart + refStringLocation2; Filename = stream.ReadAsciiNullterm(); stream.Position = pos; }
public TreasureInfo( System.IO.Stream stream, uint refStringStart ) { EntrySize = stream.ReadUInt32().SwapEndian(); ID = stream.ReadUInt32().SwapEndian(); IDAgain = stream.ReadUInt32().SwapEndian(); RefStringLocation = stream.ReadUInt32().SwapEndian(); ChestTypes = new uint[4]; for ( int i = 0; i < ChestTypes.Length; ++i ) { ChestTypes[i] = stream.ReadUInt32().SwapEndian(); } ChestPositions = new float[8]; for ( int i = 0; i < ChestPositions.Length; ++i ) { ChestPositions[i] = stream.ReadUInt32().SwapEndian().UIntToFloat(); } Items = new uint[12]; for ( int i = 0; i < Items.Length; ++i ) { Items[i] = stream.ReadUInt32().SwapEndian(); } Chances = new uint[12]; for ( int i = 0; i < Chances.Length; ++i ) { Chances[i] = stream.ReadUInt32().SwapEndian(); } long pos = stream.Position; stream.Position = refStringStart + RefStringLocation; RefString = stream.ReadAsciiNullterm(); stream.Position = pos; }
public MapTile( System.IO.Stream stream ) { RoomType = stream.ReadUInt32().SwapEndian(); FloorExitDiff = (int)stream.ReadUInt32().SwapEndian(); EnemyGroup = stream.ReadUInt32().SwapEndian(); FramesToMove = stream.ReadUInt32().SwapEndian(); RegularTreasure = stream.ReadUInt32().SwapEndian(); SpecialTreasure = stream.ReadUInt32().SwapEndian(); MoveUpAllowed = stream.ReadUInt32().SwapEndian(); MoveDownAllowed = stream.ReadUInt32().SwapEndian(); MoveLeftAllowed = stream.ReadUInt32().SwapEndian(); MoveRightAllowed = stream.ReadUInt32().SwapEndian(); }
public SynopsisEntry( System.IO.Stream stream ) { ID = stream.ReadUInt32().SwapEndian(); StoryIdMin = stream.ReadUInt32().SwapEndian(); StoryIdMax = stream.ReadUInt32().SwapEndian(); NameStringDicId = stream.ReadUInt32().SwapEndian(); TextStringDicId = stream.ReadUInt32().SwapEndian(); stream.DiscardBytes( 0xC ); long pos = stream.Position; RefString1 = stream.ReadAsciiNullterm(); stream.Position = pos + 0x10; RefString2 = stream.ReadAsciiNullterm(); stream.Position = pos + 0x20; }
public void Read(System.IO.BinaryReader source) { vectorS.X = source.ReadSingle(); vectorS.Y = source.ReadSingle(); vectorS.Z = source.ReadSingle(); distS = source.ReadSingle(); vectorT.X = source.ReadSingle(); vectorT.Y = source.ReadSingle(); vectorT.Z = source.ReadSingle(); distT = source.ReadSingle(); flags = source.ReadUInt32(); value = source.ReadUInt32(); name = Encoding.ASCII.GetString(source.ReadBytes(32)).Trim(new char[] { ' ', '\0' }); next_texinfo = source.ReadUInt32(); }
public override void Deserialize(System.IO.BinaryReader reader) { ID = reader.ReadUInt32(); Username = reader.ReadString(); Password = reader.ReadString(); Data.Deserialize(reader); }
private static Chunk ReadChunk(System.IO.BinaryReader reader) { var id = reader.ReadUInt16(); var length = reader.ReadUInt32(); var result = new Chunk(id, length); return result; }
public OtherModelAddition( System.IO.Stream stream, uint refStringStart ) { Str = stream.ReadAsciiNulltermFromLocationAndReset( stream.ReadUInt32().SwapEndian() + refStringStart ); Unknown1 = (byte)stream.ReadByte(); Unknown2 = (byte)stream.ReadByte(); stream.DiscardBytes( 0x1A ); }
public FloorInfo( System.IO.Stream stream, uint refStringStart ) { EntrySize = stream.ReadUInt32().SwapEndian(); RestData = new uint[( EntrySize - 4 ) / 4]; for ( int i = 0; i < RestData.Length; ++i ) { RestData[i] = stream.ReadUInt32().SwapEndian(); } long pos = stream.Position; stream.Position = refStringStart + RestData[2]; RefString1 = stream.ReadAsciiNullterm(); stream.Position = refStringStart + RestData[4]; RefString2 = stream.ReadAsciiNullterm(); stream.Position = pos; }
public override object Deserialize(System.IO.BinaryReader binaryReader) { bool hasValue = binaryReader.ReadBoolean (); if (!hasValue) return null; int typeID = binaryReader.ReadByte (); switch (typeID) { case 1: return binaryReader.ReadBoolean (); case 2: return binaryReader.ReadByte (); case 128: return binaryReader.ReadSByte (); case 3: return binaryReader.ReadInt16 (); case 129: return binaryReader.ReadUInt16 (); case 4: return binaryReader.ReadInt32 (); case 130: return binaryReader.ReadUInt32 (); case 5: return binaryReader.ReadInt64 (); case 131: return binaryReader.ReadUInt64 (); case 9: return binaryReader.ReadDouble (); case 16: return binaryReader.ReadString (); case 144: return binaryReader.ReadChar (); case 24: return new DateTime (binaryReader.ReadInt64 ()); case 32: return new Guid (binaryReader.ReadBytes (16)); case 36: return binaryReader.ReadBytes (binaryReader.ReadInt32 ()); case 37: { int count = binaryReader.ReadInt32 (); string[] r = new string[count]; for (int n = 0; n != count; n++) r [n] = binaryReader.ReadString (); return r; } case 38: { int count = binaryReader.ReadInt32 (); long[] r = new long[count]; for (int n = 0; n != count; n++) r [n] = binaryReader.ReadInt64 (); return r; } default: throw new Exception (string.Format ("Serialization for type <{0}> is not supported", typeID)); } }
public uint planenum; // index of the splitting plane (in the plane array) #endregion Fields #region Methods public void Read(System.IO.BinaryReader source) { planenum = source.ReadUInt32(); front = source.ReadInt32(); back = source.ReadInt32(); box.Read(source); first_face = source.ReadUInt16(); num_faces = source.ReadUInt16(); }
public Unknown0x20byteAreaB( System.IO.Stream stream, uint refStringStart ) { UnknownFloats = new float[4]; for ( int i = 0; i < UnknownFloats.Length; ++i ) { UnknownFloats[i] = stream.ReadUInt32().SwapEndian().UIntToFloat(); } UnknownByte = (byte)stream.ReadByte(); stream.DiscardBytes( 0x0F ); }
public ShopItem( System.IO.Stream stream ) { Data = new uint[56 / 4]; for ( int i = 0; i < Data.Length; ++i ) { Data[i] = stream.ReadUInt32().SwapEndian(); } ShopID = Data[1]; ItemID = Data[5]; }
public ushort texture_info; // index of the texture info structure #endregion Fields #region Methods public void Read(System.IO.BinaryReader source) { plane = source.ReadUInt16(); plane_side = source.ReadUInt16(); ledge_id = source.ReadUInt32(); ledge_num = source.ReadUInt16(); texture_info = source.ReadUInt16(); lightmap_syles = source.ReadBytes(4); lightmap = source.ReadInt32(); }
public Recipe( System.IO.Stream stream ) { Data = new uint[0xCC / 4]; // + 0x20 for ( int i = 0; i < Data.Length; ++i ) { Data[i] = stream.ReadUInt32().SwapEndian(); } long pos = stream.Position; RefString = stream.ReadAsciiNullterm(); stream.Position = pos + 0x20; ID = Data[0]; NameStringDicID = Data[1]; DescriptionStringDicID = Data[2]; EffectStringDicID = Data[3]; HP = Data[4]; TP = Data[5]; DeathHeal = Data[6]; PhysicalAilmentHeal = Data[7]; Ingredients = new uint[6]; for ( int i = 0; i < 6; ++i ) { Ingredients[i] = Data[30 + i]; } IngredientCount = new uint[6]; for ( int i = 0; i < 6; ++i ) { IngredientCount[i] = Data[42 + i]; } IngredientGroups = new uint[6]; for ( int i = 0; i < 6; ++i ) { IngredientGroups[i] = Data[24 + i]; } IngredientGroupCount = new uint[6]; for ( int i = 0; i < 6; ++i ) { IngredientGroupCount[i] = Data[36 + i]; } CharactersLike = Data[8]; CharactersDislike = Data[9]; CharactersGoodAtMaking = Data[10]; CharactersBadAtMaking = Data[11]; RecipeCreationCharacter = new uint[6]; for ( int i = 0; i < 6; ++i ) { RecipeCreationCharacter[i] = Data[12 + i]; } RecipeCreationRecipe = new uint[6]; for ( int i = 0; i < 6; ++i ) { RecipeCreationRecipe[i] = Data[18 + i]; } StatType = Data[48]; StatValue = Data[49]; StatTime = Data[50]; }
public static Chunk Parse(System.IO.BinaryReader reader) { var id = reader.ReadUInt16(); if (id != ChunkID.MAIN_CHUNK) { return null; } var length = reader.ReadUInt32(); var mainChunk = new Chunk(id, length); ReadSubChunk(mainChunk, reader); return mainChunk; }
public MES( System.IO.Stream stream ) : base(stream) { uint count = stream.ReadUInt32().FromEndian( Util.Endianness.BigEndian ); stream.ReadAlign( 0x10 ); Messages = new List<string>( (int)count ); for ( uint i = 0; i < count; ++i ) { Messages.Add( TextConverter.ReadToNulltermAndDecode( stream ) ); } }
public ShopDefinition( System.IO.Stream stream ) { Data = new uint[8]; for ( int i = 0; i < Data.Length; ++i ) { Data[i] = stream.ReadUInt32().SwapEndian(); } InGameID = Data[0]; StringDicID = Data[1]; OnTrigger = Data[4]; ChangeToShop = Data[5]; }
private bool LoadFile( System.IO.Stream stream ) { // not entirely sure if this is actually type information? Type = stream.ReadUInt32(); if ( Type <= 0xFFFF ) { Endian = Util.Endianness.LittleEndian; } else { Endian = Util.Endianness.BigEndian; Type = Type.SwapEndian(); } bool ToZ; switch ( Type ) { case 0x08: ToZ = false; break; case 0x100: ToZ = true; break; default: System.Console.WriteLine( "Unknown SDB file type!" ); return false; } if ( ToZ ) { // seems to always be 0x0C uint unknown = stream.ReadUInt32().FromEndian( Endian ); } uint textAmount = stream.ReadUInt32().FromEndian( Endian ); if ( ToZ ) { uint otherDataAmount = stream.ReadUInt32().FromEndian( Endian ); OtherData = new List<uint>( (int)otherDataAmount ); for ( uint i = 0; i < otherDataAmount; ++i ) { OtherData.Add( stream.ReadUInt32().FromEndian( Endian ) ); } uint textOffset = stream.ReadUInt32().FromEndian( Endian ); } TextList = new List<SDBEntry>( (int)textAmount ); for ( uint i = 0; i < textAmount; ++i ) { SDBEntry x = new SDBEntry(); x.PointerIDString = (uint)stream.Position + stream.ReadUInt32().FromEndian( Endian ); x.PointerText = (uint)stream.Position + stream.ReadUInt32().FromEndian( Endian ); TextList.Add( x ); } for ( int i = 0; i < TextList.Count; ++i ) { SDBEntry x = TextList[i]; stream.Position = x.PointerIDString; x.IDString = stream.ReadUTF8Nullterm(); stream.Position = x.PointerText; x.Text = stream.ReadUTF8Nullterm(); } return true; }
public int loadbody(System.IO.BinaryReader br) { long pos = br.BaseStream.Position; generator = br.ReadUInt32(); int elementcount = br.ReadInt32(); //objectInformation = new ObjectElement[br.ReadInt32()]; for (int i = 0; i < elementcount; i++) { objectInformation.Add(new ObjectElement(br)); } camera = new CameraInfo(); camera.fromStream(br); return Convert.ToInt32(br.BaseStream.Position - pos); }