Closed Talanor closed 6 years ago
It looks like the vector of bytes (wtr
) does not contain a valid amd64 instructions (at least according to Capstone). Currently, capstone-rs
assumes that getting 0
instructions back from a disasm()
call indicates an error. wtr
has no valid instructions, so disasm_count()
returns an Error
.
This is probably not the behavior we want. The official Python bindings check the errno if 0
instructions are returned, so we should do the same.
I did not use this logic originally because it seemed like Capstone did not always reset the errno
when appropriate. However, even in the version of Capstone bundled with capstone-sys
, the errno is properly reset.
Thanks for filing the bug! This is one of the pain points of the library that I have been meaning to address.
Fixed with #22.
@Talanor, please comment on this issue if the latest master
branch does not fix your bug.
Please refer to Specifying dependencies from git repositories for details.
Hello,
I have been playing a bit with capstone-rs and I stumbled upon this error: "Error: Encountered Unknown Capstone Return Error", which looks like an internal error from the library.
Below is the code I used (please excuse any dumb stuff I might have done as I am relatively new to rust and capstone):
From my understanding, the interesting debug info would be this:
Please let me know if I can provide any more information.
Thanks for your time.