> For the complete documentation index, see [llms.txt](https://easyauth.papelship.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://easyauth.papelship.com/documentation/best-practies/obfuscation-compilation.md).

# Obfuscation Compilation

EasyAuth static libraries (`qPapelEasyAuth.lib`) can be built with state-of-the-art LLVM-based obfuscators like **OLLVM (LLVM 16)** or **Pluto (Hikari/Goron)** to provide military-grade binary hardening against decompilation.

***

## Obfuscation Passes Applied

When compiling EasyAuth with Polaris or Pluto:

* **Control Flow Flattening (`fla`)**: Breaks basic blocks into an indirect switch state machine, rendering decompiled control flow graphs unreadable.
* **Mixed Boolean Arithmetic (`mba` / `sub`)**: Replaces standard arithmetic instructions (add, xor, and) with polynomial algebraic expansions.
* **Bogus Control Flow (`bcf`)**: Injects opaque predicates and dead code loops that confuse IDA Pro and Ghidra disassemblers.
* **Indirect Branching & Calls (`indcall`, `indbr`)**: Obfuscates function calls through encrypted pointer tables.
* **Global Variable Encryption (`gvenc`)**: Encrypts all internal state tables and strings in memory.

## Important x64 ABI Guidelines

When building static C++ libraries intended to be consumed by Microsoft Visual C++ (`cl.exe` / MSVC v143):

{% hint style="danger" %}
**Do NOT use Custom Calling Conventions (`ccc`) on Public API exports**:

MSVC expects standard Microsoft x64 Calling Convention (`RCX`, `RDX`, `R8`, `R9`). Using `ccc` on exported functions will cause stack/register mismatch crashes when linked into MSVC host projects.
{% endhint %}

{% hint style="warning" %}
**Pluto & Structured Exception Handling (SEH)**:

Do not apply `--bcf` to functions containing `try / catch` blocks in LLVM 16, as LLVM's prologue insertion can crash during frame finalization. Use `--fla`, `--sub`, and `--split` instead.
{% endhint %}
