Skip to content

Commit

Permalink
core::mem instead of std::mem
Browse files Browse the repository at this point in the history
  • Loading branch information
kkent030315 committed Oct 10, 2024
1 parent 870cad9 commit 7234670
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pe/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl DosStub {
/// The DOS stub is a small program that prints the message "This program cannot be run in DOS mode" and exits; and
/// is not really read for the PECOFF file format. It's a relic from the MS-DOS era.
pub fn new(bytes: &[u8], pe_pointer: u32) -> error::Result<Self> {
let start_offset = std::mem::size_of::<DosHeader>();
let start_offset = core::mem::size_of::<DosHeader>();
let end_offset = pe_pointer as usize;
if bytes.len() < end_offset as usize {
return Err(error::Error::Malformed(format!(
Expand Down Expand Up @@ -940,7 +940,7 @@ impl RichHeader {
pub fn parse(bytes: &[u8]) -> error::Result<Option<Self>> {
// Parse the DOS header; some fields are required to locate the Rich header.
let dos_header = DosHeader::parse(bytes)?;
let dos_header_end_offset = std::mem::size_of::<DosHeader>();
let dos_header_end_offset = core::mem::size_of::<DosHeader>();
let pe_header_start_offset = dos_header.pe_pointer as usize;

// The Rich header is not present in all PE files.
Expand Down

0 comments on commit 7234670

Please sign in to comment.