as_range() for ImageBase
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
// PE stuff
|
// PE stuff
|
||||||
// ==============================
|
// ==============================
|
||||||
|
|
||||||
|
use core::ops::Range;
|
||||||
use crate::upcast::Upcast;
|
use crate::upcast::Upcast;
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
@@ -230,6 +231,10 @@ impl ImageBase {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub unsafe fn as_range(&self) -> Range<usize> {
|
||||||
|
self.as_ptr()..self.as_ptr() + self.nt_header().optional_header.size_of_image as usize
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ImageNTHeaders64 {
|
impl ImageNTHeaders64 {
|
||||||
|
|||||||
Reference in New Issue
Block a user