How to get the start address of the current process---Linux
Could yo开发者_StackOverflowu guys tell me how to get the start virtual address of the current process on linux? Any systems calls or facilities that would be helpful? Any guidance would be highly appreciated.
Check what does objdump
do to get that address. Then run it on /proc/self/exe
in your own code.
% 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
How about 'grep'ing the output of lsof?
lsof | grep <insert name of the program here>
精彩评论