Possible XED Bug

Possible XED Bug

Hi,

I am using the XED2 decoder in the Pin 2.21.53271 release to unit test a disassembler I'm writing, and I may have found a bug when generating textual output for a relative call.

Decoding the following bytes using XED and generating Intel or AT&T syntax generates the following:

Data: 40E8006F5D75 (XED_MACHINE_MODE_LONG_64, Instruction Address 0x00)
Intel: call 0x755d6f00
AT&T:  callq  0x755d6f00

The instruction is 0xE8 which is a "call rel32" and the description is "Call near, relative, displacement relative to the next instruction". The displacement is 0x755D6F00 and it is relative to rip + instructionLength which is 0 + 6. Should the call not be displaying the absolute target address and be "call 0x755d6f06" or "rip + length + displacement"?

Thanks for your time,
Paul

 

2 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Yeah... the thing that prints the address looks at the base addres and if it is nonzero, it does the right thing (adding in the in the instruction length and base address). In your case, you used a zero base address. I should probably have it include the instr length regardless of the given instruction runtime address.  It was assuming that a 0 runtime address (which is generally useless) meant the user wanted a more "raw decode". I'll change it. good idea. Thx.

% obj/xed -64 -b 0 -d 40E8006F5D75
ASSUMED BASE = 0
40E8006F5D75
ICLASS: CALL_NEAR CATEGORY: CALL EXTENSION: BASE IFORM: CALL_NEAR_RELBRd ISA_SET: I86
SHORT: call 0x755d6f00

% xed -64 -b 6 -d 40E8006F5D75
ASSUMED BASE = 6
40E8006F5D75
ICLASS: CALL_NEAR CATEGORY: CALL EXTENSION: BASE IFORM: CALL_NEAR_RELBRd ISA_SET: I86
SHORT: call 0x755d6f0c

% obj/xed -64 -b 1 -d 40E8006F5D75
ASSUMED BASE = 1
40E8006F5D75
ICLASS: CALL_NEAR CATEGORY: CALL EXTENSION: BASE IFORM: CALL_NEAR_RELBRd ISA_SET: I86
SHORT: call 0x755d6f07

Melden Sie sich an, um einen Kommentar zu hinterlassen.