Struct goblin::mach::segment::Segment [−][src]
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
impl<'a> Segment<'a>
[src]
pub fn new(ctx: Ctx, sections: &'a [u8]) -> Self
[src]
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.
pub fn name(&self) -> Result<&str>
[src]
Get the name of this segment
pub fn sections(&self) -> Result<Vec<(Section, SectionData<'a>)>>
[src]
Get the sections from this segment, erroring if any section couldn’t be retrieved
pub fn from_32(
bytes: &'a [u8],
segment: &SegmentCommand32,
offset: usize,
ctx: Ctx
) -> Result<Self, Error>
[src]
bytes: &'a [u8],
segment: &SegmentCommand32,
offset: usize,
ctx: Ctx
) -> Result<Self, Error>
Convert the raw C 32-bit segment command to a generalized version
pub fn from_64(
bytes: &'a [u8],
segment: &SegmentCommand64,
offset: usize,
ctx: Ctx
) -> Result<Self, Error>
[src]
bytes: &'a [u8],
segment: &SegmentCommand64,
offset: usize,
ctx: Ctx
) -> Result<Self, Error>
Convert the raw C 64-bit segment command to a generalized version
Trait Implementations
impl<'a> Debug for Segment<'a>
[src]
impl<'a> From<Segment<'a>> for SegmentCommand64
[src]
impl<'a> From<Segment<'a>> for SegmentCommand32
[src]
impl<'a> IntoCtx<Ctx, [u8]> for Segment<'a>
[src]
impl<'a, 'b> IntoIterator for &'b Segment<'a>
[src]
type Item = Result<(Section, SectionData<'a>)>
The type of the elements being iterated over.
type IntoIter = SectionIterator<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a> SizeWith<Ctx> for Segment<'a>
[src]
impl<'a> TryIntoCtx<Ctx, [u8]> for Segment<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Segment<'a>
impl<'a> Send for Segment<'a>
impl<'a> Sync for Segment<'a>
impl<'a> Unpin for Segment<'a>
impl<'a> UnwindSafe for Segment<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,