【问题标题】:How to get the start address of the current process---Linux如何获取当前进程的起始地址---Linux
【发布时间】:2011-05-11 08:05:47
【问题描述】:

你们能告诉我如何在linux上获取当前进程的起始虚拟地址吗?任何有帮助的系统调用或设施?任何指导将不胜感激。

【问题讨论】:

  • 我对这个主题了解不多。尝试使用 pmap 后跟 PID

标签: linux image entry-point


【解决方案1】:

检查objdump 做什么来获取该地址。然后用你自己的代码在/proc/self/exe 上运行它。

% objdump -f /proc/self/exe             

/proc/self/exe:     file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000000402f80

【讨论】:

    【解决方案2】:

    'grep' lsof 的输出怎么样?

    lsof | grep <insert name of the program here>
    

    【讨论】:

      猜你喜欢
      • 2018-12-18
      • 1970-01-01
      • 1970-01-01
      • 2012-07-18
      • 2019-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多