Skip to content

Commit dd5d187

Browse files
retragerbradford
authored andcommitted
pe: Fix base relocation block offset
According to PE/COFF format spec., base relocation BlockSize includes PageRVA and BlockSize fields. This commit fixes to set the followed Type/Offset block offset correctly. Signed-off-by: Akira Moroo <retrage01@gmail.com>
1 parent eb28f2c commit dd5d187

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl<'a> Loader<'a> {
194194
// Read details for block
195195
let page_rva = reloc_region.read_u32(offset);
196196
let block_size = reloc_region.read_u32(offset + 4);
197-
let mut block_offset = 0;
197+
let mut block_offset = 8;
198198
while block_offset < block_size {
199199
let entry = reloc_region.read_u16(offset + u64::from(block_offset));
200200

0 commit comments

Comments
 (0)