redballoonsecurity / ofrak

OFRAK: unpack, modify, and repack binaries.
https://ofrak.com
Other
1.86k stars 127 forks source link

Fix PartialFreeSpaceModifier deleting non-overlapping children #396

Closed rbs-afflitto closed 8 months ago

rbs-afflitto commented 9 months ago

One sentence summary of this PR This change prevents _find_and_delete_overlapping_children from deleting children which are next to the freed region, but not overlapping.

Please describe the changes in your request. The ResourceFilter bounds searched for MemoryRegion children within the freed range, but would also include MemoryRegions which start at the end of the freed range. This change fixes the bounds such that it will only find MemoryRegions which overlap with the freed range.