Skip to main content
CTF Support
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Python

Introduction

Decompilers allow you to recover source-like representations from compiled code such as Python bytecode or PyInstaller executables.

Quick Reference

Purpose Command / Tool
Decompile Python .pyc uncompyle6 file.pyc, pycdc file.pyc
Extract PyInstaller executables python pyinstxtractor.py target.exe
Decompile MicroPython .mpy files mpy-tool -d file.mpy

Tools

Tool Platform Purpose
uncompyle6 Python ≤ 3.8 Decompile .pyc bytecode
Decompyle++ Python ≥ 3.9 Alternative modern Python decompiler
pyinstxtractor Python EXE Decompile PyInstaller executables
pycdc Python C++ Decompiler for Python 2.x and 3.x
mpy-tool MicroPython Decompile MicroPython .mpy files

Tips

  • Some CTFs hide flags in string constants or hardcoded URLs visible only after decompilation.
  • When decompiling Python bytecode, pay attention to the Python version used, as it affects compatibility with decompilers.