disassemble_section
Posted rtoax
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了disassemble_section相关的知识,希望对你有一定的参考价值。
Breakpoint 1, disassemble_section (abfd=0x6555f0, section=0x6588f8, inf=0x7fffffffd8f0) at ./objdump.c:3668
3668 unsigned int opb = pinfo->octets_per_byte;
(gdb) p *section
$11 = name = 0x65985c ".plt", next = 0x65b838, prev = 0x6587c8, id = 28, section_id = 0, index = 12, flags = 283,
user_set_vma = 1, linker_mark = 0, linker_has_input = 0, gc_mark = 0, compress_status = 0, segment_mark = 0,
sec_info_type = 0, use_rela_p = 1, sec_flg0 = 0, sec_flg1 = 0, sec_flg2 = 0, sec_flg3 = 0, sec_flg4 = 0,
sec_flg5 = 0, vma = 4198432, lma = 4198432, size = 32, rawsize = 0, compressed_size = 0, output_offset = 0,
output_section = 0x0, relocation = 0x0, orelocation = 0x0, reloc_count = 0, alignment_power = 4, filepos = 4128,
rel_filepos = 0, line_filepos = 0, userdata = 0x0, contents = 0x0, lineno = 0x0, lineno_count = 0, entsize = 0,
kept_section = 0x0, moving_line_filepos = 0, target_index = 0, used_by_bfd = 0x65a978, constructor_chain = 0x0,
owner = 0x6555f0, symbol = 0x65aa60, symbol_ptr_ptr = 0x6589e0, map_head = link_order = 0x0, s = 0x0,
linked_to_symbol_name = 0x0, map_tail = link_order = 0x0, s = 0x0, linked_to_symbol_name = 0x0,
already_assigned = 0x0, type = 0
(gdb) c
Continuing.
Disassembly of section .plt:
0000000000401020 <memset@plt-0x10>:
401020: ff 35 e2 2f 00 00 push 0x2fe2(%rip) # 404008 <_GLOBAL_OFFSET_TABLE_+0x8>
401026: ff 25 e4 2f 00 00 jmp *0x2fe4(%rip) # 404010 <_GLOBAL_OFFSET_TABLE_+0x10>
40102c: 0f 1f 40 00 nopl 0x0(%rax)
0000000000401030 <memset@plt>:
401030: ff 25 e2 2f 00 00 jmp *0x2fe2(%rip) # 404018 <memset@GLIBC_2.2.5>
401036: 68 00 00 00 00 push $0x0
40103b: e9 e0 ff ff ff jmp 401020 <_init+0x20>
objdump_print_symname (abfd=0x6d95f0, inf=0x7fffffffd960, sym=0x6e43a0) at ./objdump.c:1283
1283 const char *name, *version_string = NULL;
(gdb) n
1284 bool hidden = false;
(gdb) p *sym
$34 = the_bfd = 0x6d95f0, name = 0x6e43d0 "memset@plt", value = 16, flags = 2129930, section = 0x6dc8f8, udata =
p = 0x0, i = 0
(gdb) n
1286 alloc = NULL;
3821 addr = section->vma + addr_offset;
(gdb)
3822 addr = ((addr & ((sign_adjust << 1) - 1)) ^ sign_adjust) - sign_adjust;
(gdb) p addr
$47 = 4198432 = (0x 0000000000401020)
(gdb) n
3824 if (sym != NULL && bfd_asymbol_value (sym) <= addr)
(gdb) p addr
$49 = 4198432
(gdb) p section->vma
$50 = 4198432
(gdb) p b addr
No symbol "b" in current context.
(gdb) p sign_adjust
$51 = 0
(gdb) p addr
$3 = 4198432
(gdb) p section->vma
$4 = 4198432
(gdb) c
Continuing.
0000000000401020 <memset@plt-0x10>:
401020: ff 35 e2 2f 00 00 push 0x2fe2(%rip) # 404008 <_GLOBAL_OFFSET_TABLE_+0x8>
401026: ff 25 e4 2f 00 00 jmp *0x2fe4(%rip) # 404010 <_GLOBAL_OFFSET_TABLE_+0x10>
40102c: 0f 1f 40 00 nopl 0x0(%rax)
0000000000401030 <memset@plt>:
401030: ff 25 e2 2f 00 00 jmp *0x2fe2(%rip) # 404018 <memset@GLIBC_2.2.5>
401036: 68 00 00 00 00 push $0x0
40103b: e9 e0 ff ff ff jmp 401020 <_init+0x20>
以上是关于disassemble_section的主要内容,如果未能解决你的问题,请参考以下文章