转储进程的内存

编程入门 行业动态 更新时间:2024-10-14 12:25:21
本文介绍了转储进程的内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在读取的/ proc / $ PID /映射你映射的内存区域。是疗法转储这个区域之一办法?

When reading the /proc/$PID/maps you get the mapped memory regions. Is ther a way to dump one of this regions?

$ cat /proc/18448/maps ...[snip]... 0059e000-005b1000 r-xp 00000000 08:11 40 /usr/local/lib/libgstlightning.so.0.0.0 005b1000-005b2000 r--p 00012000 08:11 40 /usr/local/lib/libgstlightning.so.0.0.0 005b2000-005b3000 rw-p 00013000 08:11 40 /usr/local/lib/libgstlightning.so.0.0.0 ...[snip]...

感谢

推荐答案

罗!呼叫 ptrace的() 与 ptrace的ATTACH 。然后打开 的/ proc /< PID> / MEM ,寻求区域偏移,并读取区域的长度给出的/ proc< / PID方式> /图

Nah! Call ptrace() with PTRACE ATTACH. Then open /proc/<pid>/mem, seek to the region offset, and read the length of the region as given in /proc</pid>/maps.

下面是我写一个程序做它在C.这里有一个模块,我写了做它在Python(和ptrace的结合)。对于完成,转储过程中各地区的文件程序。

Here's a program I wrote that does it in C. Here's a module I wrote that does it in Python (and the ptrace binding). For the finish, a program that dumps all regions of a process to files.

享受!

更多推荐

转储进程的内存

本文发布于:2023-11-13 02:27:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583168.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:内存   储进

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!