Beispiel #1
0
 public Xdbf(byte[] Data)
 {
     this.br = new CBinaryReader(EndianType.BigEndian, new MemoryStream(Data));
     this.header = new XdbfHeader(this.br);
     this.entries = new XdbfTable(this.br, this.header);
     this.dataOffset = (uint) this.br.BaseStream.Position;
 }
Beispiel #2
0
 public XdbfTableEntry(CBinaryReader b)
 {
     this.Identifier = b.ReadUInt32();
     this.Offset = b.ReadUInt32();
     this.Size = b.ReadUInt32();
     this.Type = b.ReadUInt16();
     this.Padding = b.ReadUInt32();
 }
Beispiel #3
0
 public void Read(CBinaryReader br, uint BaseAddress)
 {
     br.Seek((long) (this.Header.SectionNameAddress - BaseAddress), SeekOrigin.Begin);
     while (br.PeekChar() != 0)
     {
         this.Name = this.Name + br.ReadChar();
     }
     br.Seek((long) this.Header.RawAddress, SeekOrigin.Begin);
     this.Data = br.ReadBytes((int) this.Header.RawSize);
 }
Beispiel #4
0
 public XdbfHeader(CBinaryReader b)
 {
     b.Seek(0L, SeekOrigin.Begin);
     this.MagicBytes = b.ReadBytes(4);
     this.Version = b.ReadUInt16();
     this.Reserved = b.ReadUInt16();
     this.NumEntries = b.ReadUInt32();
     this.NumEntriesCopy = b.ReadUInt32();
     this.UnknownA = b.ReadUInt32();
     this.UnknownB = b.ReadUInt32();
 }
 public override void Parse(CBinaryReader br)
 {
     br.Seek((long) base.Address, SeekOrigin.Begin);
     br.Endian = EndianType.BigEndian;
     this.MediaID = br.ReadBytes(4);
     this.Version = br.ReadUInt32();
     this.BaseVersion = br.ReadUInt32();
     this.TitleID = br.ReadBytes(4);
     this.Platform = br.ReadByte();
     this.ExecutableType = br.ReadByte();
     this.DiscNumber = br.ReadByte();
     this.DiscCount = br.ReadByte();
 }
Beispiel #6
0
 public XexInfo(byte[] Xex)
 {
     this.data = Xex;
     this.ms = new MemoryStream(this.data);
     this.br = new CBinaryReader(EndianType.BigEndian, this.ms);
     this.Header = new XexHeader(this.br);
     foreach (XexInfoField field in this.Header.Values)
     {
         if (!field.Flags)
         {
             field.Parse(this.br);
         }
     }
 }
Beispiel #7
0
 public GDF(FileStream File)
 {
     this.file = File;
     this.fr = new CBinaryReader(EndianType.LittleEndian, this.file);
     this.readVolume();
     try
     {
         this.rootDir = new GDFDirTable(this.fr, this.volDesc, this.volDesc.RootDirSector, this.volDesc.RootDirSize);
     }
     catch (Exception exception)
     {
         this.Exceptions.Add(exception);
     }
 }
 public XbeSectionHeader(CBinaryReader bw)
 {
     this.SectionDigest = new byte[20];
     bw.Endian = EndianType.LittleEndian;
     this.Flags = (XbeSectionFlags) bw.ReadUInt32();
     this.VirtualAddress = bw.ReadUInt32();
     this.VirtualSize = bw.ReadUInt32();
     this.RawAddress = bw.ReadUInt32();
     this.RawSize = bw.ReadUInt32();
     this.SectionNameAddress = bw.ReadUInt32();
     this.SectionNameRefCount = bw.ReadUInt32();
     this.HeadSharedPageRefCountAddress = bw.ReadUInt32();
     this.TailSharedPageRefCountAddress = bw.ReadUInt32();
     this.SectionDigest = bw.ReadBytes(20);
 }
Beispiel #9
0
 public XbeCertifcate(CBinaryReader br)
 {
     this.Size = br.ReadUInt32();
     this.TimeData = br.ReadBytes(4);
     this.titleID = br.ReadUInt32();
     this.titleName = br.ReadBytes(80);
     this.AltTitleIDs = br.ReadBytes(0x40);
     this.AllowedMedia = (XbeAllowedMedia) br.ReadUInt32();
     this.GameRegion = (XbeGameRegion) br.ReadUInt32();
     this.GameRatings = br.ReadUInt32();
     this.DiskNumber = br.ReadUInt32();
     this.Version = br.ReadUInt32();
     this.LanKey = br.ReadBytes(0x10);
     this.SignatureKey = br.ReadBytes(0x10);
     this.AltSignatureKeys = br.ReadBytes(0x100);
 }
Beispiel #10
0
 public XPRHeader(CBinaryReader br)
 {
     br.Endian = EndianType.LittleEndian;
     this.MagicBytes = br.ReadUInt32();
     if (this.MagicBytes == 0x30525058)
     {
         this.FileSize = br.ReadUInt32();
         this.HeaderSize = br.ReadUInt32();
         this.TextureCommon = br.ReadUInt32();
         this.TextureData = br.ReadUInt32();
         this.TextureLock = br.ReadUInt32();
         this.TextureMisc1 = br.ReadByte();
         this.TextureFormat = br.ReadByte();
         this.TextureRes1 = br.ReadByte();
         this.TextureRes2 = br.ReadByte();
         this.IsValid = true;
     }
 }
Beispiel #11
0
 public XbeHeader(CBinaryReader br)
 {
     try
     {
         if (br.ReadUInt32() == 0x48454258)
         {
             this.DigitalSignature = br.ReadBytes(0x100);
             this.BaseAddress = br.ReadUInt32();
             this.SizeOfHeaders = br.ReadUInt32();
             this.SizeOfImage = br.ReadUInt32();
             this.SizeOfImageHeader = br.ReadUInt32();
             this.TimeDate = br.ReadBytes(4);
             this.CertificateAddress = br.ReadUInt32();
             this.NumberOfSections = br.ReadUInt32();
             this.SectionHeadersAddress = br.ReadUInt32();
             this.InitialisationFlags = (XbeInitFlags) br.ReadUInt32();
             this.EntryPoint = br.ReadUInt32();
             this.TLSAddress = br.ReadUInt32();
             this.PEStackCommit = br.ReadUInt32();
             this.PEHeapReserve = br.ReadUInt32();
             this.PEHeapCommit = br.ReadUInt32();
             this.PEBaseAddress = br.ReadUInt32();
             this.PESizeOfImage = br.ReadUInt32();
             this.PEChecksum = br.ReadUInt32();
             this.PETimeDate = br.ReadBytes(4);
             this.DebugPathnameAddress = br.ReadUInt32();
             this.DebugFilenameAddress = br.ReadUInt32();
             this.DebugUnicodeFilenameAddress = br.ReadUInt32();
             this.KernelImageThunkAddress = br.ReadUInt32();
             this.NonKernelImportDirectoryAddress = br.ReadUInt32();
             this.NumberOfLibraryVersions = br.ReadUInt32();
             this.LibraryVersionsAddress = br.ReadUInt32();
             this.KernelLibraryVersionAddress = br.ReadUInt32();
             this.XAPILibraryVersionAddress = br.ReadUInt32();
             this.LogoBitmapAddress = br.ReadUInt32();
             this.LogoBitmapSize = br.ReadUInt32();
             this.IsValid = true;
         }
     }
     catch (Exception)
     {
     }
 }
Beispiel #12
0
 public XbeInfo(byte[] Xbe)
 {
     this.data = Xbe;
     this.br = new CBinaryReader(EndianType.LittleEndian, new MemoryStream(this.data));
     this.Header = new XbeHeader(this.br);
     if (this.Header.IsValid)
     {
         this.br.Seek((long) (this.Header.CertificateAddress - this.Header.BaseAddress), SeekOrigin.Begin);
         this.Certifcate = new XbeCertifcate(this.br);
         this.br.Seek((long) (this.Header.SectionHeadersAddress - this.Header.BaseAddress), SeekOrigin.Begin);
         for (uint i = 0; i < this.Header.NumberOfSections; i++)
         {
             this.Sections.Add(new XbeSection(this.br));
         }
         foreach (XbeSection section in this.Sections)
         {
             section.Read(this.br, this.Header.BaseAddress);
         }
     }
 }
Beispiel #13
0
 public XbeSection(CBinaryReader br)
 {
     this.Header = new XbeSectionHeader(br);
     this.Name = "";
 }
Beispiel #14
0
 public virtual void Parse(CBinaryReader br)
 {
 }