The OpenD Programming Language

getsegmentdata

Returns the segment data of segment with the given segment name.

Returns the segment data of the given segment in the 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();
     int size;
     assert(getsegmentdata(mph, "__TEXT", &size));
     assert(size > 0);
}
version(CoreDdoc)
extern (C) nothrow @nogc
ubyte*
getsegmentdata
(
const scope MachHeader* mhp
,
const scope char* segname
,)

Parameters

mhp MachHeader*

the mach header to get the section data from

segname char*

the name of the segment

size c_ulong*

this will be set to the size of the section or 0 if the section doesn't exist

Return Value

Type: ubyte*

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

Meta