Skip to content

Commit

Permalink
fix: elf may not have segment
Browse files Browse the repository at this point in the history
  • Loading branch information
DennyDai committed Aug 25, 2024
1 parent 2af0a3c commit 1d70c02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/patcherex2/components/binfmt_tools/elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ def _add_end_of_file_block(self) -> None:
key=lambda x: x["p_offset"],
)

if len(load_segments) == 0:
return

block = FileBlock(self.file_size, -1)
self.p.allocation_manager.add_block(block)

Expand Down

0 comments on commit 1d70c02

Please sign in to comment.