public void Read(X360Reader reader) { long ftexBaseOffset = reader.BaseStream.Position; int magicNumber = reader.ReadInt32(); // FTEX int size = reader.ReadInt32(); Hash = reader.ReadUInt64(); int count = reader.ReadInt32(); int unknown1 = reader.ReadInt32(); // 0 int unknown2 = reader.ReadInt32(); // 0 int unknown3 = reader.ReadInt32(); // 0 Entries = new List<PftxsFtexsFileEntry>(); for (int i = 0; i < count; i++) { PftxsFtexsFileEntry entry = new PftxsFtexsFileEntry(); entry.Read(reader); string name; Hashing.TryGetFileNameFromHash(entry.Hash, out name, false); entry.FilePath = Hashing.NormalizeFilePath(name); Entries.Add(entry); } foreach (var entry in Entries) { reader.BaseStream.Position = ftexBaseOffset + entry.Offset; entry.Data = reader.ReadBytes(entry.Size); } }
public void Read(Stream input) { X360Reader reader = new X360Reader(input, Encoding.Default, true, true); int unknown1 = reader.ReadInt32(); int hashCount = reader.ReadInt32(); int folderCount = reader.ReadInt32(); int fileCount = reader.ReadInt32(); int unknown2 = reader.ReadInt32(); int unknown3 = reader.ReadInt32(); int unknown4 = reader.ReadInt32(); int unknown5 = reader.ReadInt32(); for (int i = 0; i < hashCount; i++) { _hashes.Add(FileHash.ReadFileHash(input)); } input.AlignRead(16); for (int i = 0; i < hashCount; i++) { _folderInfos.Add(FolderInfo.ReadFolderInfo(input)); } input.AlignRead(16); for (int i = 0; i < folderCount; i++) { _folderStringIndices.Add(StringIndex.ReadStringIndex(input)); } input.AlignRead(16); for (int i = 0; i < fileCount; i++) { _fileStringIndices.Add(StringIndex.ReadStringIndex(input)); } input.AlignRead(16); long stringTableOffset = input.Position; foreach (var folderStringIndex in _folderStringIndices) { input.Position = stringTableOffset + folderStringIndex.Offset; string folderName = reader.ReadNullTerminatedString(); _folderNames.Add(folderName); } foreach (var fileStringIndex in _fileStringIndices) { input.Position = stringTableOffset + fileStringIndex.Offset; string fileName = reader.ReadNullTerminatedString(); _fileNames.Add(fileName); } }
public void Read(X360Reader reader) { Hash = reader.ReadUInt64(); Offset = reader.ReadInt32(); Size = reader.ReadInt32(); }
private void Read(Stream input) { X360Reader reader = new X360Reader(input, Encoding.Default, true, true); Hash = reader.ReadUInt64(); }
private void Read(X360Reader reader) { StringOffset = reader.ReadInt64(); StringLength = reader.ReadInt32(); reader.Skip(4); long endPosition = reader.BaseStream.Position; reader.BaseStream.Position = StringOffset; Value = reader.ReadString(StringLength); reader.BaseStream.Position = endPosition; }
public static FpkString ReadFpkString(X360Reader reader) { FpkString fpkString = new FpkString(); fpkString.Read(reader); return fpkString; }
private void Read(Stream input) { X360Reader reader = new X360Reader(input, Encoding.Default, true, true); Offset = reader.ReadUInt32(); }
public override void Read(Stream input) { X360Reader reader = new X360Reader(input, Encoding.Default, true, false); uint magicNumber1 = reader.ReadUInt32(); // foxf if (magicNumber1 != FpkMagicNumber) return; ushort magicNumber2 = reader.ReadUInt16(); // pk FpkType = (FpkType) reader.ReadByte(); // ' ' or 'd' Platform = reader.ReadAsciiString(3); uint fileSize = reader.ReadUInt32(); reader.Skip(18); reader.FlipEndian = IsBigEndianPlatform(Platform); UnknownValue = reader.ReadUInt32(); // 2 (4 on some console fpks?) uint fileCount = reader.ReadUInt32(); uint referenceCount = reader.ReadUInt32(); reader.Skip(4); for (int i = 0; i < fileCount; i++) { Entries.Add(FpkEntry.ReadFpkEntry(reader)); } for (int i = 0; i < referenceCount; i++) { References.Add(FpkReference.ReadFpkReference(reader)); } }
public static FpkEntry ReadFpkEntry(X360Reader reader) { FpkEntry fpkEntry = new FpkEntry(); fpkEntry.Read(reader); return fpkEntry; }
private void Read(X360Reader reader) { DataOffset = reader.ReadInt64(); DataSize = reader.ReadUInt64(); FpkString fileName = FpkString.ReadFpkString(reader); Md5Hash = reader.ReadBytes(16); fileName.ResolveString(Md5Hash); FilePathFpkString = fileName; }
private void Read(X360Reader reader) { ReferenceFilePath = FpkString.ReadFpkString(reader); }
public static FpkReference ReadFpkReference(X360Reader reader) { FpkReference fpkReference = new FpkReference(); fpkReference.Read(reader); return fpkReference; }
public override void Read(Stream input) { X360Reader reader = new X360Reader(input, Encoding.Default, true, false); int pftxsMagicNumber = reader.ReadInt32(); // PFTXS if (pftxsMagicNumber != PftxMagicNumber) return; int unknown1 = reader.ReadInt32(); // 0x40 00 00 00 if (unknown1 != 0x40000000) { if(unknown1 != 0x40) return; reader.BaseStream.Position -= 4; reader.FlipEndian = true; unknown1 = reader.ReadInt32(); } Endianness = reader.FlipEndian ? "Big" : "Little"; int unknown2 = reader.ReadInt32(); // 0x10 if (unknown2 != 0x10) return; int unknown3 = reader.ReadInt32(); // 0x1 if (unknown3 != 0x1) return; int texlistMagicNumber = reader.ReadInt32(); // TEXL Size = reader.ReadInt32(); FileCount = reader.ReadInt32(); int unknown4 = reader.ReadInt32(); for (int i = 0; i < FileCount; i++) { PftxsFtexFile pftxsFtexFile = new PftxsFtexFile(); pftxsFtexFile.Read(reader); Files.Add(pftxsFtexFile); } }