Sponsored by Deepsite.site

Hallucina

Created By
smadi0x868 months ago
An LLVM-based obfuscation tool designed to confuse LLM clients interacting with custom MCP disassembler servers.
Content

Hallucina

Hallucina is a powerful obfuscation tool designed to confuse and hallucinate LLM clients that are used with custom MCP servers for disassemblers such as Ghidra and IDA PRO.

Hallucina makes human-driven reverse engineering mandatory, LLMs will not reverse engineer for us! Sorry Kiddos :)

Usage

Hallucina provides a simple interface for applying obfuscation techniques. Below are some examples of how to use it:

Obfuscating a Single File

To obfuscate a single source file using the generated clang (LLVM 17):

path_to_build/bin/clang -mllvm -irobf -mllvm --irobf-indbr test.c -o test_obfuscated

This command applies the obfuscation techniques specified by the flags -mllvm -irobf and -mllvm --irobf-indbr to the test.c file and generates an obfuscated output file named test_obfuscated.

Here you can see the difference between the original and obfuscated test code:

Diff

Obfuscating a Project

For larger projects, integrate Hallucina into your build system:

CC=path_to_build/bin/clang
CFLAGS+="-mllvm -irobf -mllvm --irobf-indbr"
./configure
make

Available Obfuscation Flags

  • Correlation between obfuscation processes.
  • Indirect jumps, encrypting the jump targets (-mllvm -irobf-indbr).
  • Indirect function calls, encrypting the target function addresses (-mllvm -irobf-icall).
  • Indirect global variable references, encrypting the variable addresses (-mllvm -irobf-indgv).
  • C string encryption (-mllvm -irobf-cse).
  • Procedure-related control flow flattening obfuscation (-mllvm -irobf-cff).
  • Comprehensive application of all the above features (-mllvm -irobf-indbr -mllvm -irobf-icall -mllvm -irobf-indgv -mllvm -irobf-cse -mllvm -irobf-cff).

Building Hallucina

Hallucina supports building with LLVM 17. Follow the instructions below to set up the build environment.

Prerequisites

Windows

  1. Install Ninja and ensure it is in your PATH.
  2. Install Visual Studio 2022 with the C++ development tools.

Linux

Run the following command to install prerequisites:

sudo apt update && sudo apt install -y build-essential cmake ninja-build python3

Build Instructions

Windows

  1. Open the x64 Native Tools Command Prompt for VS 2022.
  2. Run the following commands:
mkdir build
cd build
cmake -DCMAKE_CXX_FLAGS="/utf-8" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb" -G "Ninja" ../llvm
ninja

Linux

  1. Run the following commands:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb" -G "Ninja" ../llvm
ninja

Troubleshooting Common Issues

Compilation Errors

If you encounter errors during compilation, such as missing headers or GCC-specific issues, ensure the following:

  • Add #include <fstream> to any file reporting missing std::ifstream.
  • Use the latest version of GCC or Clang for compatibility.

Memory Issues During Build

If you encounter memory issues during the build process, you can increase the swap memory as follows:

Linux

Run the following commands to temporarily increase swap memory:

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

To make this change permanent, add the following line to /etc/fstab:

/swapfile none swap sw 0 0

Important Note

After building, use the generated clang binary located in the build/bin directory. This version of clang is based on LLVM 17 and includes the obfuscation features provided by Hallucina.


Contributing to Hallucina

We welcome contributions! See DEVELOPMENT.md for details on setting up your development environment and submitting pull requests.


License

This project is licensed under the GNU v3 License. See the LICENSE file for details.

References

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
CursorThe AI Code Editor
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
DeepChatYour AI Partner on Desktop
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
ChatWiseThe second fastest AI chatbot™