protected DashboardFile(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { //if (!HasEntry(EntryType.Setting, (int)SettingId.GamercardZone)) Settings.Set(SettingId.GamercardZone, 0); //if (!HasEntry(EntryType.Setting, (int)SettingId.GamercardRegion)) Settings.Set(SettingId.GamercardRegion, 2); //if (!HasEntry(EntryType.Setting, (int)SettingId.YearsOnLive)) Settings.Set(SettingId.YearsOnLive, 0); //if (!HasEntry(EntryType.Setting, (int)SettingId.GamercardMotto)) Settings.Set(SettingId.GamercardMotto, String.Empty); //if (!HasEntry(EntryType.Setting, (int)SettingId.GamercardUserLocation)) Settings.Set(SettingId.GamercardUserLocation, String.Empty); //if (!HasEntry(EntryType.Setting, (int)SettingId.GamercardUserName)) Settings.Set(SettingId.GamercardUserName, String.Empty); //if (!HasEntry(EntryType.Setting, (int)SettingId.GamercardUserBio)) Settings.Set(SettingId.GamercardUserBio, String.Empty); //if (!HasEntry(EntryType.Setting, (int)SettingId.GamercardRep)) Settings.Set(SettingId.GamercardRep, (float)0.0); }
public OffsetTable Clone(int shift) { var newTable = new OffsetTable {IsDynamic = IsDynamic}; if (!IsDynamic) newTable._size = Size; newTable.Properties = new Dictionary<string, BinaryLocation>(); foreach (var kvp in Properties) { newTable.Properties.Add(kvp.Key, kvp.Value == null ? null : new BinaryLocation(kvp.Value.Offset + shift, kvp.Value.Length)); } return newTable; }
public OffsetTable Clone(int shift) { var newTable = new OffsetTable { IsDynamic = IsDynamic }; if (!IsDynamic) { newTable._size = Size; } newTable.Properties = new Dictionary <string, BinaryLocation>(); foreach (var kvp in Properties) { newTable.Properties.Add(kvp.Key, kvp.Value == null ? null : new BinaryLocation(kvp.Value.Offset + shift, kvp.Value.Length)); } return(newTable); }
protected BinaryModelBase(OffsetTable offsetTable, BinaryContainer binary, int startOffset) { CacheEnabled = true; _offsetTable = offsetTable; StartOffset = startOffset; BinMap = new BinMap(); //HACK if (offsetTable == null) { return; } Binary = binary ?? new BinaryContainer(offsetTable.Size); EnsureNullTerminatedStrings(); //Temp if (binary != null) { offsetTable.MapOffsets(BinMap, GetType().BaseType); } }
public AvatarAwardEntry(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public ProgressCache(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public FileEntry(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { Files = new List<FileEntry>(); Folders = new List<FileEntry>(); }
public ProfileEmbeddedContent(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public HashEntry(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public PackageSignature(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public SyncData(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public AchievementEntry(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public SvodVolumeDescriptor(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public TitleEntry(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { TitleCode = TitleId.ToHex(); }
public XdbfFreeSpaceEntry(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public AvatarItemMediaInfo(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
private static OffsetTable CalculateOffsetTable(Type type) { var offsetTable = new OffsetTable(); var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; var declaredOnly = type.HasAttribute <DeclaredOnlyAttribute>(); if (declaredOnly) { flags |= BindingFlags.DeclaredOnly; } var properties = type.GetProperties(flags); var offset = 0; foreach (var property in properties) { var attribute = property.GetAttribute <BinaryDataAttribute>(!declaredOnly); if (attribute == null) { continue; } if (attribute.Offset != -1) { offset = attribute.Offset; } var location = new BinaryLocation(offset); offsetTable.Add(property.Name, location); var propertyType = property.PropertyType; int length; if (attribute.Length.HasValue) { if (propertyType.IsArray && BinaryModelBase.BaseType.IsAssignableFrom(propertyType.GetElementType())) { var size = GetOffsetTable(propertyType.GetElementType()).Size; length = attribute.Length.Value * size; } else { length = attribute.Length.Value; } } else if (BinaryModelBase.BaseType.IsAssignableFrom(propertyType)) { length = GetOffsetTable(propertyType).Size; } else if (attribute.StringReadOptions == StringReadOptions.NullTerminated) { offsetTable.IsDynamic = true; length = 1; } else if (propertyType == typeof(DateTime)) { length = 8; } else { var valueType = propertyType.IsEnum ? Enum.GetUnderlyingType(propertyType) : propertyType; length = valueType.IsValueType ? Marshal.SizeOf(valueType) : 0; } offset += length; location.Length = length; } return(offsetTable); }
public Certificate(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
//private byte[] CONFOUNDER = new byte[] { 0x56, 0x65, 0x6C, 0x6F, 0x63, 0x69, 0x74, 0x79 }; public Account(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public CachedUserFlags(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }
public VideoMediaInfo(OffsetTable offsetTable, BinaryContainer binary, int startOffset) : base(offsetTable, binary, startOffset) { }