Skip to content
MachoFileFindSection

MachoFileFindSection

Description

Find a section by (segment, section) name pair. Returns NULL if absent.

Usage example (Cross-references)

Usage examples (Cross-references)
        ok      = ok && m.has_uuid;
        ok      = ok && m.segments.length > 0;
        ok      = ok && MachoFileFindSection(&m, "__TEXT", "__text") != NULL;
        ok      = ok && m.symbols.length > 0;
            return false;
    
        const MachoSection *info_sec   = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_info");
        const MachoSection *abbrev_sec = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_abbrev");
        const MachoSection *str_sec    = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_str");
    
        const MachoSection *info_sec   = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_info");
        const MachoSection *abbrev_sec = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_abbrev");
        const MachoSection *str_sec    = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_str");
        const MachoSection *info_sec   = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_info");
        const MachoSection *abbrev_sec = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_abbrev");
        const MachoSection *str_sec    = MachoFileFindSection(&e->dsym, "__DWARF", "__debug_str");
    
        const u8 *info_b   = info_sec ? e->dsym.data + info_sec->offset : NULL;
    }
    
    const MachoSection *MachoFileFindSection(const MachoFile *self, const char *segment, const char *section) {
        if (!self || !segment || !section)
            return NULL;
Last updated on