Skip to content

Commit

Permalink
pe(utils): expose rva2offset inside the crate
Browse files Browse the repository at this point in the history
It is useful to compute debug directory data offsets from RVAs.
  • Loading branch information
RaitoBezarius committed Oct 4, 2023
1 parent 5085aff commit 976de6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pe/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn section_read_size(section: &section_table::SectionTable, file_alignment: u32)
}
}

fn rva2offset(rva: usize, section: &section_table::SectionTable) -> usize {
pub(crate) fn rva2offset(rva: usize, section: &section_table::SectionTable) -> usize {
(rva - section.virtual_address as usize)
+ aligned_pointer_to_raw_data(section.pointer_to_raw_data as usize)
}
Expand Down

0 comments on commit 976de6a

Please sign in to comment.