-
Notifications
You must be signed in to change notification settings - Fork 78
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
Support cs_disasm_iter #115
base: master
Are you sure you want to change the base?
Conversation
This is a big improvement over the last PR. 😄 Overall, I like the approach of having separate type to "own" the I have some comments that I will make in-line. |
/// Used to start the iterative disassembly | ||
/// | ||
/// usage shown in examples/recursive.rs | ||
pub fn disasm_iter(&mut self, code: &[u8], offset: usize, addr: u64) -> CsResult<Insn> { |
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.
we don't need to take an offset; the user can just adjust the code
slice as they want:
let new_code = &code[3..];
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.
It will get a bit tricky to handle the iteration within the loop without an offset ( cur_insn = disasm.disasm_iter_continue(&buf);
). Would it be too much to ask to keep the offset ?
I just pushed a fix (#116) for the GitHub action failure; please rebase to the current |
Codecov Report
@@ Coverage Diff @@
## master #115 +/- ##
=======================================
Coverage 94.90% 94.90%
=======================================
Files 22 22
Lines 2670 2670
=======================================
Hits 2534 2534
Misses 136 136
Continue to review full report at Codecov.
|
What do you think about this API?