Skip to content

Add automatic tagging of Linkable Symbols + resolving patch symbols +…#226

Merged
EdwardLarson merged 32 commits into
redballoonsecurity:masterfrom
marczalik:feature/autoLinkableSymbols
Mar 15, 2023
Merged

Add automatic tagging of Linkable Symbols + resolving patch symbols +…#226
EdwardLarson merged 32 commits into
redballoonsecurity:masterfrom
marczalik:feature/autoLinkableSymbols

Conversation

@marczalik
Copy link
Copy Markdown
Contributor

@marczalik marczalik commented Feb 15, 2023

… generating stubs for unresolved symbols + tests

One sentence summary of this PR (This should go in the CHANGELOG!)
Tag all Complex Blocks in a binary as Linkable Symbols, resolve all undefined symbols within patches, and generate stub files for the linker against symbol definitions located in the target binary.

Link to Related Issue(s)
#186

Please describe the changes in your request.
Tag all Complex Blocks as Linkable Symbols
Extract and resolve undefined symbols within patches
Generate linkable BOM for only required symbols defined in the target binary
Multiprocess assembly step
Store references of symbols defined in patches as attributes of LinkableBinary for use in mutli-stage patching
Test above changes
Update example script to use PatchFromSourceModifier using this updated workflow

Anyone you think should look at this, specifically?
@dannyp303

@marczalik
Copy link
Copy Markdown
Contributor Author

This test failure seems like it may be unrelated to these changes and that it may be again due to randomness in the way test_ofrak_server selects resources based on how the server returns ids in a nondeterministic order.

@rbs-jacob rbs-jacob requested a review from dannyp303 February 21, 2023 21:55
Comment thread ofrak_patch_maker/ofrak_patch_maker/patch_maker.py
Comment thread ofrak_core/ofrak/core/patch_maker/linkable_binary.py
Comment thread ofrak_core/ofrak/core/patch_maker/modifiers.py Outdated
Comment thread ofrak_core/ofrak/core/patch_maker/linkable_binary.py
Comment thread ofrak_core/ofrak/core/patch_maker/linkable_binary.py Outdated
Comment thread ofrak_core/ofrak/core/patch_maker/linkable_binary.py Outdated
Comment thread ofrak_core/ofrak/core/patch_maker/modifiers.py Outdated
Comment thread ofrak_core/requirements-test.txt Outdated
Comment thread ofrak_patch_maker/ofrak_patch_maker/binary_parser/gnu.py Outdated
Comment thread ofrak_patch_maker/ofrak_patch_maker/binary_parser/llvm.py Outdated
Comment thread ofrak_patch_maker/ofrak_patch_maker/patch_maker.py Outdated
@marczalik
Copy link
Copy Markdown
Contributor Author

I believe this test failure is due to parallelizing the compile step in make_bom, which leads to less than 100% coverage. It almost seems like there is some kind of probabilistic nature to whether it's included in coverage, as this has passed before even after the change to parallelize compilation. Should there be a different approach to testing to account for the change to compilation? @rbs-jacob @EdwardLarson

@rbs-jacob
Copy link
Copy Markdown
Member

I believe this test failure is due to parallelizing the compile step in make_bom, which leads to less than 100% coverage. It almost seems like there is some kind of probabilistic nature to whether it's included in coverage, as this has passed before even after the change to parallelize compilation. Should there be a different approach to testing to account for the change to compilation? @rbs-jacob @EdwardLarson

The specific issue in the test is that the coverage files are invalid. I wonder if running in parallel is causing some of the files to be incorrectly overwritten? Could be worth further investigation.

Comment thread ofrak_core/ofrak/core/patch_maker/linkable_binary.py
Comment thread ofrak_core/ofrak/core/patch_maker/modifiers.py
Comment thread ofrak_patch_maker/ofrak_patch_maker/binary_parser/gnu.py Outdated
Comment thread ofrak_patch_maker/ofrak_patch_maker/binary_parser/gnu.py Outdated
Comment thread ofrak_patch_maker/ofrak_patch_maker/binary_parser/llvm.py Outdated
Comment thread ofrak_patch_maker/ofrak_patch_maker/binary_parser/llvm.py Outdated
Comment thread ofrak_patch_maker/ofrak_patch_maker/patch_maker.py
Comment thread ofrak_core/ofrak/core/patch_maker/modifiers.py
Comment thread ofrak_core/test_ofrak/components/test_patch_symbol_resolution.py Outdated
Comment thread ofrak_core/ofrak/core/patch_maker/modifiers.py Outdated
Comment thread ofrak_core/ofrak/core/patch_maker/modifiers.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants