小编Inc*_*ace的帖子

CS:覆盖对 IDA 输出中全局变量的访问,如 mov eax、cs:x?

我正在编写简单的程序然后分析它们。今天我写了这个:

#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 …

assembly x86-64 ida disassembly addressing-mode

2
推荐指数
1
解决办法
65
查看次数

标签 统计

addressing-mode ×1

assembly ×1

disassembly ×1

ida ×1

x86-64 ×1