MachoFileOpen
Description
Open and parse a Mach-O file from disk.
Success
Returns true; out->owns_data is true.
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:215:
MachoFile m;
if (!MachoFileOpen(&m, path, base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
MachO.c:248:
MachoFile m;
if (!MachoFileOpen(&m, path, base)) {
DefaultAllocatorDeinit(&alloc);
return false;- In
MachoCache.c:94:
if (e->main_open)
return true;
if (!MachoFileOpen(&e->main, e->module_path, alloc))
return false;
e->main_open = true;- In
MachoCache.c:117:
return false;
}
if (!path_exists(path.data) || !MachoFileOpen(&e->dsym, path.data, alloc)) {
StrDeinit(&path);
return false;- In
MachO.c:280:
}
bool MachoFileOpen(MachoFile *out, const char *path, Allocator *alloc) {
if (!out || !path || !alloc) {
LOG_ERROR("MachoFileOpen: NULL argument");- In
MachO.c:282:
bool MachoFileOpen(MachoFile *out, const char *path, Allocator *alloc) {
if (!out || !path || !alloc) {
LOG_ERROR("MachoFileOpen: NULL argument");
return false;
}- In
MachO.c:289:
u64 capacity = 0;
if (!ReadCompleteFile(path, &buf, &bytes, &capacity, alloc)) {
LOG_ERROR("MachoFileOpen: failed to read {}", path);
return false;
}
Last updated on