Skip to content

Misaligned address when trying to access Import section of some PEs #246

@roblabla

Description

@roblabla

First, thanks for this great crate, it's been a huge help!

While trying to look at the import table of C:\Program Files (x86)\Common Files\Microsoft Shared\Phone Tools\CoreCon\11.0\bin\IpOverUsbSvc.exe, I'm getting a misaligned address error. This appears to be caused by the IMAGE_IMPORT_DESCRIPTOR table being misaligned, which is confirmed when looking at the binary in a hex editor:
image

The binary can be found here:
IpOverUsbSvc.exe.zip

Here's some test code:

use pelite::PeFile;

static IP_OVER_USB_SVC: &[u8] = include_bytes!("IpOverUsbSvc.exe");

#[test]
fn test() {
    let pefile = PeFile::from_bytes(IP_OVER_USB_SVC).unwrap();
    let imports = pefile.imports().expect("Grabbing the import table to work.");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions