Function getSections [src]
Asserts LoadCommand is of type segment_command_64.
Prototype
pub fn getSections(lc: LoadCommand) []align(1) const section_64
Parameters
lc: LoadCommand
Source
pub fn getSections(lc: LoadCommand) []align(1) const section_64 {
const segment_lc = lc.cast(segment_command_64).?;
if (segment_lc.nsects == 0) return &[0]section_64{};
const data = lc.data[@sizeOf(segment_command_64)..];
const sections = @as([*]align(1) const section_64, @ptrCast(data.ptr))[0..segment_lc.nsects];
return sections;
}