Objdump
objdump é um programa para exibir várias informações sobre arquivos objeto em sistemas do tipo Unix. Por exemplo, ele pode ser usado como um desmontador para exibir um executável no formato de montagem. Faz parte do GNU Binutils para controle refinado sobre executáveis e outros dados binários.
Por exemplo,
$ objdump -D -M intel arquivo.bin | grep main.: -A20
Isso realiza a desmontagem no arquivo «arquivo.bin», com o código de montagem mostrado na sintaxe da Intel. Em seguida, o redirecionamos para o grep, que pesquisa a função principal e exibe 20 linhas de seu código.
Exemplo de saída:
4004ed: 55 push rbp
4004ee: 48 89 e5 mov rbp,rsp
4004f1: c7 45 ec 00 00 00 00 mov DWORD PTR [rbp-0x14],0x0
4004f8: c7 45 f0 01 00 00 00 mov DWORD PTR [rbp-0x10],0x1
4004ff: c7 45 f4 02 00 00 00 mov DWORD PTR [rbp-0xc],0x2
400506: c7 45 f8 03 00 00 00 mov DWORD PTR [rbp-0x8],0x3
40050d: c7 45 fc 04 00 00 00 mov DWORD PTR [rbp-0x4],0x4
400514: c7 45 ec 00 00 00 00 mov DWORD PTR [rbp-0x14],0x0
40051b: eb 13 jmp 400530 <main+0x43>
40051d: 8b 05 15 0b 20 00 mov eax,DWORD PTR [rip+0x200b15] # 601038 <globalA>
400523: 83 e8 01 sub eax,0x1
400526: 89 05 0c 0b 20 00 mov DWORD PTR [rip+0x200b0c],eax # 601038 <globalA>
40052c: 83 45 ec 01 add DWORD PTR [rbp-0x14],0x1
400530: 8b 05 02 0b 20 00 mov eax,DWORD PTR [rip+0x200b02] # 601038 <globalA>
400536: 39 45 ec cmp DWORD PTR [rbp-0x14],eax
400539: 7c e2 jl 40051d <main+0x30>
40053b: 5d pop rbp
40053c: c3 ret
40053d: 0f 1f 00 nop DWORD PTR [rax]
O objdump usa a biblioteca BFD para ler o conteúdo dos arquivos objeto.
Utilitários semelhantes são o Borland TDUMP, o Microsoft DUMPBIN e o readelf.
Ver também
Ligações externas
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.