capstone icon indicating copy to clipboard operation
capstone copied to clipboard

SystemZ misses optional alias details

Open Rot127 opened this issue 6 months ago • 3 comments

The cstool -r/ CS_OPT_DETAIL_REAL to fill the details of the real isntruction (not the alias) isn't working for SystemZ and LoongArch yet.

Example from AArch64:

cstool -d aarch64 c0035fd6            
 0  c0 03 5f d6  ret	
	ID: 865 (ret)
	Is alias: 1588 (ret) with ALIAS operand set
	Groups: jump return

// Vs with -r flag (the real details)

cstool -d -r aarch64 c0035fd6   
 0  c0 03 5f d6  ret	
	ID: 887 (ret)
	Is alias: 1620 (ret) with REAL operand set
	op_count: 1
		operands[0].type: REG = x30
		operands[0].access: READ
	Registers read: x30
	Groups: jump return 

Rot127 avatar Jun 14 '25 12:06 Rot127

fyi @jiegec

In case you find time.

Rot127 avatar Jun 14 '25 12:06 Rot127

CS_OPT_DETAIL_REAL seems to work for ret on LoongArch:

$ ./cstool -d loongarch64 "2000004c"
 0  20 00 00 4c  ret
        ID: 322 (jirl)
        Is alias: 2058 (ret) with ALIAS operand set
        Groups: return
$ ./cstool -r -d loongarch64 "2000004c"
 0  20 00 00 4c  ret
        ID: 322 (jirl)
        Is alias: 2058 (ret) with REAL operand set
        op_count: 3
                operands[0].type: REG = zero
                operands[0].access: WRITE
                operands[1].type: REG = ra
                operands[1].access: READ
                operands[2].type: IMM = 0x0
                operands[2].access: READ
        Registers read: ra
        Registers modified: zero
        Groups: jump

It there a reproducer where it does not work?

jiegec avatar Jun 15 '25 02:06 jiegec

Ouh, sorry. I guess I forgot you added it and didn't tick the box in the Auto-Sync issue. Thanks!

Rot127 avatar Jun 15 '25 12:06 Rot127