Skip to content
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

ARM BLX does not set Registers modified #993

Open
McLovi9 opened this issue Aug 15, 2017 · 3 comments
Open

ARM BLX does not set Registers modified #993

McLovi9 opened this issue Aug 15, 2017 · 3 comments

Comments

@McLovi9
Copy link
Contributor

McLovi9 commented Aug 15, 2017

test@test ~ $ cstool -d arm B60100FA
0  b60100fa  blx	#0x6e0
	op_count: 1
		operands[0].type: IMM = 0x6e0
	Registers read: pc
	Registers modified: lr
	Groups: call branch_relative arm v5t jump 

pc register should be also included in Registers modified

@aquynh
Copy link
Collaborator

aquynh commented Aug 16, 2017

on "next" branch, you have:

cstool -d arm B60100FA                   
0  b60100fa  blx	#0x6e0
	op_count: 1
		operands[0].type: IMM = 0x6e0
	Registers read: pc
	Registers modified: lr
	Groups: call branch_relative arm v5t jump 

so you can verify if instruction belongs to JUMP or CALL groups instead

@10110111
Copy link
Contributor

In fact one could say that all the instructions modify PC — most just set it to address after the instruction. Capstone seems quite consistent on this — on x86 too the jumps and calls aren't reported to modify rIP.

@McLovi9
Copy link
Contributor Author

McLovi9 commented Aug 16, 2017

@10110111 :

Capstone seems quite consistent on this

the issue is that capstone is NOT consistent on this. Look at BL instruction

test@test ~ $ cstool -d arm  8A1B00EB  
0  8a1b00eb  bl	#0x6e30
	op_count: 1
		operands[0].type: IMM = 0x6e30
	Registers read: pc
	Registers modified: lr pc
	Groups: call branch_relative arm jump 

Registers modified: lr pc

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

No branches or pull requests

3 participants