Skip to content

Commit 840dda6

Browse files
committed
Update goblin
1 parent 5332391 commit 840dda6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ description = "Find a resource from a PE image without loading it."
1313
alloc = []
1414

1515
[dependencies]
16-
goblin = {version="0.5", default-features = false, features=["pe32", "pe64"]}
16+
goblin = {version="0.8", default-features = false, features=["pe32", "pe64"]}
1717
anyhow = { version="1", default-features = false }
1818
thiserror = "1"
19-
memmap2 = "0.5"
19+
memmap2 = "0.9"
2020
either = { version="1.8", default-features = false }
2121
plain = "0.2"
2222

src/lib.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ mod rsrc {
7474

7575
unsafe impl Plain for _ImageResourceDataEntry {}
7676

77+
#[allow(dead_code)]
7778
#[derive(Debug, Clone)]
7879
pub struct ImageResourceDirectoryEntry<'a> {
7980
pub id: ResourceIdType<'a>,
@@ -463,7 +464,12 @@ pub mod parser {
463464
panic!("file too small: {}", filename);
464465
}
465466

466-
let _pe: Result<goblin::pe::PE, PEError> = match goblin::pe::PE::parse(buf)
467+
let pe_opts = goblin::pe::options::ParseOptions {
468+
resolve_rva: true,
469+
parse_attribute_certificates: false
470+
};
471+
472+
let _pe: Result<goblin::pe::PE, PEError> = match goblin::pe::PE::parse_with_opts(buf, &pe_opts)
467473
.map_err(|e| PEError::BadResourceString(e.to_string()))
468474
{
469475
Ok(pe) => {

0 commit comments

Comments
 (0)