Struct goblin::mach::segment::Segment [−][src]
pub struct Segment<'a> { pub cmd: u32, pub cmdsize: u32, pub segname: [u8; 16], pub vmaddr: u64, pub vmsize: u64, pub fileoff: u64, pub filesize: u64, pub maxprot: u32, pub initprot: u32, pub nsects: u32, pub flags: u32, pub data: &'a [u8], // some fields omitted }
Expand description
Generalized 32/64 bit Segment Command
Fields
cmd: u32
cmdsize: u32
segname: [u8; 16]
vmaddr: u64
vmsize: u64
fileoff: u64
filesize: u64
maxprot: u32
initprot: u32
nsects: u32
flags: u32
data: &'a [u8]
Implementations
Create a new, blank segment, with cmd either LC_SEGMENT_64
, or LC_SEGMENT
, depending on ctx
.
NB You are responsible for providing a correctly marshalled byte array as the sections. You should not use this for anything other than writing.
Get the sections from this segment, erroring if any section couldn’t be retrieved
Convert the raw C 32-bit segment command to a generalized version
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Segment<'a>
impl<'a> UnwindSafe for Segment<'a>