Ejemplo n.º 1
0
        internal void Read(FatFile parent, BinaryReader reader)
        {
            this.parent = parent;
            cputype     = reader.ReadInt32();
            cpusubtype  = reader.ReadInt32();
            offset      = reader.ReadUInt32();
            size        = reader.ReadUInt32();
            align       = reader.ReadUInt32();

            if (parent.is_big_endian)
            {
                cputype    = MachO.FromBigEndian(cputype);
                cpusubtype = MachO.FromBigEndian(cpusubtype);
                offset     = MachO.FromBigEndian(offset);
                size       = MachO.FromBigEndian(size);
                align      = MachO.FromBigEndian(align);
            }
        }
Ejemplo n.º 2
0
 internal void WriteHeader(BinaryWriter writer)
 {
     if (parent.is_big_endian)
     {
         writer.Write(MachO.ToBigEndian(cputype));
         writer.Write(MachO.ToBigEndian(cpusubtype));
         writer.Write(MachO.ToBigEndian(offset));
         writer.Write(MachO.ToBigEndian(size));
         writer.Write(MachO.ToBigEndian(align));
     }
     else
     {
         writer.Write(cputype);
         writer.Write(cpusubtype);
         writer.Write(offset);
         writer.Write(size);
         writer.Write(align);
     }
 }