README.md

April 26, 2025 Β· View on GitHub


Astral-PE is a low-level mutator (headers obfuscator and patcher) for Windows PE files (.exe, .dll, .sys) that rewrites structural metadata after compilation (or postbuild protection) β€” without breaking execution.

It does not pack, encrypt or inject. Instead, it mutates low-hanging but critical structures like timestamps, headers, section flags, debug info, import/export names, and more.

πŸ›  Download Astral-PE build for Windows/Linux x64

πŸ”§ In what cases is it useful?

You’ve protected a binary β€” but public unpackers or YARA rules still target its unchanged structure.

πŸ‘¨πŸΌβ€πŸ’» Use Astral-PE as a post-processing step to:

  • Prevent automated unpacking
  • Break static unpacker logic
  • Invalidate reverse-engineering signatures
  • Disrupt clustering in sandboxes
  • Strip metadata, overlays (only if file is signed), debug traces...

🀩 Perfect for:

  • For packed/protected builds (e.g. legacy Enigma)
  • To create your own protector on this base
  • Hardened loaders that remain structurally default
  • To create interesting crackme quests
  • For educational purposes

✨ What it modifies

Astral-PE applies precise, compliant, and execution-safe mutations:

TargetDescription
πŸ•“ TimestampClears TimeDateStamp in file headers
🧠 Rich HeaderFully removed β€” breaks toolchain fingerprinting
πŸ“œ Section NamesWiped (.text, .rsrc, etc. β†’ null)
πŸ“Ž ChecksumReset to zero
πŸ“¦ OverlayStripped if file was signed
🧡 TLS DirectoryRemoved if unused
βš™ Load ConfigDeleted (if CFG not present)
🧬 RelocationsRemoved if not used in the file
🧱 Large Address AwareEnables 4 GB memory range for 32-bit processes
🧩 Header FlagsStripped: DEBUG_STRIPPED, LOCAL_SYMS_STRIPPED, LINE_NUMS_STRIPPED
🧼 Subsystem VersionMinimum OS and Subsystem versions set to zero
🧠 Stack & Heap ReserveIncreased to safe defaults (32/64 MB) if too low
πŸ“‹ Version InfoErased from optional header
πŸ“ Original FilenameLocated and zeroed in binary tail
πŸ”Ž Debug InfoPDB paths wiped, Debug Directory erased
πŸš€ Entry Point PatchReplaces or shuffles prologue, changes AddressOfEntryPoint...
πŸ§ͺ Import TableDLL names mutated: case, prefix, randomized formatting
🏷 Export TableFaked if absent (baits certain scanners)
πŸ“š Data DirectoryAll unused entries cleaned
πŸ’Ύ PermissionsR/W/X + code flags applied to all sections
πŸ“„ DOS StubReset to clean "MZ", patched e_lfanew

πŸ“ Does not support .NET binaries. Native PE only.

πŸš€ Usage

Astral-PE.exe <input.exe> -o <output.exe>
  • -o, --output β€” output file name (optional). Default output: <input>_ast.exe
  • -l, --legacy-win-compat-mode β€” specify to ensure compatibility with Windows 7, 8, or 8.1. Obfuscation will be less effective!
  • No args? Shows help

πŸ§ͺ Example

Astral-PE.exe payload.exe -o payload_clean.exe

πŸ“Ž Combination with other protections

Use Astral-PE after applying protectors.
Chain it into your CI, cryptor, or loader pipeline:

Build β†’ Any packer β†’ Astral-PE β†’ Sign β†’ Distribute

Or (A more effective way):

Build β†’ Astral-PE β†’ Any packer β†’ Astral-PE β†’ Sign β†’ Distribute

πŸ”¬ What it’s not

  • Not a cryptor
  • Not a stub injector
  • Not a runtime packer
  • Not a code obfuscator

It’s a surgical metadata cleaner and PE-headers/entrypoint obfuscator for post-processing protected binaries.

πŸ”Ž Before and after

A file compiled via Microsoft Visual C++ was chosen as a sample for demonstration.

File analyzers go crazy.

Scanned with Detect It Easy. No reliable verdicts other than the heuristic analysis.

Imports have become mutated.

This makes it very difficult for all existing PE file analyzers to analyze the file.

No debug data in PE!

Automatically remove references to PDB files, embedded debug information or other patterns that can simplify analysis (e.g. Rich signature)