DoxigAlpha

getSectionByName

Function parameters

Parameters

#
self:*const Coff
name:[]const u8

Type definitions in this namespace

Types

#
ImportHintNameEntry
Every name ends with a NULL byte.

Error sets in this namespace

Error Sets

#

= 0x10b

Values

#

Source

Implementation

#
pub fn getSectionByName(self: *const Coff, comptime name: []const u8) ?*align(1) const SectionHeader {
    for (self.getSectionHeaders()) |*sect| {
        const section_name = self.getSectionName(sect) catch |e| switch (e) {
            error.InvalidStrtabSize => continue, //ignore invalid(?) strtab entries - see also GitHub issue #15238
        };
        if (mem.eql(u8, section_name, name)) {
            return sect;
        }
    }
    return null;
}