MachoFindSection
Description
Find a section by (segment, section) name pair.
Success
Returns a pointer to the matching MachoSection, borrowed from self (valid until MachoDeinit).
Failure
Returns NULL when no section matches.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
MachoCache.c:111:
return false;
const MachoSection *info_sec = MachoFindSection(&e->dsym, "__DWARF", "__debug_info");
const MachoSection *abbrev_sec = MachoFindSection(&e->dsym, "__DWARF", "__debug_abbrev");
const MachoSection *str_sec = MachoFindSection(&e->dsym, "__DWARF", "__debug_str");- In
MachoCache.c:112:
const MachoSection *info_sec = MachoFindSection(&e->dsym, "__DWARF", "__debug_info");
const MachoSection *abbrev_sec = MachoFindSection(&e->dsym, "__DWARF", "__debug_abbrev");
const MachoSection *str_sec = MachoFindSection(&e->dsym, "__DWARF", "__debug_str");- In
MachoCache.c:113:
const MachoSection *info_sec = MachoFindSection(&e->dsym, "__DWARF", "__debug_info");
const MachoSection *abbrev_sec = MachoFindSection(&e->dsym, "__DWARF", "__debug_abbrev");
const MachoSection *str_sec = MachoFindSection(&e->dsym, "__DWARF", "__debug_str");
const u8 *info_b = info_sec ? BufData(MachoBuf(&e->dsym)) + info_sec->offset : NULL;- In
MachO.c:434:
}
const MachoSection *hit = MachoFindSection(&m, "__TEXT", "__text");
bool ok = hit != NULL && hit->addr == 0x100000000ull && hit->size == 0x100;
// Right section name in the wrong segment -> no match.
- In
MachO.c:437:
bool ok = hit != NULL && hit->addr == 0x100000000ull && hit->size == 0x100;
// Right section name in the wrong segment -> no match.
ok = ok && MachoFindSection(&m, "__DATA", "__text") == NULL;
// Right segment, wrong section -> no match.
ok = ok && MachoFindSection(&m, "__TEXT", "__nope") == NULL;- In
MachO.c:439:
ok = ok && MachoFindSection(&m, "__DATA", "__text") == NULL;
// Right segment, wrong section -> no match.
ok = ok && MachoFindSection(&m, "__TEXT", "__nope") == NULL;
MachoDeinit(&m);- In
MachO.c:585:
ok = ok && m.has_uuid;
ok = ok && VecLen(&m.segments) > 0;
ok = ok && MachoFindSection(&m, "__TEXT", "__text") != NULL;
ok = ok && VecLen(&m.symbols) > 0;- In
MachO.c:1017:
return false;
}
const MachoSection *hit = MachoFindSection(&m, "__TEXT", "__text");
ok = ok && hit != NULL && hit->addr == 0x100000000ull && hit->size == 0x100 && hit->offset == 0;
ok = ok && MachoFindSection(&m, "__DATA", "__text") == NULL;- In
MachO.c:1019:
const MachoSection *hit = MachoFindSection(&m, "__TEXT", "__text");
ok = ok && hit != NULL && hit->addr == 0x100000000ull && hit->size == 0x100 && hit->offset == 0;
ok = ok && MachoFindSection(&m, "__DATA", "__text") == NULL;
ok = ok && MachoFindSection(&m, "__TEXT", "__nope") == NULL;
MachoDeinit(&m);- In
MachO.c:1020:
ok = ok && hit != NULL && hit->addr == 0x100000000ull && hit->size == 0x100 && hit->offset == 0;
ok = ok && MachoFindSection(&m, "__DATA", "__text") == NULL;
ok = ok && MachoFindSection(&m, "__TEXT", "__nope") == NULL;
MachoDeinit(&m);
DefaultAllocatorDeinit(&alloc);- In
MachO.c:1103:
ok = ok && VecLen(&m.sections) == 2;
// The target at index 1 must be found (real ++i reaches it).
const MachoSection *hit = MachoFindSection(&m, "__TEXT", "__cstring");
ok = ok && hit != NULL && hit->addr == 0x100000100ull && hit->size == 0x80 && hit->offset == 0x100;
if (ok)
Last updated on