Skip to content

Commit

Permalink
Fix absent reloc
Browse files Browse the repository at this point in the history
  • Loading branch information
serpilliere committed Nov 2, 2020
1 parent 30e192d commit 2504e07
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions miasm/loader/pe_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,9 @@ def export_funcs(self):

def reloc_to(self, imgbase):
offset = imgbase - self.NThdr.ImageBase
if self.DirReloc is None:
log.warn('no relocation found!')
if self.DirReloc is None or self.DirReloc.reldesc is None:
log.warn('No relocation found')
return
for rel in self.DirReloc.reldesc:
rva = rel.rva
for reloc in rel.rels:
Expand Down

0 comments on commit 2504e07

Please sign in to comment.