Consider the C code below:
#include <stdio.h>
void greet(void){
printf("Hello!\n");
}
int main (){
greet();
return 0;
}
I compiled it with gcc to a 64-bit ELF called hello.
Then in my first experiment, I disassembled (decoded) the whole .text section using XED as follows:
./xed -i hello
I am interested in the function call to greet, which was disassembled as follows:
XDIS 1168: CALL BASE E8DCFFFFFF call 0x1149 <greet>
So far it looks fine since 0x1149 is truly the entry to the greet function.
But supposing that the string "E8DCFFFFFF" is the equivalent hex instruction, the confusion arises: in a second experiment with XED, I decided to disassemble only the function call instruction, i.e. the hex string "E8DCFFFFFF", as follows:
./xed -d E8DCFFFFFF
and here is the result:
ICLASS: CALL_NEAR
CATEGORY: CALL
EXTENSION: BASE
IFORM: CALL_NEAR_RELBRz
ISA_SET: I86
ATTRIBUTES: FIXED_BASE0 MPX_PREFIX_ABLE SCALABLE STACKPUSH0
SHORT: call 0xffffffe1
I was expecting call 0x1149 but I got call 0xffffffe1. Can anybody explain it please?