Skip to main content
Security Module

Python Marshal Decrypt

Reverse a marshal loader and recover readable Python source — base64-decode, decompress (zlib/zstd), unmarshal, decompile, plus disassembly and a downloadable .pyc. Runs 100% in your browser.

Why use this tool?

Use the Marshal Decrypt tool when you have a marshal loader — the exec(marshal.loads(base64.b64decode("…"))) shape produced by marshal "encryptors" and simple packers — and want the readable Python back. It extracts the base64 payload, decompresses it if the loader used zlib or zstd, unmarshals it into a code object, decompiles that to source, and also shows the full disassembly and a downloadable .pyc. It's the exact inverse of the Marshal Encryptor, and it runs entirely in your browser.

Advertisement
Marshal loader or base64 payload
Paste a marshal loader — e.g. exec(marshal.loads(base64.b64decode("...")))

Paste your own loader, or generate one with the Marshal Encryptor to try it.

Pick the Python version the loader was built for — bytecode is version-locked, so the disassembly and source recovery are only correct on a matching runtime. "Auto-detect" reads the compression (zlib/zstd) from the loader itself.

Runs in your browser. Recovered source is a best-effort reconstruction from bytecode — simple code comes back cleanly, but complex code can be partial, comments/spacing/quote style are lost, and names removed by obfuscation can't be restored. Producing valid Python doesn't prove it behaves identically to the original. If you ship Python and need a check that survives being unmarshalled, keep the decision on a server with a license system like Licers.

The blob just decoded itself

If unmarshaling brings the code back, so does the license check inside it.

A marshal loader is just a code object the interpreter has to run, so it decodes straight back to constants, strings and control flow — a hard-coded key or trial check comes out with it, ready to be read or patched. Encoding only slows someone down. Licers keeps the decision on a server with Ed25519-signed, device-bound responses, so a recovered or patched client still can't forge a valid license.

Add real licensing, free

Tool facts

Supported Python
Python 3.10 – 3.14 (match the build)
Input limit
Limited only by your device
Last reviewed
2026-09-05

What it can't do

  • Guarantee exact original source — recovery is best-effort; complex code can come back partial or slightly wrong.
  • Restore comments, blank lines, or the original quote style — those aren't stored in bytecode.
  • Un-obfuscate names — identifiers already renamed by an obfuscator stay renamed.
  • Recover Python 3.14 source yet — the decompiler can't read that bytecode; you get disassembly + a .pyc.

About Python Marshal Decrypt

A marshal loader isn't encrypted — it's encoded. marshal.dumps() serializes a compiled code object to bytes; base64 makes those bytes printable; zlib or zstd (optionally) shrink them. The loader reverses that chain at import time and hands the code object to exec(). This tool does the same reversal but never runs your code: base64-decode, decompress, then marshal.loads() to recover the code object — then a decompiler (pycdc / Decompyle++, compiled to WebAssembly) rebuilds readable source, with the exact disassembly and a rebuilt .pyc alongside it.

Recovery is best-effort and depends on the Python version, because a code object's format changes between releases. In practice pycdc rebuilds clean source through Python 3.12, partial source on 3.13 (the newest opcodes can't always be reconstructed), and can't yet read 3.14 bytecode at all — for 3.14 you get the complete disassembly and a .pyc to try elsewhere. Pick the version the loader was built for and the tool loads the matching CPython (via Pyodide) so opcodes decode correctly and the .pyc carries the right magic number. "Auto-detect" reads the compression (zlib/zstd) from the loader text.

Be clear-eyed about what a decompiler can and can't return: comments, blank lines and quote style are gone (bytecode doesn't store them), names already scrambled by an obfuscator stay scrambled, and producing valid-looking Python doesn't prove it behaves identically to the original — always sanity-check against the disassembly. For a second opinion, download the .pyc and run it through the dedicated .pyc decompiler, or inspect opcodes with the bytecode disassembler. The Marshal Encryptor builds these loaders; how Python marshal works and reversing marshal-obfuscated bytecode go deeper.

Frequently Asked Questions

It recovers readable Python by decompiling the bytecode — but it's a best-effort reconstruction, not the exact original file. Simple code comes back cleanly; complex code can be partial or slightly different. Comments, blank lines and quote style aren't stored in bytecode so they're lost, and names already scrambled by an obfuscator stay scrambled. Producing valid Python doesn't prove it behaves identically — check it against the disassembly tab.