• Stars
    star
    132
  • Rank 274,205 (Top 6 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

C++ implementation of compile time obfuscator

cpp-obfuscator

License Build Status

C++ implementation of compile time obfuscator

Compiler Support

Compiler Version
Visual Studio 2019
Clang++ 8.0
g++ 7.3
Apple Clang Mojave

Usage

Use existing single header obfuscator.hpp or run script to merge multiple headers in directory obfuscator.

python -m script.merge

Include obfuscator.hpp to use it.

#include "../obfuscator.hpp"

template <char key>
constexpr char xor_(char c) {
    return c ^ key;
}

std::cout << obfs::make_string<xor_<0x50>, xor_<0x50>>("Hello World !\n").decode();

String

Compile time string obfuscator. No more raw string in binary, sample string_obfuscator.

  1. Sample encoder, decoder
template <char key>
constexpr char xor_(char c) {
    return c ^ key;
}

template <char Key>
constexpr char add(char c) {
    return c + Key;
}

template <char(*f)(char), char(*g)(char)>
constexpr char comp(char c) {
    return f(g(c));
}
  1. Single encoder, decoder.
std::cout << obfs::make_string<xor_<0x50>, xor_<0x50>>("Hello World !\n").decode();
  1. Multiple encoder, decoder and random selection.
using table = obfs::make_table<
    obfs::encoder_seq<xor_<0x50>, add<10>, comp<xor_<0x50>, add<10>>>,
    obfs::decoder_seq<xor_<0x50>, add<-10>, comp<add<-10>, xor_<0x50>>>>;

std::cout << obfs::make_string<table>("Hello World !\n").decode();
  1. Multiple encoder, decoder as pair.
using table = obfs::make_pair_table<
    obfs::encoder_pair<xor_<0x50>, xor_<0x50>>,
    obfs::encoder_pair<add<10>, add<-10>>,
    obfs::encoder_pair<comp<xor_<0x50>, add<10>>, comp<add<-10>, xor_<0x50>>>
>;

std::cout << obfs::make_string<table>("Hello World !\n").decode();
  1. String obfuscator macro.
MAKE_STRING(str, "Hello World !\n", table);
std::cout << str.decode();

Finite state machine

Compile time finite state machine based routine obfuscator, sample state_machine.

  1. Make state table.
using namespace obfs;
using machine = StateMachine<
    Stage<state1, Next<event5 , state2, Dummy::dummy1>,
                  Next<event1 , state3, Dummy::dummy3>>,
    Stage<state2, Next<event2 , state4>>,
    Stage<state3, Next<None   , state3>>,
    Stage<state4, Next<event4 , state1>,
                  Next<event3 , state5, Dummy::dummy2>>,
    Stage<state5, Next<Trigger, Final, Action::action>>>;
  1. Run state machine, each execution returns next state.
auto next1 = machine::run(state1{}, event5{}); // dummy1 executed
auto next2 = machine::run(next1, event2{});
auto next3 = machine::run(next2, event3{});    // dummy2 executed
auto next4 = machine::run(next3, Trigger{});   // action executed

More Repositories

1

AntiDebugging

AntiDebugging sample sources written in C++
C++
330
star
2

torch-nansypp

NANSY++: Unified Voice Synthesis with Neural Analysis and Synthesis
Python
139
star
3

torch-nansy

Torch implementation of NANSY, Neural Analysis and Synthesis, arXiv:2110.14513
Jupyter Notebook
62
star
4

torch-whisper-guided-vc

Torch implementation of Whisper-guided DDPM based Voice Conversion
Python
49
star
5

numpy-rnn

numpy implementation of Recurrent Neural Network
Jupyter Notebook
41
star
6

tf-diffwave

Tensorflow implementation of DiffWave: A Versatile Diffusion Model for Audio Synthesis
Jupyter Notebook
40
star
7

jax-variational-diffwave

Jax/Flax implementation of Variational-DiffWave.
Python
40
star
8

torch-styleddpm-vc

Torch implementation of UNIT-DDPM for voice conversion
Python
33
star
9

CodeInjection

Code Injection technique written in cpp language
C++
32
star
10

BranchTracer

Branch based windows debugger
C++
21
star
11

AlphaZero-Connect6

AlphaZero training framework for game Connect6 written in Rust with C++, Python interface.
Rust
17
star
12

cpp-concurrency

cpp implementation of golang style concurrency
C++
15
star
13

cpp-veh-dbi

C++ Implementation of VEH based windows dynamic binary instrumentation
C++
15
star
14

torch-diffusion-wavegan

Parallel waveform generation with DiffusionGAN
Python
15
star
15

PacketInjector

Detect HTTP packet and inject redirect packet
C++
13
star
16

np-gaussian-process

Numpy implementation of Gaussian Process Regression
Jupyter Notebook
11
star
17

tf-alae

(Unofficial) Tensorflow implementation of Adversarial Latent Autoencoder (ALAE, Pidhorskyi et al., 2020)
Jupyter Notebook
10
star
18

torch-retriever-vc

PyTorch implementation of Retriever: Learning Content-Style Representation
Python
10
star
19

torch-tacospawn

PyTorch implementation of TacoSpawn, Speaker Generation
Python
10
star
20

speechset

Numpy-librosa implementation of Speech dataset pipeline
Python
9
star
21

HYU-ELE3021

Hanyang Univ. 2020 Operating Systems (Prof. Hyungsoo Jung)
C
7
star
22

HYU-ITE2038

Database Systems and Applications in Hanyang University
C++
7
star
23

speechaug

PyTorch implementation of speech augmentation toolkit
Python
6
star
24

tf-mlptts

Tensorflow implementation of MLP-Mixer based TTS
Python
6
star
25

tf-neural-process

Tensorflow implementation of Neural Process family
Jupyter Notebook
6
star
26

tf-glow-tts

Tensorflow implementation of Glow-TTS
Python
6
star
27

FineDustPrediction

Tensorflow implementation of fine-dust forecaster
Python
6
star
28

TopMost

Make window always topmost
C++
5
star
29

revsic.github.io

HTML
4
star
30

torch-guided-tts

Torch implementation of Guided-TTS
3
star
31

Rewriting-A-Deep-Generative-Models

Experiments for paper "Rewriting a deep generative models"
Jupyter Notebook
3
star
32

tf-survae-flows

Tensorflow implementation of SurVAE Flows, Nielsen et al., 2020.
Jupyter Notebook
2
star
33

HYU-CSE4007

Artificial Intelligence lecture in Hanyang University.
Java
2
star
34

HYU-ELE4029

Hanyang Univ. 2020 Compilers
C
2
star
35

HYU-ITE4052

Hanyang Univ. 2020. Computer Vision (Prof. Taehyun Kim)
Jupyter Notebook
2
star
36

tf-branch-malware

Behavior based malware detection using branch data
Jupyter Notebook
2
star
37

HYU-ITE1015

ITE1015 - Creative Software Design in Hanyang University
C++
1
star
38

jax-istts

Jax/flax implementation of implicit self-supervision of TTS
1
star
39

HYU-CSE2010

Data Structures in Hanyang University
C
1
star
40

go-interpreter

Writing an interpreter in Go, Thorsten Ball
Go
1
star
41

tf-vanilla-gan

Tensorflow implementation of Vanilla GANs
Python
1
star
42

torch-tacotron

PyTorch implementation of Tacotron, 2017.
Python
1
star
43

revsic

Profile
1
star