Skip to content

About

LLVM Homomorphism Obfuscation Pass Laundering Constants Through Function Parameters

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Caller Const Key Pass

Built for LLVM 19.1 - Windows x64

This is a component of Nessa's homomorphism engine.
The idea is quite simple, Certain function calls will pass constants through them.

int Add(int a, int b)
{
return a+b;
}
int Mult(int a, int b)
{
return a*b;
}

void Example()
{
const int val1 = Add(10,20);
const int val2 = Mult(100,1);
}

So here for example we have 10,20 as parameters to Add and 100,1 as parameters to Mult.
Lets say example is called by Func5, which has a call graph of

Func1 -> Func2 -> Func3 -> Func4 -> Func5 -> Example

We would take those constants 10,20,100,1 and move them all the way up to func1. Then we clone (make xrefless copies of the function) all the functions in the path and make new ones pass the parameters down.
So Func1 loads the constants, each Function is then going to take the parameter(as it is a new single xref function, specially made for this call chain), passing it through each function until it hits example.
Then to example these were loaded AGES ago, so each function was just passing the pointer, the actual value was loaded long ago. This means if you only have example, you need to reverse engineer up to Func1 to get the constants.
So you just follow the call graph right? Well Nessa uses the other homomorphism systems and just flat out encrypts and indirects all calls. There is no call graph.
Example doesn't know what these constants are, but we do. So we use them as an encryption key.

Loading Constants

image

Pass them down

image
image

How To Build

  • Download LLVM 19.1
  • Download VCPKG
  • VCPKG install asmjit
  • Open build.bat in a text editor.
  • Find the LLVM 19.1 references in the command line, Change them to your file path.
  • Find the VCPKG references in the command line, Change them to your file path.
  • Run the build script
  • Build your application with the -load-pass-plugin Param to the FunctionPass.dll

About

LLVM Homomorphism Obfuscation Pass Laundering Constants Through Function Parameters

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages