不确定数据段反汇编中的一些指令
Uncertain about some instructions in disassembly of data section
我编写了以下汇编程序,但我不确定某些编译指令的含义以及 objdump
.
表示的语法
使用 gcc 版本 4.4.3 编译,linux 内核版本 2.6.32-21
hello.S:
.global _start
.global main
.section .text
_start:
call main
movl , %eax
movl [=10=], %ebx
int [=10=]x80
main:
// Print "Hello World" to the screen
movl , %eax
movl , %ebx
movl $hello, %ecx
movl , %edx
int [=10=]x80
// Exit programme with return value 0
movl , %eax
movl [=10=], %ebx
int [=10=]x80
.section .data
hello: .string "Hello world!\n"
并用命令编译
gcc -nostdlib hello.S -o hello
生成以下指令,特别是在 .data
部分下:gs
、insb
和 outsl
;这些说明的目的是什么?
.data 部分的反汇编:
080490ec <hello>:
80490ec: 48 dec %eax
80490ed: 65 gs
80490ee: 6c insb (%dx),%es:(%edi)
80490ef: 6c insb (%dx),%es:(%edi)
80490f0: 6f outsl %ds:(%esi),(%dx)
80490f1: 20 77 6f and %dh,0x6f(%edi)
80490f4: 72 6c jb 8049162 <_end+0x66>
80490f6: 64 21 0a and %ecx,%fs:(%edx)
此外,语法如 %ds:(%esi),(%dx)
- 这是什么意思?
为了不对 .data
部分进行不恰当的反汇编,不要使用 objdump
选项
-D
, --disassemble-all
显示所有段的汇编程序内容
而是
-d
、--disassemble
显示可执行部分的汇编程序内容
此外
-s
、--full-contents
显示请求的所有部分的完整内容
获取数据转储:
Contents of section .data:
80490a8 48656c6c 6f20776f 726c6421 0a00 Hello world!..
我编写了以下汇编程序,但我不确定某些编译指令的含义以及 objdump
.
使用 gcc 版本 4.4.3 编译,linux 内核版本 2.6.32-21
hello.S:
.global _start
.global main
.section .text
_start:
call main
movl , %eax
movl [=10=], %ebx
int [=10=]x80
main:
// Print "Hello World" to the screen
movl , %eax
movl , %ebx
movl $hello, %ecx
movl , %edx
int [=10=]x80
// Exit programme with return value 0
movl , %eax
movl [=10=], %ebx
int [=10=]x80
.section .data
hello: .string "Hello world!\n"
并用命令编译
gcc -nostdlib hello.S -o hello
生成以下指令,特别是在 .data
部分下:gs
、insb
和 outsl
;这些说明的目的是什么?
.data 部分的反汇编:
080490ec <hello>:
80490ec: 48 dec %eax
80490ed: 65 gs
80490ee: 6c insb (%dx),%es:(%edi)
80490ef: 6c insb (%dx),%es:(%edi)
80490f0: 6f outsl %ds:(%esi),(%dx)
80490f1: 20 77 6f and %dh,0x6f(%edi)
80490f4: 72 6c jb 8049162 <_end+0x66>
80490f6: 64 21 0a and %ecx,%fs:(%edx)
此外,语法如 %ds:(%esi),(%dx)
- 这是什么意思?
为了不对 .data
部分进行不恰当的反汇编,不要使用 objdump
选项
-D
,--disassemble-all
显示所有段的汇编程序内容
而是
-d
、--disassemble
显示可执行部分的汇编程序内容
此外
-s
、--full-contents
显示请求的所有部分的完整内容
获取数据转储:
Contents of section .data: 80490a8 48656c6c 6f20776f 726c6421 0a00 Hello world!..