Function getSectionByName [src]
Prototype
pub fn getSectionByName(self: *const Coff, comptime name: []const u8) ?*align(1) const SectionHeader
Parameters
self: *const Coff
name: []const u8
Source
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;
}