Closed kamiyaa closed 5 years ago
This also seems to be happening on x86:
// jmp
uint64 baseAddr = 0x7fa35d869657;
uint8_t buffer[40] = // e9d4feffff;
// Expected:
0x7fa35d869530
// Actual:
0x 5d869530 # 1569101104
Can you reproduce this with "cstool -d"?
like this?
./cstool -d x32 e9d4feffff 7fa35d869657
7fa35d869657 e9 d4 fe ff ff jmp 0x5d869530
ID: 172 (jmp)
Prefix:0x00 0x00 0x00 0x00
Opcode:0xe9 0x00 0x00 0x00
rex: 0x0
addr_size: 4
modrm: 0x0
disp: 0x0
sib: 0x0
imm_count: 1
imms[1]: 0x5d869530
op_count: 1
operands[0].type: IMM = 0x5d869530
operands[0].size: 4
Groups: branch_relative jump
./cstool -d x64 e9d4feffff 7fa35d869657
7fa35d869657 e9 d4 fe ff ff jmp 0x7fa35d869530
ID: 172 (jmp)
Prefix:0x00 0x00 0x00 0x00
Opcode:0xe9 0x00 0x00 0x00
rex: 0x0
addr_size: 8
modrm: 0x0
disp: 0x0
sib: 0x0
imm_count: 1
imms[1]: 0x7fa35d869530
op_count: 1
operands[0].type: IMM = 0x7fa35d869530
operands[0].size: 8
Groups: branch_relative jump
Sorry, it seems x86 was working properly after all. I will need to do more testing on zOS and ppc
It is reproducible for systemz
./cstool -d systemz ec180b6f007c 5024ab4566
5024ab4566 ec 18 0b 6f 00 7c cgije %r1, 0, 0x24ab5c44
ID: 89 (cgije)
op_count: 3
operands[0].type: REG = 1
operands[1].type: IMM = 0x0
operands[2].type: IMM = 0x24ab5c44
Groups: jump
Please provide expected output
Expected:
./cstool -d systemz ec180b6f007c 5024ab4566
5024ab4566 ec 18 0b 6f 00 7c cgije %r1, 0, 0x5024ab5c44
ID: 89 (cgije)
op_count: 3
operands[0].type: REG = 1
operands[1].type: IMM = 0x0
operands[2].type: IMM = 0x5024ab5c44
Groups: jump
Actual:
./cstool -d systemz ec180b6f007c 5024ab4566
5024ab4566 ec 18 0b 6f 00 7c cgije %r1, 0, 0x24ab5c44
ID: 89 (cgije)
op_count: 3
operands[0].type: REG = 1
operands[1].type: IMM = 0x0
operands[2].type: IMM = 0x24ab5c44
Groups: jump
Expected:
./cstool -d systemz ec9800058064 5024ab45a6
5024ab45a6 ec 98 00 05 80 64 cgrje %r9, %r8, 0x5024ab45b0
ID: 90 (cgrje)
op_count: 3
operands[0].type: REG = 9
operands[1].type: REG = 8
operands[2].type: IMM = 0x5024ab45b0
Groups: jump
Actual
./cstool -d systemz ec9800058064 5024ab45a6
5024ab45a6 ec 98 00 05 80 64 cgrje %r9, %r8, 0x24ab45b0
ID: 90 (cgrje)
op_count: 3
operands[0].type: REG = 9
operands[1].type: REG = 8
operands[2].type: IMM = 0x24ab45b0
Groups: jump
Expected:
./cstool -d systemz ec980261007d 5024ab5c38
5024ab5c38 ec 98 02 61 00 7d clgije %r9, 0, 0x5024ab60fa
ID: 92 (clgije)
op_count: 3
operands[0].type: REG = 9
operands[1].type: IMM = 0x0
operands[2].type: IMM = 0x5024ab60fa
Groups: jump
Actual:
./cstool -d systemz ec980261007d 5024ab5c38
5024ab5c38 ec 98 02 61 00 7d clgije %r9, 0, 0x24ab60fa
ID: 92 (clgije)
op_count: 3
operands[0].type: REG = 9
operands[1].type: IMM = 0x0
operands[2].type: IMM = 0x24ab60fa
Groups: jump
There may be others like this that I haven't come across, but I think its mostly the cg
, cgr
, clg
and jhe
instructions
fixed now, please confirm.
Thanks!
The upper 32bits of the immediate appears to be dropped at some point in the calculation.
Produced on
next
branch 0574f899e5be711895378ea0848f38808f4a5431Output:
Expected: