A graphical tool for loading, disassembling, and emulating Windows PE (Portable Executable) files. Built with Python, PyQt5, pefile, capstone, and unicorn.
- Load and inspect PE files (.exe)
- Disassemble entry point code (user-selectable byte count)
- Emulate entry point execution and display register/stack state
- Simulated call stack trace on emulation error
- Graphical register display
- GPLv3 licensed, with About box and full compliance
- Python 3.13+
- Linux (tested)
git clone https://github.com/drazisil/ptool.git
cd ptoolpoetry installpoetry run python src/main.py- Click Open PE File and select a Windows .exe file.
- Adjust the Disassembly bytes spinner to control how many bytes to disassemble at the entry point.
- The entry point and disassembly will be shown.
- Click Start Emulation to emulate the entry point and view register/stack state and call stack trace.
- Click About for license and contact information.
To build a standalone binary (Linux):
make build
# or, manually:
poetry run pyinstaller src/main.py --onefile --name pe-emulator \
--add-binary "/data/Code/ptool/.venv/lib/python3.13/site-packages/unicorn/lib/libunicorn.so.2:."The binary will be in the dist/ directory as pe-emulator.
src/peutils.py– PE file utilitiessrc/emulator.py– Unicorn emulation helperssrc/pe_analysis.py– High-level PE analysis and emulation logicsrc/gui.py– PyQt5 GUIsrc/main.py– Launches the GUIMakefile– Common development tasks (install, lint, format, test, build, clean)pyproject.toml– Poetry/packaging configurationrequirements.txt,Pipfile– Exported dependency listsLICENSE,COPYING– License information
- Edit
pyproject.toml(orPipfile) to manage dependencies. - Run
make installorpoetry installto set up your environment. - Use
make lint,make format,make test, andmake buildfor common tasks. - To run tests (if/when added):
poetry run pytest # or pipenv run pytest
This project is licensed under the GNU GPLv3. See the COPYING or LICENSE file for details.
The About box in the GUI provides license and contact information as required by the GPL.