41 references to BlobMagic
Microsoft.NET.HostModel (41)
MachO\BinaryFormat\Blobs\BlobParser.cs (8)
22var magic = (BlobMagic)reader.ReadUInt32BigEndian(offset); 25BlobMagic.CodeDirectory => new CodeDirectoryBlob(SimpleBlob.Read(reader, offset)), 26BlobMagic.Requirements => new RequirementsBlob(SuperBlob.Read(reader, offset)), 27BlobMagic.CmsWrapper => new CmsWrapperBlob(SimpleBlob.Read(reader, offset)), 28BlobMagic.EmbeddedSignature => new EmbeddedSignatureBlob(SuperBlob.Read(reader, offset)), 32static SimpleBlob CreateUnknownBlob(BlobMagic magic, IMachOFileReader reader, long offset) 34Debug.Assert(!Enum.IsDefined(typeof(BlobMagic), magic), "Blob magic is known but not handled.");
MachO\BinaryFormat\Blobs\CmsWrapperBlob.cs (4)
20if (blob.Magic != BlobMagic.CmsWrapper) 22throw new ArgumentException($"Cannot create CmsWrapperBlob of blob with magic value '{blob.Magic}'. Magic value must be {BlobMagic.CmsWrapper}"); 26public static CmsWrapperBlob Empty { get; } = new CmsWrapperBlob(new SimpleBlob(BlobMagic.CmsWrapper, [])); 28public BlobMagic Magic => _inner.Magic;
MachO\BinaryFormat\Blobs\CodeDirectoryBlob.cs (2)
93public BlobMagic Magic => BlobMagic.CodeDirectory;
MachO\BinaryFormat\Blobs\EmbeddedSignatureBlob.cs (11)
26if (superBlob.Magic != BlobMagic.EmbeddedSignature) 52_inner = new SuperBlob(BlobMagic.EmbeddedSignature, blobIndices.MoveToImmutable(), blobs.MoveToImmutable()); 55public BlobMagic Magic => _inner.Magic; 62public CodeDirectoryBlob CodeDirectoryBlob => (CodeDirectoryBlob)GetBlob(BlobMagic.CodeDirectory, throwIfNotFound: true)!; 67public RequirementsBlob? RequirementsBlob => GetBlob(BlobMagic.Requirements) as RequirementsBlob; 72public CmsWrapperBlob? CmsWrapperBlob => GetBlob(BlobMagic.CmsWrapper) as CmsWrapperBlob; 104size += sizeof(BlobMagic); 110size += sizeof(BlobMagic); 135size += sizeof(BlobMagic); // Signature blob Magic number 140size += sizeof(BlobMagic); // CD Magic number 153private IBlob? GetBlob(BlobMagic magic, bool throwIfNotFound = false)
MachO\BinaryFormat\Blobs\IBlob.cs (1)
14BlobMagic Magic { get; }
MachO\BinaryFormat\Blobs\RequirementsBlob.cs (4)
20if (blob.Magic != BlobMagic.Requirements) 22throw new ArgumentException($"Expected a SuperBlob with Magic number '{BlobMagic.Requirements}', got '{blob.Magic}'."); 26public static RequirementsBlob Empty { get; } = new RequirementsBlob(new SuperBlob(BlobMagic.Requirements, [], [])); 29public BlobMagic Magic => _inner.Magic;
MachO\BinaryFormat\Blobs\SimpleBlob.cs (4)
13public SimpleBlob(BlobMagic magic, byte[] data) 25public BlobMagic Magic { get; } 58var blobMagic = (BlobMagic)reader.ReadUInt32BigEndian(offset);
MachO\BinaryFormat\Blobs\SuperBlob.cs (7)
21public SuperBlob(BlobMagic magic, IEnumerable<BlobIndex> blobIndices, IEnumerable<IBlob> blobs) 33protected SuperBlob(BlobMagic magic) 48public BlobMagic Magic { get; } 120BlobMagic magic = (BlobMagic)reader.ReadUInt32BigEndian(offset); 121uint size = reader.ReadUInt32BigEndian(offset + sizeof(BlobMagic)); 122uint count = reader.ReadUInt32BigEndian(offset + sizeof(BlobMagic) + sizeof(uint));