MachoSection
Description
Decoded section_64. Each segment contains zero or more sections; DWARF lives in the __DWARF segment, code lives in __TEXT.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
MachO.h:67:
u32 offset; // file offset
u32 flags;
} MachoSection;
///
- In
MachO.h:81:
typedef Vec(MachoSegment) MachoSegments;
typedef Vec(MachoSection) MachoSections;
typedef Vec(MachoSymbol) MachoSymbols;- 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:220:
// 16-byte moves below stay inside its window.
BufIter sec_it = IterCarve(cmd, SECT64_SIZE);
MachoSection sec;
MemSet(&sec, 0, sizeof(sec));
MemCopy(sec.section, IterDataAt(&sec_it, IterIndex(&sec_it)), 16);- In
MachO.c:484:
}
const MachoSection *macho_find_section(const Macho *self, Zstr segment, Zstr section) {
if (!self || !segment || !section)
return NULL;- In
MachO.c:488:
return NULL;
for (size i = 0; i < VecLen(&self->sections); ++i) {
const MachoSection *s = VecPtrAt(&self->sections, i);
if (ZstrCompare(s->segment, segment) == 0 && ZstrCompare(s->section, section) == 0) {
return s;- 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: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: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