Skip to content

Script to obfuscate C files.

Notifications You must be signed in to change notification settings

antwxne/0BFUSC4T0R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

0BFUSC4T0R

Description

Simple ruby script to obfuscate C files.

It replaces compatible characters by digraphs/trigraphs

Digraphs

character replacement
[ <:
] :>
{ <%
} %>
# %:

Trigraphs

character replacement
[ ??(
] ??)
{ ??<
} ??>
# ??=
\ ??/
^ ??'
~ ??-

Usage

ruby obfuscator.rb < flag > < input file > < output file >

Flags:

  • -d to use digraphs
  • -t to use trigraphs

Warning: if you use trigraphs, you'll need to compile with -trigraphs

Exemples

input file:

#include <stdio.h>
#include <string.h>

int main(void)
{
    char str[100] = {0};

    strcpy(str, "Hello world!");
    puts(str);
    return 0;
}

Outputfiles:

  • Digraph:

    %:include <stdio.h>
    %:include <string.h>
    
    int main(void)
    <%
        char str<:100:> = <%0%>;
    
        strcpy(str, "Hello world!");
        puts(str);
        return 0;
    %>
  • Trigraphs:

    ??=include <stdio.h>
    ??=include <string.h>
    
    int main(void)
    ??<
        char str??(100??) = ??<0??>;
    
        strcpy(str, "Hello world!");
        puts(str);
        return 0;
    ??>

About

Script to obfuscate C files.

Topics

Resources

Stars

Watchers

Forks

Languages