-
Notifications
You must be signed in to change notification settings - Fork 6
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
Instruction not marked as branch #7
Comments
I think it's because of the compressed instructions, the one with "c." suffix |
https://riscv.org/wp-content/uploads/2019/06/riscv-spec.pdf, I've made a small change to get around this diff --git a/riscv.py b/riscv.py
index db4c753..90514f9 100644
--- a/riscv.py
+++ b/riscv.py
@@ -20,7 +20,7 @@ from .lifter import Lifter
branch_ins = set([
'beq', 'bne', 'beqz', 'bnez', 'bge', 'bgeu', 'blt', 'bltu', 'blez', 'bgez',
- 'bltz', 'bgtz'
+ 'bltz', 'bgtz', 'c.bnez', 'c.beqz'
])
direct_call_ins = set(['jal', 'j']) |
thanks. good catch! capstone only got support for compressed instructions after the initial/bulk work of this project so compressed instructions are still not well tested. I pushed a commit that should fix this. btw. this binary is a good testcase also for the lifter, so if you encounter anything feel free to report it. I also pushed a bunch of new lifting handlers for the rv64 specifics. |
I'm using riscv64 to analyze a binary from Favourite Architecure challenge series in *CTF https://adworld.xctf.org.cn/media/uploads/task/c11db24e682f4d4d802f4a3ca9ca76b8.zip.
As you can see, 0x10546 supposed to be a branch instruction.
![image](https://user-images.githubusercontent.com/20841686/104881956-d1833180-5994-11eb-9f9f-f534e917971a.png)
I'll gladly help if you could point me where should I take a look first.
The text was updated successfully, but these errors were encountered: