Skip to content

Commit

Permalink
feat: add pe.export_details[*].rva value
Browse files Browse the repository at this point in the history
This mirrors the changes done in YARA's PR #1882.
  • Loading branch information
vthib committed Feb 16, 2024
1 parent 1a8a8cd commit 7597d3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions boreal/src/module/pe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@ impl Module for Pe {
("name", Type::Bytes),
("forward_name", Type::Bytes),
("ordinal", Type::Integer),
("rva", Type::Integer),
])),
),
(
Expand Down Expand Up @@ -1667,6 +1668,7 @@ fn add_exports(
},
),
("forward_name", forward_name.into()),
("rva", address.into()),
])
})
.collect();
Expand Down
7 changes: 6 additions & 1 deletion boreal/tests/it/libyara_compat/pe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,10 @@ fn test_pe() {
pe.export_details[0].offset == 1072 and
pe.export_details[0].name == \"DllGetClassObject\" and
pe.export_details[0].ordinal == 1 and
pe.export_details[0].rva == 0x1030 and
pe.export_details[1].rva == 0x267d and
pe.export_details[2].rva == 0x26a8 and
pe.export_details[3].rva == 0x26ca and
pe.export_details[1].forward_name == \"COMSVCS.GetObjectContext\"
}",
"tests/assets/libyara/data/mtxex.dll",
Expand Down Expand Up @@ -599,7 +603,8 @@ fn test_pe() {
"import \"pe\"
rule test {
condition:
pe.export_details[0].name == \"CP_PutItem\"
pe.export_details[0].name == \"CP_PutItem\" and
pe.export_details[0].rva == 0x106c
}",
"tests/assets/libyara/data/079a472d22290a94ebb212aa8015cdc8dd28a968c6b4d3b88acdd58ce2d3b885.upx",
true,
Expand Down

0 comments on commit 7597d3f

Please sign in to comment.