Sacara - A stack based intermediate language aimed at software protection by running in a software VM
Under the Sacara name belongs various projects:
- A programming language very similar to the most common intermediate representation language, like MSIL or the Java bytecode
- An assembler to transalate your Sacara program in a binary format
- An interpreter based on a Virtual Machine stack based
- A .NET binding to use the unmanaged Sacara DLL
Sacara was created to learn how to create a project suited for protecting the code from being reverse enginnering. The Virtual Machine is implemented in Assembly x86 and contains some anti-analysis features.
To know how to program in SacaraVM you can have a look at the ISA page, see the Examples in the source folder or read the programs (this and this) used for testing.
I have also published some blog posts about how to use Sacara for some basic tasks.
In order to compile a script implemented in the Sacara Intermediate Language (SIL), you have to use the Sacara assembler SacaraAsm.
To run a Sacara compiled script you can use the SacaraRun utility, or embedd the code inside your source code and using the exported APIs to run the SIL in a more controlled environment.
A static library (SacaraVm.lib) is available in order to avoid to bring with your program the DLL. Here an example of code using the static library.
The SacaraVM DLL exports various methods that can be invoked programmatically. You can find an example of usage in the Examples directory.
Finally, find below an example of execution:
For more examples take a look at the Examples folder.
If you are interested in using Sacara in .NET take a look at this example, which use the .NET Sacara Binding (ES.SacaraVm). In order to use the .NET binding the unmanaged SacaraVm.dll file must be in the same directory as the ES.SacaraVm.dll Assembly file.
Sacara is currently developed by using VisualStudio 2017 Community Edition (be sure to have the latest version installed). To build the source code you have to:
- have installed .NET Core SDK
- have installed the Windows desktop development with c++. If you have installed Visual Studio 2017, by opening the solution (SacaraSln.sln) it should ask automatically if you want to install the missing component
- clone the repository
- run
build.bat
I used SemVer for versioning. For the versions available, see the tags on this repository.
- Antonio Parata - Core Developer - s4tan
Sacara is licensed under the MIT license.