-
-
Notifications
You must be signed in to change notification settings - Fork 499
implement rop.cache to store and return cached ROP search results #5706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 13 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
a6b94e2 to
418a0a9
Compare
test/unit/test_rop.c
Outdated
| core, "mov", false, RZ_ROP_GADGET_PRINT, RZ_ROP_DETAIL_SEARCH_NON, NULL); | ||
| RzCmdStatus status = rz_core_rop_search(core, context); | ||
| mu_assert_eq(status, RZ_CMD_STATUS_OK, "rop search should succeed"); | ||
| mu_assert_notnull(core->analysis->ht_rop, "ht_rop should be initialized after cached search"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also check if the correct result is in the cache.
Then do another search for the same gadget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rot127 should i manually insert result into cache and then verify the second search returns the cached result correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, after the search the result is expected to be in the cache.
c0491b5 to
c068675
Compare
|
@Rot127 did you check the updated test? |
|
Please fix the build first |
c068675 to
f5725bf
Compare
|
@Rot127 i fixed the build issue please take a look. |
|
Tests still fail though. Please check |
a572e56 to
d06143f
Compare
d06143f to
de43eb3
Compare
|
@Rot127 i fixed the build issue and test locally whatever was failing previously Local Test VerificationFix: test_rop binary path resolutionUpdated test/unit/test_rop.c to correctly resolve the test binary path. Resultstest_rop: $ build/test/unit/test_rop meson test: Ok: 146 rz-test: 24068 OK 1048 BR 11 XX 25 FX (11 XX are pre-existing failures unrelated to this PR) So can you please rerun the workflows |
- ARM: Update jump table case label from '3...4' to '4' (more precise) - x86_64: Update switch/case ranges to match improved analysis output - cmd_print: Update histogram EXPECT to include ANSI codes that rizin outputs
This reverts commit acca26610a494311626da0d000b029b254b77a33.
de43eb3 to
000c656
Compare
|
While running CI tests locally, I found memory leaks but noticed that CI already I fixed some leaks anyway - should I keep or revert these changes? Also, I moved some tests from unit to integration after learning that unit tests |
Your checklist for this pull request
RZ_APIfunction and struct this PR changes.RZ_API).Detailed description
The
rop.cacheconfig option existed but was never implemented. Thecachefield inRzRopSearchContextwas set from config but never used in the search logic.This PR implements the caching functionality by:
ht_rophashtable inRzAnalysisto store search resultsTest plan
Unit tests pass:
meson test -C build rop rop_constraint
1/2 rizin:unit / rop OK
2/2 rizin:unit / rop_constraint OK
Timing proof (same as issue
rop.cacheseems not work in risc-v binary #5544):[0x00000000]> e rop.cache=true
[0x00000000]> time /R/ jalr
0x000001fa 2ad6 sw a0, 44(sp)
0x000001fc 6df2 bnez a2, 0x1de
0x000001fe 0293 jalr t1
...
0.056576
[0x00000000]> time /R/ jalr
0x000001fa 2ad6 sw a0, 44(sp)
0x000001fc 6df2 bnez a2, 0x1de
0x000001fe 0293 jalr t1
...
0.000016
Closing issues
closes #5544