Skip to main content

PyMemDump - Python 内存转储工具

GitHub license GitHub stars

PyMemDump 是一个用于转储系统进程内存的工具。它支持按进程名或PID指定目标进程,并将内存内容导出到指定的文件中。该工具还支持并发导出、指定地址范围导出、多种内容格式化选项等功能。

功能特点

  • 多语言支持:支持英文(en_US)和中文(zh_CN)。
  • 灵活的目标进程指定:可以通过进程名或PID指定目标进程。
  • 并发导出:支持多线程并发导出,提高导出效率。
  • 指定地址范围导出:可以指定内存地址范围进行导出。
  • 多种内容格式:支持hex、bin、ascii等多种内容格式。
  • 详细的日志记录:提供详细的日志信息,方便调试和问题追踪。

安装

通过pip安装

pip install PyMemDump

从源代码安装

  1. 克隆仓库:

    git clone https://github.com/Fuxuan-CN/PyMemDump.git
    
  2. 进入目录并安装依赖:

    cd PyMemDump
    pip install -r requirements.txt
    

使用方法

命令行接口

PyMemDump 提供了命令行接口,用户可以通过命令行参数灵活配置导出选项。以下是一些常用的命令行参数:

python -m PyMemDump --help

示例

  • 全内存导出:

    python -m PyMemDump --process notepad.exe --output ./dumps
    
  • 并发导出:

    python -m PyMemDump --process notepad.exe --output ./dumps --concurrent --workers 4
    
  • 指定地址范围导出:

    python -m PyMemDump --process notepad.exe --output ./dumps --by_addr --start-address 0x10000000 --end-address 0x10010000
    
  • 扫描内存地址并保存到JSON文件:

    python -m PyMemDump --process notepad.exe --scan_addr
    

Python接口

你也可以通过Python代码直接使用PyMemDump的功能:

from PyMemDump import MemoryDumper

dumper = MemoryDumper(process_desc="notepad.exe", save_path="./dumps")
dumper.dump()

国际化支持

  • PyMemDump支持多语言,你可以如下操作切换语言:
from PyMemDump import MemoryDumper

MemoryDumper.dump_with_args(language="zh_CN")
  • 不过一般来说,这个会自动检测语言来输出相应的提示信息。
python -m PyMemDump --help

目前支持的语言有:

  • 英文(en_US)

  • 中文(zh_CN)

  • 法语 (fr_FR)

  • 想帮忙添加语言?

查看下列文档来帮助你如何添加新语言;

日志记录

PyMemDump 提供了详细的日志记录功能,帮助用户跟踪内存导出过程中的问题。日志信息会显示在控制台,并且可以通过配置文件保存到文件中。

注意事项

  • 确保目标进程正在运行,否则会报错。
  • 确保输出目录存在且可写。
  • 在某些操作系统或环境中,可能需要管理员权限才能访问某些进程的内存。

贡献

欢迎贡献代码或报告问题!你可以通过以下方式参与:

  • 提交Pull Request
  • 提交Issue
  • 编写lang.json文件翻译

许可证

PyMemDump 采用 MIT 许可证,详情请参阅 LICENSE 文件。

联系方式

  • GitHub: Fuxuan-CN
  • Email: fuxuan001@foxmail.com
  • QQ: 3072252442
  • WeChat: Ricky-zhang1018

Metadata

Release files for PyMemDump 0.2.1.post7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyMemDump 0.2.1.post7
File Size Uploaded Provenance Actions
pymemdump-0.2.1.post7.tar.gz 25.6 kB Without provenance Details for pymemdump-0.2.1.post7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PyMemDump 0.2.1.post7
File Interpreter ABI Platform Actions
pymemdump-0.2.1.post7-py3-none-any.whl Python 3 none any Details for pymemdump-0.2.1.post7-py3-none-any.whl

Total release size: 56.4 kB

Release files / pymemdump-0.2.1.post7.tar.gz

Download URL pymemdump-0.2.1.post7.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b35f72ed7c1e75a6bb10c11ce8716e20f8de55be63496f13aa40b643ee7a74bd
BLAKE2b-256 checksum
How to use checksums
cc783241d9576b95f8e93433f89be8af7edb567c970a68ce554ea35914c8f810
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pymemdump-0.2.1.post7-py3-none-any.whl

Download URL pymemdump-0.2.1.post7-py3-none-any.whl
Size 30.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2e3f0a333a115f603a40f5441dfdbd62449c2464303af4f6cefc3a6fdf5e0d9
BLAKE2b-256 checksum
How to use checksums
b03ee52b6cf9a44e45a9c1ee9494ac1453e4be41a1d4c8624a9db3b8b5153fe0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for PyMemDump 0.2.1.post7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1.post7 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page