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
MachoCache.c:65:
if (e->main_open)
return true;
if (!MachoOpen(&e->main, &e->module_path, alloc))
return false;
e->main_open = true;- In
MachoCache.c:88:
return false;
}
if (!sys_path_exists(StrBegin(&path)) || !MachoOpen(&e->dsym, &path, alloc)) {
StrDeinit(&path);
return false;- In
MachO.c:463:
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:468:
if (FileReadAndClose(path, &data) < 0) {
BufDeinit(&data);
LOG_ERROR("MachoOpen: failed to read {}", path);
return false;
}- In
MachO.c:577:
Macho m;
if (!MachoOpen(&m, path, base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
MachO.c:611:
Macho m;
if (!MachoOpen(&m, path, base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
MachO.c:1428:
Macho m;
bool opened = MachoOpen(&m, &path, base);
ok = ok && opened && VecLen(&m.segments) == 1;
if (opened)- In
MachO.c:1465:
Macho m;
bool opened = MachoOpen(&m, &path, base);
if (opened)
MachoDeinit(&m);
Last updated on