pe-analyzer 0.1.2
A Python module to analyze Portable Executable (PE) files on Windows systems. It parses and extracts various details about the file header, optional header, sections, imports, and exports. The module provides an easy-to-use class, PEAnalyzer, which returns analysis data in JSON format and supports pretty-printing of the information when used with the print() function.
License: MIT
Requires Python: >=3.10,<4.0

# PEAnalyzer

A Python module to analyze Portable Executable (PE) files on Windows systems. It parses and extracts various details about the file header, optional header, sections, imports, and exports. The module provides an easy-to-use class, `PEAnalyzer`, which returns analysis data in JSON format and supports pretty-printing of the information when used with the `print()` function.


|      Info      |                           Package                           |             CI/CD              |          Support            |
| :------------: | :---------------------------------------------------------: | :----------------------------: | :-------------------------: |
| [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pe-analyzer?logo=python&%230044aa&color=%230044aa&labelColor=%23dede00)](https://pypi.org/project/pe-analyzer/) | [![PyPI](https://img.shields.io/pypi/v/pe-analyzer?color=%2360d&label=latest%20%28pypi%29&logo=python&logoColor=%2360d&labelColor=%23101&style=flat)](https://pypi.org/project/pe-analyzer/) | [![Test](https://github.com/DJStompZone/PE-Analyzer/actions/workflows/codeql.yml/badge.svg)](https://github.com/DJStompZone/PE-Analyzer/actions/workflows/codeql.yml) | [![Discord Widget](https://img.shields.io/discord/599808270655291403?color=fff&logo=Discord&label=Discord&logoColor=fff&labelColor=000)](https://discord.io/stomp) |
| [![License](https://img.shields.io/pypi/l/pe-analyzer?color=%230044aa&labelColor=%23dede00&logoColor=%230044aa&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyBmaWxsPSIjMDA0NGFhIiBoZWlnaHQ9IjY0cHgiIHdpZHRoPSI2NHB4IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDIzNy43ODMgMjM3Ljc4MyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZ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3Ljg3MSw3Ljg3MS04My42NDksODMuNjQ3eiIvPgogIDwvZz4KPC9zdmc%2BCg%3D%3D)](https://github.com/DJStompZone/PE-Analyzer/blob/main/LICENSE) | [![PyPI - Wheel](https://img.shields.io/pypi/wheel/pe-analyzer?color=%2360d&logo=pypi&logoColor=%2360d&labelColor=%23101&style=flat)](https://pypi.org/project/pe-analyzer/) | [![Pytest](https://github.com/DJStompZone/PE-Analyzer/actions/workflows/pytest.yml/badge.svg)](https://github.com/DJStompZone/PE-Analyzer/actions/workflows/pytest.yml) | [![New Github Issue](https://img.shields.io/badge/GitHub-new%20issue-fff?&logo=github&logoColor=fff&labelColor=000)](https://github.com/DJStompZone/PE-Analyzer/issues/new/choose)


## Installation

To use PEAnalyzer, first, install the `pefile` library by running:

```
pip install pefile
```

Then, download or clone this repository to your project directory.

## Usage

To use the `PEAnalyzer` class, import it from the module and create an instance with the path to the PE file you want to analyze:

```python
from pe_analyzer import PEAnalyzer

file_path = "path/to/your/file.exe"
analyzer = PEAnalyzer(file_path)
```

To print the analysis data in a human-readable format, use the `print()` function:

```python
print(analyzer)
```

To get the analysis data as a JSON object, call the `analyze()` method:

```python
analysis_data = analyzer.analyze()
print(analysis_data)
```

## Support

#### You can create a new issue here: 

[![New Github Issue](https://img.shields.io/badge/GitHub-new%20issue-fff?logo=github&logoColor=fff&labelColor=333&style=for-the-badge)](https://github.com/DJStompZone/PE-Analyzer/issues/new/choose)

#### Or join my Discord server here:

[![Discord Widget](https://img.shields.io/discord/599808270655291403?color=2200cc&logo=discord&label=discord&logoColor=2200cc&labelColor=000&style=for-the-badge)](https://discord.io/stomp)


## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.