2025-07-03 20:55:55 -03:00
# Ryūjin Protector
2025-11-05 21:37:19 -03:00
**Ryūjin Protector** is an open-source Bin2Bin obfuscation, protection, and DRM tool for Windows PE binaries targeting the Intel x64 architecture (x86_64 only).
2025-07-03 20:55:55 -03:00
2025-07-13 20:05:55 -03:00
<p align="center">
2025-11-05 21:37:19 -03:00
<img src="imgs/ryujinreadme.png" alt="Ryūjin Protector Banner" width="70%">
2025-07-13 20:05:55 -03:00
</p>
2025-07-03 20:55:55 -03:00
---
2025-11-05 21:37:19 -03:00
## Overview
2025-07-03 20:55:55 -03:00
2025-11-05 21:37:19 -03:00
Ryūjin is a research-grade protector and obfuscator built to explore Bin2Bin transformation techniques. It is suitable for security researchers, reverse engineers, anti-cheat and anti-tamper developers, and others studying binary protection. Ryūjin focuses on transforming binaries while preserving original program semantics.
---
2025-07-03 20:55:55 -03:00
## Features
2025-11-05 21:37:19 -03:00
- Junk code insertion and code mutation (randomized while preserving original logic)
- IAT call access obfuscation (with obfuscated handler access)
- Random section naming (default: `Ryujin` )
- Mathematical operator virtualization (Ryūjin MiniVM)
- Mathematical operator virtualization with Hyper-V isolation (MiniVM + Hyper-V)
- Encrypted code sections (TeaDelKew algorithm)
- Anti-debug (user-mode and kernel-mode)
- TrollReversers (can induce BSOD during reversing attempts)
- Anti-dump protections
- Anti-disassembly and anti-decompiler techniques
- Memory integrity protection (CRC32-based)
- Custom pass support (includes **MBA-linear Obfuscation Pass ** and community passes)
- And more, see the wiki for a complete list
2025-07-03 20:55:55 -03:00
---
2025-07-13 20:05:55 -03:00
## Demos and Presentations
2025-07-03 20:55:55 -03:00
2025-11-05 21:37:19 -03:00
Ryūjin is intended primarily as a study and research tool. Below are small demos showing a `main` function before and after a Ryūjin pass:
2025-07-03 20:55:55 -03:00

2025-11-05 21:37:19 -03:00
> This demo shows one feature; combining multiple features produces stronger obfuscation. See the Ryūjin Wiki for full examples and explanations.
2025-07-03 20:55:55 -03:00
2025-11-05 21:37:19 -03:00
### Modes of use
2025-07-13 20:05:55 -03:00
2025-11-05 21:37:19 -03:00
Ryūjin supports both CLI and GUI:
2025-07-13 20:05:55 -03:00
2025-11-05 21:37:19 -03:00
- **CLI:** Full functionality and advanced options for expert/research users.
- **GUI:** Simplified interface for quick runs (requires `wxWidgets` ).
2025-07-13 20:05:55 -03:00
2025-11-05 21:37:19 -03:00
CLI demo:
2025-07-13 20:05:55 -03:00

2025-11-05 21:37:19 -03:00
GUI demo:

2025-07-13 20:05:55 -03:00
2025-11-05 21:37:19 -03:00
**Input requirements:** a PE executable (EXE) for x64 and its PDB file containing symbols. The PDB is required to enable several transformation passes that rely on symbol information.
2025-07-03 20:55:55 -03:00
2025-11-05 21:37:19 -03:00
---
2025-07-27 11:10:32 -03:00
## Custom Pass Support
2025-11-05 21:37:19 -03:00
Ryūjin supports custom passes through a simple callback model. A custom pass receives a `RyujinProcedure` instance and can modify basic blocks, scopes, or other procedure-level structures.
2025-07-27 11:10:32 -03:00
2025-11-05 21:37:19 -03:00
Example callback signature:
2025-07-27 11:10:32 -03:00
```c++
void RyujinCustomPassDemo(RyujinProcedure* proc);
2025-11-05 21:37:19 -03:00
````
See the class definition here:
**[RyujinProcedure.hh ](https://github.com/keowu/Ryujin/blob/main/RyujinCore/Ryujin/Models/RyujinProcedure.hh ).**
2025-07-27 11:10:32 -03:00
2025-11-05 21:37:19 -03:00
Example usage is included here:
**[RyujinCustomPasses.hh ](https://github.com/keowu/Ryujin/blob/main/RyujinConsole/RyujinConsole/RyujinCustomPasses.hh#L11 ).**
2025-07-27 11:10:32 -03:00
2025-11-05 21:37:19 -03:00
No additional configuration changes are required. `RyujinObfuscatorConfig` already exposes the settings needed to register and run custom passes.
---
## Ryūjin Bin2Bin Obfuscator Core - Structure/Design Diagram
<div style="max-width:100%; max-height:600px; overflow:auto; border:1px solid #ddd ; padding:4px;">
<img src="Diagrams/ryujin_core.png" alt="Large view" style="display:block; max-width:none;">
</div>
---
2025-07-27 11:10:32 -03:00
## Dependencies
2025-11-05 21:37:19 -03:00
Install dependencies via [Microsoft vcpkg ](https://github.com/microsoft/vcpkg ):
2025-07-27 11:10:32 -03:00
2025-11-05 21:37:19 -03:00
```bash
2025-07-27 11:10:32 -03:00
vcpkg install asmjit
vcpkg install zydis
2025-11-03 21:32:54 -03:00
vcpkg install z3
2025-07-27 11:10:32 -03:00
```
2025-11-05 21:37:19 -03:00
Recommended versions for a consistent build environment:
2025-07-27 11:10:32 -03:00
```
asmjit:x64-windows - 2024-06-28
2025-11-05 21:37:19 -03:00
zycore:x64-windows - 1.5.0
zydis:x64-windows - 4.1.0
z3:x64-windows - 4.13.0
2025-07-27 11:10:32 -03:00
```
2025-11-05 21:37:19 -03:00
Optional dependency for the GUI:
- `wxWidgets` - obtain from [https://wxwidgets.org/downloads/ ](https://wxwidgets.org/downloads/ )
2025-07-27 11:10:32 -03:00
2025-11-05 21:37:19 -03:00
---
2025-07-27 11:10:32 -03:00
## Research Paper
2025-11-11 20:32:17 -03:00
> To better understand Ryūjin, please read the research paper below:
[**Ryūjin - Writing a Bin2Bin Obfuscator from Scratch for Windows PE x64 and Fully Deobfuscating It** ](https://keowu.re/posts/Ry%C5%ABjin---Writing-a-Bin2Bin-Obfuscator-from-Scratch-for-Windows-PE-x64-and-Fully-Deobfuscating-It )
2025-07-27 11:10:32 -03:00
2025-11-05 21:37:19 -03:00
---
2025-07-03 20:55:55 -03:00
## Getting Started
2025-11-05 21:37:19 -03:00
For usage examples, flags, advanced options, and full explanations of each feature, see the
2025-11-06 21:31:13 -03:00
[Ryūjin Wiki ](https://github.com/keowu/Ryujin/wiki/Ry%C5%ABjin-Wiki ).
2025-11-05 21:37:19 -03:00
---
## License
**TODO**