在Linux中,如果我们查看/ proc / self / maps:
00400000-004ef000 r-xp 00000000 08:01 12845058 /bin/bash
006ef000-006f0000 r--p 000ef000 08:01 12845058 /bin/bash
006f0000-006f9000 rw-p 000f0000 08:01 12845058 /bin/bash
006f9000-006ff000 rw-p 00000000 00:00 0
00d5a000-010a2000 rw-p 00000000 00:00 0 [heap]
7f6fe582a000-7f6fe5835000 r-xp 00000000 08:01 1048595 /lib/x86_64-linux-gnu/libnss_files-2.19.so
7f6fe5835000-7f6fe5a34000 ---p 0000b000 08:01 1048595 /lib/x86_64-linux-gnu/libnss_files-2.19.so
7f6fe5a34000-7f6fe5a35000 r--p 0000a000 08:01 1048595 /lib/x86_64-linux-gnu/libnss_files-2.19.so
7f6fe5a35000-7f6fe5a36000 rw-p 0000b000 08:01 1048595 /lib/x86_64-linux-gnu/libnss_files-2.19.so
我想要Qnx的路径名和起始地址等信息。我怎样才能获得这些信息?
我的分析说Qnx中没有/ proc / self / maps文件。
答案 0 :(得分:1)
尝试使用它:
r.test(pin) && (pin.length == 4 || pin.length == 6)
答案 1 :(得分:0)
我们在QNX也有自己的文件!!
地址空间由/ proc中每个文件夹中名为“as”的二进制文件表示。 / proc / self / as包含当前进程的地址空间。
问题在于它不是人类直接可读的。您需要使用devctl()来读取它。以下是有关地址空间解码的所有devctl命令的链接。
示例 - devctl(“/ proc / self / as”,DCMD_PROC_TIDSTATUS,& debug_data,sizeof(debug_data)
此命令将为您提供struct _debug_thread_info结构中线程的调试数据。
类似地,DCMD_PROC_PAGEDATA和DCMD_PROC_MAPINFO可用于获取进程地址空间的段映射(在linux maps 文件中执行此操作)。
希望这有帮助。