如何从 objdump 获取信息

发布于 2024-08-27 02:41:47 字数 1464 浏览 5 评论 0原文

我在读取 Linux 中的可执行文件中转储的信息时遇到问题。 信息如下:

804a0ea:  04 08            add $0x8, %al
     ...
804a0f4:  a6               cmpsb %es:(%edi),%ds:(%esi)

我有两个问题:

  1. 地址804a0ea和804a0f4是什么意思?进程地址空间中的虚拟地址?
  2. ... 是什么意思?如何获取地址 804a0f0 处的指令?

提前致谢。

有关这部分代码的更多信息:

Disassembly of section .got.plt:

    0804a0e8 <_GLOBAL_OFFSET_TABLE_>:
     804a0e8:       14 a0                   adc    $0xa0,%al
     804a0ea:       04 08                   add    $0x8,%al
            ...
     804a0f4:       a6                      cmpsb  %es:(%edi),%ds:(%esi)
     804a0f5:       87 04 08                xchg   %eax,(%eax,%ecx,1)
     804a0f8:       b6 87                   mov    $0x87,%dh
     804a0fa:       04 08                   add    $0x8,%al
     804a0fc:       c6 87 04 08 d6 87 04    movb   $0x4,-0x7829f7fc(%edi)
     804a103:       08 e6                   or     %ah,%dh
     804a105:       87 04 08                xchg   %eax,(%eax,%ecx,1)
     804a108:       f6 87 04 08 06 88 04    testb  $0x4,-0x77f9f7fc(%edi)
     804a10f:       08 16                   or     %dl,(%esi)
     804a111:       88 04 08                mov    %al,(%eax,%ecx,1)
     804a114:       26 88 04 08             mov    %al,%es:(%eax,%ecx,1)
     804a118:       36 88 04 08             mov    %al,%ss:(%eax,%ecx,1)
     804a11c:       46                      inc    %esi

希望任何人都可以帮助我。:-)

I encounter a problem when reading information dumped out from an executable file in linux.
The information is as follows:

804a0ea:  04 08            add $0x8, %al
     ...
804a0f4:  a6               cmpsb %es:(%edi),%ds:(%esi)

I have two questions:

  1. what does the address 804a0ea and 804a0f4 mean? the virtual address in the process's address space?
  2. what does the ... mean? how can I get instruction at address 804a0f0?

Thanks in advance.

More information around this part of code:

Disassembly of section .got.plt:

    0804a0e8 <_GLOBAL_OFFSET_TABLE_>:
     804a0e8:       14 a0                   adc    $0xa0,%al
     804a0ea:       04 08                   add    $0x8,%al
            ...
     804a0f4:       a6                      cmpsb  %es:(%edi),%ds:(%esi)
     804a0f5:       87 04 08                xchg   %eax,(%eax,%ecx,1)
     804a0f8:       b6 87                   mov    $0x87,%dh
     804a0fa:       04 08                   add    $0x8,%al
     804a0fc:       c6 87 04 08 d6 87 04    movb   $0x4,-0x7829f7fc(%edi)
     804a103:       08 e6                   or     %ah,%dh
     804a105:       87 04 08                xchg   %eax,(%eax,%ecx,1)
     804a108:       f6 87 04 08 06 88 04    testb  $0x4,-0x77f9f7fc(%edi)
     804a10f:       08 16                   or     %dl,(%esi)
     804a111:       88 04 08                mov    %al,(%eax,%ecx,1)
     804a114:       26 88 04 08             mov    %al,%es:(%eax,%ecx,1)
     804a118:       36 88 04 08             mov    %al,%ss:(%eax,%ecx,1)
     804a11c:       46                      inc    %esi

Hope anyone can give me a hand.:-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甜警司 2024-09-03 02:41:47
  1. 仅将汇编代码复制到文本编辑器
  2. 在第一行输入 main: ( assembly for main())
  3. 并将文件另存为 *.s
  4. 打开终端并输入 gcc -s -o 进行编译
    或输入终端 gdb
    然后输入布局asm并输入然后打印
  1. Copy only the assembly code to the text editor
  2. On the first line type main: (assembly for main())
  3. And save the file as a *.s
  4. Open terminal and type gcc -s -o to compile
    or type in terminal gdb
    and then type layout asm and type then print
丿*梦醉红颜 2024-09-03 02:41:47

全局偏移表不是指向代码,它指向数据(hrm...实际上是偏移量)。因此尝试反汇编它不会给出非常有意义的代码。 (您实际上可以通过查看代码值来找到哪些偏移量。0804a014,... 080487a6)。

... 通常表示流中存在一堆 0。

The global offset table is not pointing to code, it's pointing to data (hrm... offsets, actually). So trying to disassemble it will not give very meaningful code. (you can actually find which offsets by looking at the code values. 0804a014, ... 080487a6).

The ... usually mean a bunch of 0's are in the stream.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文