Registry / data / minidump

minidump

JSON →
library0.0.24pypypi✓ verified 85d ago

minidump is a Python library designed for parsing Windows minidump (.dmp) files. It allows developers and security researchers to programmatically extract information such as modules, threads, handles, and exception data from crash dumps. Currently at version 0.0.24, the library receives updates primarily for bug fixes and feature enhancements related to parsing accuracy and additional stream support.

pip install minidump
INSTALL
IMPORT
SIG · MINIDUMP
M
minidump
datapythonv0.0.24
Install
1.6s avg
Import
54ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.24 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.056s · 18.5MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.6s · import 0.051s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MinidumpFile
from minidump.minidumpfile import MinidumpFile

This example demonstrates how to parse a minidump file and access its basic streams like modules, threads, and exception records. It assumes a file named 'example.dmp' exists in the same directory. Note that for actual parsing, 'example.dmp' must be a valid Windows minidump file.

from minidump.minidumpfile import MinidumpFile import os # For this example, ensure 'example.dmp' exists in the current directory # and is a valid Windows minidump file. # You can create a dummy file for testing, but real parsing requires a valid minidump. minidump_path = os.path.join(os.path.dirname(__file__), 'example.dmp') # Create a dummy file if it doesn't exist, though it won't be a valid minidump # This is just to make the example runnable without crashing on FileNotFoundError if not os.path.exists(minidump_path): with open(minidump_path, 'w') as f: f.write('DUMMY MINIDUMP CONTENT - REPLACE WITH REAL .dmp FILE') print(f"Warning: '{minidump_path}' created as a dummy. Replace with a real minidump for actual parsing.") try: with open(minidump_path, 'rb') as f: md = MinidumpFile.parse(f) print(f"Successfully parsed minidump: {minidump_path}") # Accessing common streams if md.modules: print(f"\nModules found: {len(md.modules)}") for module in md.modules[:5]: # Print first 5 modules print(f" - {module.name} (Base: {hex(module.baseofdll)})") if md.threads: print(f"\nThreads found: {len(md.threads)}") for thread in md.threads[:5]: # Print first 5 threads print(f" - TID: {thread.threadid}, EIP: {hex(thread.stack.stackptr)}") if md.exceptions: print(f"\nException Record found: {md.exceptions.exceptionrecord.exceptioncode}") except FileNotFoundError: print(f"Error: Minidump file not found at '{minidump_path}'. Please ensure it exists.") except Exception as e: print(f"An error occurred during parsing: {e}") # Clean up dummy file if it was created and is still dummy content if os.path.exists(minidump_path) and os.path.getsize(minidump_path) > 0: with open(minidump_path, 'r') as f: content = f.read(100) # Read first 100 chars if 'DUMMY MINIDUMP CONTENT' in content: os.remove(minidump_path) print(f"Cleaned up dummy file: '{minidump_path}'.")
Debug
Known issues
gotchaParsing accuracy for MINIDUMP_EXCEPTION records and certain memory range (`inrange`) calculations was improved in versions 0.0.23 and 0.0.24. Older versions (prior to 0.0.23) may yield incorrect or incomplete data for these specific fields.
fix
Upgrade to `minidump>=0.0.24` to benefit from the latest parsing fixes and improvements.
affects: <0.0.23
gotchaMinidump files can be very large. The library handles file I/O, but ensure your system has sufficient memory and I/O capacity, especially when processing many or very large dumps. Buffered reading was introduced in version 0.0.17 for improved efficiency.
fix
Ensure you are using `minidump>=0.0.17` or newer for better performance, especially with large files. Always open files in binary read mode (`'rb'`).
affects: <0.0.17
gotchaThe library expects a valid minidump file. Providing a corrupted, incomplete, or non-minidump file will likely result in a `minidump.exceptions.MinidumpParseError` or other unexpected errors.
fix
Verify the integrity and format of your `.dmp` files before parsing. Consider adding robust error handling (`try-except`) around `MinidumpFile.parse()` calls.
affects: All
Errors
Common errors & fixes
FileNotFoundError: [Errno 2] No such file or directory: 'your_minidump.dmp'
The specified minidump file does not exist at the provided path.
fix
Ensure the file path is correct and the file exists. Use an absolute path or verify the relative path from your script's execution directory. Example: `MinidumpFile.parse(open('/path/to/your_minidump.dmp', 'rb'))`
minidump.exceptions.MinidumpParseError: Invalid minidump header
The file provided is either not a valid minidump file, is corrupted, or is not supported by the parser (e.g., an extremely old or malformed dump).
fix
Verify the integrity of your `.dmp` file. Try opening it with a dedicated minidump viewer (like WinDbg or a similar forensic tool) to confirm its validity. Ensure it's not truncated or corrupted.
AttributeError: 'MinidumpFile' object has no attribute 'threads'
You are attempting to access a stream (e.g., 'threads', 'modules', 'exceptions') that is not present in the specific minidump file you are parsing.
fix
Not all minidump files contain all possible streams. Always check if a stream exists before attempting to iterate or access its contents. Example: `if md.threads: for thread in md.threads: ...`
Upgrade
Version history
0.0.24latest on PyPI · released Aug 15, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
minidump — pip install minidump · libregistry