我正在编写简单的程序然后分析它们。今天我写了这个:
#include <stdio.h>
int x;
int main(void){
printf("Enter X:\n");
scanf("%d",&x);
printf("You enter %d...\n",x);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
它被编译成这样:
push rbp
mov rbp, rsp
lea rdi, s ; "Enter X:"
call _puts
lea rsi, x
lea rdi, aD ; "%d"
mov eax, 0
call ___isoc99_scanf
mov eax, cs:x <- don't understand this
mov esi, eax
lea rdi, format ; "You enter %d...\n"
mov eax, 0
call _printf
mov eax, 0
pop rbp
retn
Run Code Online (Sandbox Code Playgroud)
我不明白什么cs:x意思。
我使用 Ubuntu x64、GCC 10.3.0 和 IDA …