redballoonsecurity / ofrak

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

Slurp up contents of patch source files, rather than expected them as resources #249

Closed EdwardLarson closed 1 year ago

EdwardLarson commented 1 year ago

One sentence summary of this PR (This should go in the CHANGELOG!) Remove need to create Resources to pass source code and headers to PatchFromSourceModifier and FunctionReplaceModifier

Link to Related Issue(s) Creating a resource was awkward and resulted in unnecessary boilerplate.

Please describe the changes in your request. Add recursive slurping and dataclass post-init so that a user can just pass the path to the source directory and OFRAK will read out the contents of the files behind the scenes. This keeps a very simple interface for the benefit of the user, and does not assume the filesystem is the same between the caller and a component.

Anyone you think should look at this, specifically?