MachoOpen
Description
Open and parse a Mach-O file from disk.
Success
Returns true; parser owns the read-in buffer.
Failure
Returns false on read / magic / load-command parse error. Fat/universal headers (CAFEBABE) are rejected as unsupported in v1; the caller must pick a slice.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
MachO.c:216:
Macho m;
if (!MachoOpen(&m, path, base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
MachO.c:249:
Macho m;
if (!MachoOpen(&m, path, base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
MachoCache.c:87:
if (e->main_open)
return true;
if (!MachoOpen(&e->main, e->module_path.data, alloc))
return false;
e->main_open = true;- In
MachoCache.c:110:
return false;
}
if (!path_exists(path.data) || !MachoOpen(&e->dsym, path.data, alloc)) {
StrDeinit(&path);
return false;- In
MachO.c:445:
bool macho_open(Macho *out, Zstr path, Allocator *alloc) {
if (!out || !path || !alloc) {
LOG_FATAL("MachoOpen: NULL argument (contract violation)");
}
Buf data = BufInit(alloc);- In
MachO.c:450:
if (FileReadAndClose(path, &data) < 0) {
BufDeinit(&data);
LOG_ERROR("MachoOpen: failed to read {}", path);
return false;
}
Last updated on