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