Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

limba

> 编程语言
Open source

compile-time control flow obfuscation using mba

199 stars0 likes1 views
WebsiteGitHub

About

compile-time control flow obfuscation using mba

limba

Compile-time control flow obfuscation using MBA (Mixed Boolean-Arithmetic). This project is derived from another project I am working on named limbo, which is why the project files use this name. Keep in mind that this is more of a proof-of-concept rather than something ready to use in production code.

Description

Control flow between function calls is fairly easy to trace in normal binaries.

Pre-obfuscation pictures

limba will generate boilerplate code that obfuscates the actual jump address using MBA. The MBA rewrite rules and address offset is randomized each compilation to hinder analysis. It is important to note the actual function body is NOT obfuscated and is still present in the binary, only function calls will be obfuscated.

Post-obfuscation pictures

Support

  • The project has been developed using Clang(-CL) so this is the recommended compiler, GCC isn't actively supported and may (or may not) work. MSVC is not supported as I found no way to make it not emit a direct pointer to the original function
  • The codebase requires C++20 to compile. Compile time is a major constraint so I used a some C++20 features that reduced compilation time in my testing. The code can be modified to support C++17 (see emulation.h)

Usage

The included example uses premake for project configuration. You can generate the project files by running premake5 vs2022 in the root folder. Alternatively, the relevant header files can be copied into your own project.

Sample usage:

cpp
LIMBO_OBFUSCATED_FUNC(, , )
{
	// function body

	return 
}

Limitations

  • Only a small set of MBA rules have been included
  • Opaque predicates are needed to avoid trivial optimization
  • Since a protected function will only have one "wrapper" function, it's easy to figure out and patch the protection with dynamic analysis and scripting
  • Compilation time may be negatively impacted if the protection is used on a large number of functions

Acknowledgements

Great open-source projects that were a great help during development

  • https://github.com/JustasMasiulis/xorstr
  • https://github.com/llxiaoyuan/oxorany
  • https://github.com/Deniskore/nand_nor

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言