getsectbynamefromheader

Returns the section with the given section name.

Returns the section structure of the given section in the given segment in image pointed to by the given mach header.

void main()
{
     import core.sys.darwin.mach.getsect;
     import core.sys.darwin.crt_externs;

     auto mph = _NSGetMachExecuteHeader();
     assert(getsectbynamefromheader(mph, "__TEXT", "__text"));
}
version(CoreDdoc)
extern (C) nothrow @nogc
const(section)*
getsectbynamefromheader
(
const scope mach_header* mhp
,
const scope char* segname
,
const scope char* sectname
)

Parameters

mhp mach_header*

the mach header to get the section from

segname char*

the name of the segment

sectname char*

the name of the section

Return Value

Type: const(section)*

a pointer to the section structure or null if it doesn't exist

Meta