How to disassemble a memory range with GDB?

前端 未结 8 666
故里飘歌
故里飘歌 2020-12-04 08:03

I\'m trying to disassemble a program to see a syscall assembly instruction (the INT instruction, I believe) and the handler with GDB and have written a little program (see b

8条回答
  •  隐瞒了意图╮
    2020-12-04 08:39

    fopen() is a C library function and so you won't see any syscall instructions in your code, just a regular function call. At some point, it does call open(2), but it does that via a trampoline. There is simply a jump to the VDSO page, which is provided by the kernel to every process. The VDSO then provides code to make the system call. On modern processors, the SYSCALL or SYSENTER instructions will be used, but you can also use INT 80h on x86 processors.

提交回复
热议问题