Presets
Prometheus ships with these preset names in src/presets.lua:
MinifyWeakCff(standalone control flow flattening)Vmify(standalone register VM)MediumStrong
Use a preset with:
prometheus-lua --preset Medium ./file.lua
Minify
- no step transforms (
Steps = {}) - variable renaming still applies through pipeline settings
- best for size reduction and minimal runtime overhead
Weak
Steps:
CffConstantArrayWrapInFunction
Cff
This test-oriented preset runs one Cff control flow flattening step.
Vmify
This test-oriented preset compiles the input to the register VM with one Vmify step.
Medium
Steps:
VmifyEncryptStrings(HoistVmStrings = true)AntiTamper(UseDebug = false)ConstantArrayWrapInFunctionCff(ExcludeVm = true)NumbersToExpressions
HoistVmStrings moves interpreter string literals into an outer initializer;
that initializer follows the regular encryption and constant array flow,
decodes the strings once at startup, then binds them to native lexical locals
inside the interpreter. This avoids decoder and wrapper calls on the
interpreter's hot paths. Strings in vmData remain encrypted normally.
Cff runs after the helper-producing steps, so it flattens their surrounding
code, including string decoder, tamper check, constant array, and wrapper
code. The generated VM interpreter and its native prototype table
initializers remain outside Cff flattening. NumbersToExpressions runs after
Cff because it adds no helper functions and keeps arithmetic constant
expressions from being virtualized by Cff.
Strong
Steps:
VmifyEncryptStringsAntiTamper(UseDebug = false)CffConstantArrayNumbersToExpressionsWrapInFunction
In Strong, Vmify compiles the input first, then Cff flattens control flow in the generated VM Lua code. It keeps the defaults HoistVmStrings = false and ExcludeVm = false; the preset is unchanged and contains one VM pass.
Choosing quickly
- Start with
Medium. - Move to
Strongonly after benchmarking your runtime path. - Use
Minifywhen you want readability reduction only through compression/renaming style behavior. - Use
CffandVmifyto exercise either step on its own in a custom pipeline.