https://github.com/wtdcode/simplepeviewer
A Simple PE Viewer written by python.
https://github.com/wtdcode/simplepeviewer
Last synced: 3 months ago
JSON representation
A Simple PE Viewer written by python.
- Host: GitHub
- URL: https://github.com/wtdcode/simplepeviewer
- Owner: wtdcode
- License: gpl-3.0
- Created: 2017-08-09T17:10:42.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-11T13:23:52.000Z (almost 8 years ago)
- Last Synced: 2025-01-25T05:41:18.061Z (4 months ago)
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SimplePEViewer
## Introduction
A Simple PE Viewer.
Although someone has developed a [better one](https://github.com/erocarrera/pefile), I'd like to try it myself.
## Install
I haven't package it, so just download PEFile.py and import it like a module.
## Usage
First import the module.
```python
from PEFile import PEFile
```And then open a file.
```python
file = PEFile(path_to_your_file)
```If the file doesn't exist, it will raise an error.
Next, read the header.
```python
file.readheader()
```The PE Header is stored in dict, like the struct in C.
```python
file.IMAGE_DOS_HEADER['e_lfanew']
file.IMAGE_NT_HEADERS['Signature']
```Also, some headers array are in list, like:
```python
file.IMAGE_SECTION_HEADER[0]['Name']
```Note: All stored value is bytes, if you expect a human-readable format, try this.
```python
file.IMAGE_NT_HEADERS['Signature'].hex()
```## Recent Change
I have decided to **stop** the development.
It is much more complicated than I expected before, so I just develop a few basic functions to understand the PE format.