public byte[] GetEntryContent(XdbfEntry entry) { var contentAddress = GetRealAddress(entry.AddressSpecifier); BinMap.Add(contentAddress, entry.Length, entry.IsSyncData ? "SyncData" : entry.IsSyncList ? "SyncList" : String.Empty, entry.Type.ToString()); return(Binary.ReadBytes(contentAddress, entry.Length)); }
protected virtual void Initialize() { IsParsed = false; Entries = new List <XdbfEntry>(); Achievements = new EntryList <AchievementEntry>(this); Images = new EntryList <ImageEntry>(this); Settings = new SettingList(this); Strings = new EntryList <StringEntry>(this); TitlesPlayed = new EntryList <TitleEntry>(this); AvatarAwards = new EntryList <AvatarAwardEntry>(this); TheUnknowns = new EntryList <ImageEntry>(this); //HACK var pos = HeaderSize; for (var i = 0; i < EntryTableLength; i++) { BinMap.Add(pos, EntrySize, String.Empty, "XdbfEntry", null, null, i >= EntryCount); if (i < EntryCount) { var entry = ModelFactory.GetModel <XdbfEntry>(Binary.ReadBytes(pos, EntrySize)); if (entry.Type != EntryType.Unknown) { Entries.Add(entry); } BinMap.Add(pos, EntrySize, entry.Type.ToString(), "XdbfEntry", entry.Length, (entry.IsSyncList ? "SyncList" : entry.IsSyncData ? "SyncData" : String.Empty), i >= EntryCount); //Debug.WriteLine("[{0}] {1}", entry.Id, entry.Type); } pos += EntrySize; } FreeSpace = new List <XdbfFreeSpaceEntry>(); for (var i = 0; i < FreeSpaceTableLength; i++) { BinMap.Add(pos, FreeSpaceEntrySize, String.Empty, "XdbfFreeSpaceEntry", null, null, i >= FreeSpaceTableEntryCount); if (i < FreeSpaceTableEntryCount) { var entry = ModelFactory.GetModel <XdbfFreeSpaceEntry>(Binary.ReadBytes(pos, FreeSpaceEntrySize)); FreeSpace.Add(entry); var contentAddress = GetRealAddress(entry.AddressSpecifier); BinMap.Add(contentAddress, entry.Length, "<EMPTY>", "Unallocated content", null, null, true); } pos += FreeSpaceEntrySize; } }