deniskore / llvm Goto Github PK
View Code? Open in Web Editor NEWLLVM based obfuscator
LLVM based obfuscator
Hi @Deniskore
Thanks for sharing the project!
I have couple of questions.
int __cdecl main(int argc, const char **argv, const char **envp)
{
unsigned int v3; // w19
unsigned int v4; // w20
const char *v5; // x0
__int64 v6; // x1
__int64 v7; // x2
v3 = rand();
v4 = rand();
printf("a=%d b=%d\n", v3, v4);
printf("g=%d\n", v4 ^ v3);
if ( (int)v3 <= (int)(v4 ^ v3) )
printf("12345");
printf("123456");
printf("%d %p %d\n", (v4 ^ v3) + v3, &STACK[0xC160], (v4 ^ v3) + v3);
printf("%d %d\n", 0xBC61BDLL, 0x96B43FLL);
if ( v3 == v4 )
{
v5 = "a==b %d %d\n";
v6 = v3;
v7 = v3;
}
else
{
v5 = "a!=b %d %d\n";
v6 = v3;
v7 = v4;
}
printf(v5, v6, v7);
return 0;
}
It would be nice to get your comments.
hi, clang 14 unable to compile llvm/Transforms/Obfuscate/XorShift.h because __rdtsc ((x)intrin.h) doesn't exist on arm. I think fix is replacing __rdtsc() with __builtin_readcyclecounter()
How do you think whether it is possible to implement the obfuscator as a LLVM plugin?
It would be very flexible solution for using with different toolchains.
As an example, following project can be taken.
https://polarply.medium.com/build-your-first-llvm-obfuscator-80d16583392b
https://github.com/tsarpaul/llvm-string-obfuscator
The idea is clear and simple. First, we generate the bitcode then process the bitcode with our plugin and after that translate it to the native code.
clang -emit-llvm hello.c -c -o hello.bc
opt -load-pass-plugin=./build/StringObfuscator/libLLVMStringObfuscator.so -passes="string-obfuscator-pass" < hello.bc -o out.bc
llc out.bc -o out.s
clang -static out.s -o out
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.