• Stars
    star
    151
  • Rank 246,057 (Top 5 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 6 years ago
  • Updated almost 5 years ago

Reviews

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

Repository Details

C++ Header only string obfuscator library using metaprogramming. Affine Cipher technique is used for encryption and decryption.

String Obfuscator in Compile Time

C++ String Obfuscator using Metaprogramming.

Wrapping string literals using OBFUSCATE macro prevents string literals appearing in object files as it is. Actually, it is not impossible to figure obfuscated codes out, but obfuscating makes reverse-engineering difficult and time-consuming.

How to use

  1. just include source codes in directory "include".
  2. Wrap your raw string literal with "OBFUSCATE" macro.
#include <iostream>
#include "obfuscator.hpp"

int main(void) { 
	std::cout << OBFUSCATE("Private Key") << std::endl;
	return 0;
}

Features

Before Obfuacating (Compile options : -O3 -march=native -fPIC -g)
#include <iostream>
int main(void) {
    std::cout << "snowapril" << std::endl;
    return 0;
}
Dump of assembler code for function main():
   0x00403b90 <+0>:     push   %ebp
   0x00403b91 <+1>:     mov    %esp,%ebp
   0x00403b93 <+3>:     and    $0xfffffff0,%esp
   0x00403b96 <+6>:     sub    $0x10,%esp
   0x00403b99 <+9>:     call   0x4019c0 <__main>
   0x00403b9e <+14>:    movl   $0x9,0x8(%esp)
   0x00403ba6 <+22>:    movl   $0x405064,0x4(%esp)
   0x00403bae <+30>:    movl   $0x40825c,(%esp)
   0x00403bb5 <+4>:     call   0x401478 <_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i>
   0x00403bba <+9>:     movl   $0x40825c,(%esp)
   0x00403bc1 <+4>:     call   0x401470 <_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_>
   0x00403bc6 <+9>:     xor    %eax,%eax
   0x00403bc8 <+11>:    leave
   0x00403bc9 <+12>:    ret
End of assembler dump.

(gdb) x /s 0x405064
>> 0x405064 <_Jv_RegisterClasses+4214884>: "snowapril"
After Obfuscating (Compile options : -O3 -march=native -fPIC -g)
#include <iostream>
#include "obfuscator.hpp"
int main(void) {
    std::cout << OBFUSCATE("snowapril") << std::endl;
    return 0;
}
Dump of assembler code for function main():
   0x00403b90 <+0>:     push   %ebp
   0x00403b91 <+1>:     mov    %esp,%ebp
   0x00403b93 <+3>:     and    $0xfffffff0,%esp
   0x00403b96 <+6>:     sub    $0x40,%esp
   0x00403b99 <+9>:     call   0x4019c0 <__main>
   0x00403b9e <+14>:    lea    0x10(%esp),%eax
   0x00403ba2 <+18>:    movl   $0x408258,(%esp)
   0x00403ba9 <+4>:     movl   $0x4,0x1c(%esp)
   0x00403bb1 <+12>:    movl   $0x10,0x20(%esp)
   0x00403bb9 <+20>:    movl   $0x27,0x24(%esp)
   0x00403bc1 <+28>:    mov    %eax,0x4(%esp)
   0x00403bc5 <+32>:    movl   $0x60,0x28(%esp)
   0x00403bcd <+40>:    movl   $0x62,0x2c(%esp)
   0x00403bd5 <+48>:    movl   $0x3e,0x30(%esp)
   0x00403bdd <+56>:    movl   $0x6c,0x34(%esp)
   0x00403be5 <+64>:    movl   $0x1c,0x38(%esp)
   0x00403bed <+72>:    movl   $0x61,0x3c(%esp)
   0x00403bf5 <+80>:    movb   $0x73,0x10(%esp)
   0x00403bfa <+85>:    movb   $0x6e,0x11(%esp)
   0x00403bff <+90>:    movb   $0x6f,0x12(%esp)
   0x00403c04 <+95>:    movb   $0x77,0x13(%esp)
   0x00403c09 <+100>:   movb   $0x61,0x14(%esp)
   0x00403c0e <+105>:   movb   $0x70,0x15(%esp)
   0x00403c13 <+110>:   movb   $0x72,0x16(%esp)
   0x00403c18 <+115>:   movb   $0x69,0x17(%esp)
   0x00403c1d <+120>:   movb   $0x6c,0x18(%esp)
   0x00403c22 <+125>:   movb   $0x0,0x19(%esp)
   0x00403c27 <+130>:   call   0x401470 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc>
   0x00403c2c <+135>:   mov    %eax,(%esp)
   0x00403c2f <+138>:   call   0x401478 <_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_>
   0x00403c34 <+143>:   xor    %eax,%eax
   0x00403c36 <+145>:   leave
   0x00403c37 <+146>:   ret
End of assembler dump.

Reference

largely referenced on https://github.com/andrivet/ADVobfuscator

More Repositories

1

Procedural-Terrain-Estimator

Generate Height map with Generator (OpenGL and imgui) and Construct Splat Map with generated height map using Algorithm(DPS, BFS, Gradient Descent ... etc) . At Renderer, with height map and blend map which are generated in front of this stage, render high quality terrain with OpenGL
C++
39
star
2

vk_voxel_cone_tracing

Vulkan voxel cone tracing renderer based on SVO(sparse voxel octree) and Clipmap
C++
26
star
3

VRoom

Virtual conference platform for Desktop & VR
C#
11
star
4

three.rs

Rust-based three.js implementation using wasm + webgpu
Rust
8
star
5

Deformable-Snow-Simulation

Deformable snow simulation using opengl. motivated by red-dead-redemption2.
C
6
star
6

IndieRenderer

Indie Rendering Engine using Modern OpenGL and C++
C++
6
star
7

ToonEngine

This is a simple game engine with cartoon rendering.
C++
4
star
8

VRoomEditor

3D Map editor for Virtual conference platform **VRoom**
C#
4
star
9

gl_shaded_gltfscene

Rendering PBR shaded GLTF scene with modern opengl 4.5
C++
4
star
10

YachtSimulator

C++
3
star
11

sinbaram_algorithm_2021

3
star
12

CreativeAdversarialNetworks_paper_implementation

paper implement
Python
3
star
13

5dChess

CMake
2
star
14

PBR-3ed

Implementation of Physicall Based Rendering 3rd edition book contents
CMake
2
star
15

Raytracing-In-A-Weekend-Python

Python
2
star
16

pnu-machine-learning-2021

Implementation of several machine learning algorithms, such as logistic-regression, linear-regression, k-Nearest-Neighbor, etc.
Python
2
star
17

real_time_face_detection

get image from opencv video and get face features's position by tensorflow and draw on the screen
Python
2
star
18

ostep-homeworks

C
2
star
19

lockfree_vector

Unofficial implementation of (2006). Lock-Free Dynamically Resizable Arrays
C++
1
star
20

ParallelPathTracer

CPU based path tracing multiple frame in parallel and generate compressed gif with several generated frames
1
star
21

ForestFireSimul

C++
1
star
22

AlgorithmPlayground

C++
1
star
23

directx-rs

Safe DirectX 12 wrapper for the Rust language.
1
star
24

rubik_autosolver_stm32

C
1
star
25

terrain-rs

terrain-rs is composed of random terrain generator based on polygonal map generator and visualizer using webgpu
Rust
1
star
26

pbrt_rs

This repository is for learning PBRT 3rd edition(https://www.pbr-book.org/) and implement it with rust language
Rust
1
star
27

cargs

The command line arguments parser with similar command recommendation feature
CMake
1
star
28

RustPlayground

Rust
1
star
29

vk_collision2d_simul

C++
1
star
30

modern-opengl-oss-template

Template repository for modern opengl with OSS
C++
1
star
31

Simple-Raytracing-Framework

C++
1
star
32

Surface-Subdivision

Python
1
star
33

CopilotPlayground

Programming with copilot with several languages
1
star
34

pnu_computer_vision_2022

Python
1
star
35

json-rs

Simple json parser for practice
Rust
1
star
36

dacon-credit-card-defaults-sinbaram

1
star
37

GoonRenderer

C++
1
star
38

pnu-software-term

Java
1
star
39

Tree-Archives

C++
1
star
40

TFAT

TFT simulator using C++ with some reinforecement learning.
C++
1
star
41

AttributeVertexClouds

experimental project for implementing AVCs in the book "GPU Zen : Advanced Rendering Techniques"
C++
1
star
42

cxx-oss-template

C++
1
star