A lightweight experimental C source code obfuscator written in C.
This tool currently supports:
- Function name obfuscation
- XOR string obfuscation
- Runtime string decryption
- Simple source rewriting
Functions are automatically renamed to randomized _0x... identifiers.
Example:
int main()becomes:
int _0xA92KJ()Strings are XOR encrypted using a static XOR key.
Example:
char* message_vars = "Hello";becomes:
char message_vars[] = {0xB7,0x9A,0x93,0x93,0x90,0x00};
_0xDECRYPT(message_vars);Strings are decrypted at runtime.
obfuscater.exe file.cExample:
obfuscater.exe test.cThe obfuscator currently uses simple text parsing and replacement.
Because of this, there are several important limitations you MUST follow.
Always declare strings using pointers:
char* text_vars = "Hello";char text_vars[] = "Hello";The current parser expects pointer-style declarations.
Only variables ending with _vars are selected for string obfuscation.
char* password_vars = "secret";char* password = "secret";If _vars is missing, the string will be ignored.
Example:
printf("Hello");Function argument strings are intentionally skipped.
However:
Some edge cases may still accidentally get obfuscated depending on formatting.
Especially strings near:
- nested parentheses
- macros
- multiline expressions
- commas
- unusual formatting
Be careful when using complex inline strings.
Some patterns may confuse the parser.
Examples:
char* text_vars = "test()";or:
char* text_vars = "(hello)";These may occasionally produce incorrect replacements depending on source layout.
The obfuscator rewrites the source file directly.
Always keep backups of your original source code.
Recommended workflow:
original.c -> obfuscater -> obfuscated.c
Do NOT repeatedly obfuscate already obfuscated files.
Each character is XOR encrypted using:
0xFFEncryption:
encrypted = original ^ 0xFFDecryption:
original = encrypted ^ 0xFFBecause XOR is reversible, the same operation decrypts the string.
#include <stdio.h>
int main()
{
char* message_vars = "Hello";
printf("Test");
}void _0xDECRYPT(char* str) {
for (int i = 0; str[i] != 0; i++) {
str[i] ^= 0xFF;
}
}
#define _0xA81K main
#include <stdio.h>
int _0xA81K()
{
char* message_vars = {0xB7,0x9A,0x93,0x93,0x90,0x00};
_0xDECRYPT(message_vars);
printf("Test");
}This project is still experimental.
Current limitations:
- No real C parser
- Uses string replacement internally
- Macros may break parsing
- Complex declarations may fail
- Nested expressions may fail
- Duplicate strings can cause replacement issues
- Function pointers are unsupported
- Multiline string edge cases may occur
Best used for:
- Small C projects
- Learning purposes
- Basic anti-static-analysis
- Lightweight source obfuscation
Not recommended for:
- Production-grade protection
- Advanced malware protection
- Commercial DRM systems
- Complex compiler pipelines
This tool is experimental.
Always verify generated code manually before compiling or distributing it.
Use at your own risk.