We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6ed75c commit 61d3e72Copy full SHA for 61d3e72
src/pe.rs
@@ -172,6 +172,8 @@ impl<'a> Loader<'a> {
172
}
173
174
175
+ let base_diff = address as i64 - self.image_base as i64;
176
+
177
for section in sections {
178
if §ion.name[0..6] == b".reloc" {
179
let section_size = core::cmp::min(section.raw_size, section.virt_size);
@@ -196,7 +198,7 @@ impl<'a> Loader<'a> {
196
198
if entry_type == 10 {
197
199
let location = u64::from(page_rva + u32::from(entry_offset));
200
let value = loaded_region.read_u64(location);
- loaded_region.write_u64(location, value + (address - self.image_base));
201
+ loaded_region.write_u64(location, (value as i64 + base_diff) as u64);
202
203
204
block_offset += 2;
0 commit comments