Parse .NET executable files.
Project description
dnfile
Parse .NET executable files.
Free software: MIT license
Features
Parse as much as we can, even if the file is partially malformed.
Easy to use. Developed with IDE autocompletion in mind.
Quick Start
pip install dnfile
Then create a simple program that loads a .NET binary, parses it, and displays information about the streams and Metadata Tables.
import sys
import dnfile
filepath = sys.argv[1]
pe = dnfile.dnPE(filepath)
pe.print_info()
Everything is an object, and raw structure values are stored in an object’s “struct” attribute. The CLR directory entry object is accessible from the “net” attribute of a dnPE object.
pe = dnfile.dnPE(FILEPATH)
# access the directory entry raw structure values
pe.net.struct
# access the metadata raw structure values
pe.net.metadata.struct
# access the streams
for s in pe.net.metadata.streams_list:
if isinstance(s, dnfile.stream.MetaDataTables):
# how many Metadata tables are defined in the binary?
num_of_tables = len(s.tables_list)
# the first Metadata tables stream can also be accessed by a shortcut
num_of_tables = len(pe.net.mdtables.tables_list)
TODO
CI
Documentation on readthedocs
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.8.0 (2021)
bugfix: Metadata Table indexes (i.e. indexes into other tables) were off by one
0.7.1 (2021)
bugfix: coded index always None
0.7.0 (2021)
bugfix: improper data length check
0.6.0 (2021)
bugfix: referenced wrong object
parse utf-16 strings in #US stream
0.5.0 (2021-01-29)
First release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dnfile-0.8.0.tar.gz
.
File metadata
- Download URL: dnfile-0.8.0.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/59.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 086812e6ac89fe1cc69bc8a1ffe20cd33430a3286f384ba637dd5b54dd26d1b5 |
|
MD5 | 94cdffa3d5e4bd62f9d9930fa6bf7503 |
|
BLAKE2b-256 | 7f3c3088f1385f245483037fe6c6aa2446f2249c854b014067bf3baa6aa9b0ac |
Provenance
File details
Details for the file dnfile-0.8.0-py2.py3-none-any.whl
.
File metadata
- Download URL: dnfile-0.8.0-py2.py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/59.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8499eda89e8260952771523f9c0cce480c99b04e56d93044fa4cd95f6ec3163b |
|
MD5 | 8b5cfa15385a56a633e403dad007a2e1 |
|
BLAKE2b-256 | 0c0511b482a5ee499c3abeb1390fc34da52b6d748f58282f5321e0e61d43aa49 |