redballoonsecurity / ofrak

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

Modified the FreeSpaceModifier to mark patch bytes written to the binary as not free #409

Closed rbs-alexr closed 5 months ago

rbs-alexr commented 5 months ago

One sentence summary of this PR (This should go in the CHANGELOG!) Change FreeSpaceModifier & PartialFreeSpaceModifier behavior: an optional stub that isn't free space can be provided and fill-bytes for free space can be specified.

Link to Related Issue(s) N/A.

Please describe the changes in your request. This changes the signature and intended behavior of the configs for FreeSpaceModifier and PartialFreeSpaceModifier. Each modifier now allows for injecting a "stub" at the beginning of the targeted code to be freed. This stub is not included in the FreeSpace. The config's "fill" parameter is now the data pattern used to overwrite the bytes that fall in the FreeSpace.

Anyone you think should look at this, specifically? @rbs-afflitto, @rbs-alexr. Optionally: @rbs-jacob, @EdwardLarson .

whyitfor commented 5 months ago

@rbs-afflitto, @rbs-alexr, can you please review these update?

rbs-alexr commented 5 months ago

I took a look at Andrew's feedback and your fix, it all looks good!