Skip to content

PeSection

Description

Decoded section header. PE section names are at most 8 bytes (longer names exist for object files via /N offsets into the string table, but executables don’t use them); we store them as a fixed 9-byte buffer (8 + NUL).

Usage example (Cross-references)

Usage examples (Cross-references)
                return false;
            }
            PeSection s;
            MemCopy(s.name, c.p, 8);
            s.name[8]  = '\0';
    }
    
    const PeSection *PeFileFindSection(const PeFile *self, const char *name) {
        if (!self || !name)
            return NULL;
            return false;
        for (size i = 0; i < self->sections.length; ++i) {
            const PeSection *s = &self->sections.data[i];
            if (rva >= s->virtual_address && rva < s->virtual_address + s->virtual_size) {
                u64 off = (u64)s->raw_offset + (rva - s->virtual_address);
        u32  raw_offset;      // file offset
        u32  characteristics;
    } PeSection;
    
    typedef Vec(PeSection) PeSections;
    } PeSection;
    
    typedef Vec(PeSection) PeSections;
    
    ///
    /// they're vanishingly rare).
    ///
    const PeSection *PeFileFindSection(const PeFile *self, const char *name);
    
    ///
Last updated on