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.
The concept is very very simple, You mark a function with retcrypt and it will then find all xrefs, clone a copy of the function; so each function has 1 return address.
Then we encrypt the copy with the return address of the known caller.
Due to how different functions return, we use an annotation here, processing everything at link time as a function pass when downstream optimisations can turn functions we use into different calling conventions makes it difficult to know if it will still return to the same address.
It also doesn't account for things like threading, callbacks and other indirect pointer calling, so you need to be careful with the annotation usecase.
__attribute__((annotate("retcrypt")))- Activates the pass on the function
- 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-pluginParam to the FunctionPass.dll