Log date · Mon
How to evaluate O-MVLL on your native code
Published on · Updated
Compare correctness, visible clues, performance and maintenance against a fixed release build. Our clang experiment shows how to establish a baseline.
How should you evaluate O-MVLL?
Start with a frozen release build, then compare correctness, visible clues, performance and maintenance cost. In our own C sample, six inputs produced identical outputs in two clang baselines, while the quote function fell from 34 instructions at -O0 to 14 at -O2. Both files were 33,512 bytes. Optimisation alone changes the observation, so comparing different optimisation levels cannot establish an obfuscation effect.
| Question | Finding |
|---|---|
| Does ordinary optimisation change code? | Yes: 34 instructions became 14. |
| Did sample behavior match? | The six boundary inputs matched. |
| Were the name and string visible? | Both builds retained _quote and QUOTE-DEMO. |
| How effective is O-MVLL? | Measure it on a compatible toolchain. |
The sample and measurement scope
We compiled a fictional pricing function with Apple clang 21.0.0 on macOS 27.2 arm64. The noinline attribute keeps the function available for counting; this is not a production workload. O-MVLL was not on PATH, so we ran only the two plain-clang baselines; the O-MVLL configuration below is documented but not executed.
#include <stdio.h>
#include <stdlib.h>
__attribute__((noinline)) int quote(int units) {
if (units < 0) return -1;
if (units >= 100) return units * 80;
if (units >= 20) return units * 90;
return units * 100;
}
int main(int argc, char **argv) {
if (argc != 2) return 2;
printf("QUOTE-DEMO: %d\n", quote(atoi(argv[1])));
return 0;
}Negative input returns -1; 20 and 100 are price-tier boundaries. The vectors cover both sides of those transitions, but only six inputs. Conversion, integer overflow and boundaries in a real application need their own tests. Keep source, commands, tool versions and artifacts so that a later protected build can repeat the same checks.
What the two baselines show
We compiled at -O0 and -O2, checked symbols with nm, searched for the fixed marker with strings, and counted disassembled instruction lines in quote using otool. Each timed build includes compilation and linking and was run once: 0.20 and 0.15 seconds respectively. Those timings are not a reliable performance comparison. Clang documents -O options as optimisation levels. [4]
-- quote instruction count (otool disassembly lines) --
34
-- test vectors --
-1 => QUOTE-DEMO: -1
0 => QUOTE-DEMO: 0
19 => QUOTE-DEMO: 1900
20 => QUOTE-DEMO: 1800
99 => QUOTE-DEMO: 8910
100 => QUOTE-DEMO: 8000Both files retained the _quote symbol and the QUOTE-DEMO: %d string. The instruction count is a count of static disassembly lines in one function, not executed instructions, decompilation difficulty or a security score. File size can also reflect format and alignment. Fewer instructions do not necessarily mean faster execution or greater difficulty of understanding.
Start with a narrow O-MVLL configuration
The official getting-started guide describes O-MVLL as an LLVM pass plugin configured in Python. It shows clang’s -fpass-plugin option and OMVLL_CONFIG for the full configuration path. The configuration supplies omvll_get_config, and the documentation recommends caching its instance. [1] First verify that the plugin, compiler, target and build system fit together, then pin their versions.
import omvll
from functools import lru_cache
class Config(omvll.ObfuscationConfig):
def flatten_cfg(self, mod, func):
return func.name == "quote"
@lru_cache(maxsize=1)
def omvll_get_config():
return Config()The control-flow flattening documentation selects functions through flatten_cfg and describes changing the graph of basic blocks. [2] Start with one tested function and verify that the pass actually applied; then evaluate string encoding and combinations separately. The string-encoding documentation uses an obfuscate_string callback to choose treatment. [3] A configuration file or a successful build alone does not prove that the intended function was transformed.
A scoring sheet to fill in before testing
The following is a recommended scoring sheet, not an O-MVLL score from this experiment. Set thresholds and owners before running it so that the standard does not move after results appear. Use the release-optimised build as the control, change one pass at a time, and test combinations after the individual results.
| Dimension | Evidence and suggested gate |
|---|---|
| Correctness | All regression and boundary vectors match; investigate any difference first. |
| Coverage | Confirm the intended function in logs and artifacts; do not score a missed target. |
| Analysis effort | Use the same task, time budget and independent evaluator; record success and time. |
| Cost | Repeat build, size, startup and hot-path measurements against product budgets. |
| Delivery and maintenance | Verify signing, crash symbolication, upgrades and reproducible CI. |
Define the analysis task, starting materials and completion criteria: for example, explain a test rule within a fixed time and submit evidence, using an evaluator who does not know the configuration. Record failures and abandoned attempts instead of showing only the most complicated graph. Keep evaluator experience, tools and time as comparable as possible. With a small sample, report the raw outcomes rather than extrapolating a general success rate.
Coverage must be checked against what actually ships. List the modules and functions selected for protection and the compilation units that contain them, then compare that inventory with build records and final artifacts. Inlining, link-time optimisation and architecture differences can change function boundaries. A name that matches in source therefore does not automatically establish that every shipped variant received the same treatment. Record missed targets and decide whether each gap affects the evaluation goal.
Keep distinct costs distinct. A clean build time does not replace the everyday incremental build time; binary size does not replace package size; startup time does not represent latency in a hot function. Measure each repeatedly on the same device, with the same inputs and consistent build conditions. Agree an acceptable range in advance and give decision makers the variation and failure counts along with the central result. This makes the tradeoff visible when a configuration changes more than one operational budget.
Run the comparison on your own app
In a project you are authorised to inspect, freeze the release configuration, select a function with independent tests and save separate baseline and single-pass artifacts. The checks below apply to macOS native artifacts; replace the path, function and marker, and use the corresponding tools on other platforms.
nm path/to/your-binary | grep 'your_function'
strings path/to/your-binary | grep 'YOUR_TEST_MARKER'
otool -tvV path/to/your-binaryRun the same test suite against both artifacts and compare exit status, output, errors and platform behavior. Record the pass configuration, source revision, compiler and linker flags; retain build logs and hashes so reviewers inspect the same files. For performance, use repeated runs, warm-up and representative devices, and report the distribution and conditions rather than a single timing.
Finally exercise the real release process: verify signing, installation and upgrades, check that crash reports remain actionable, and schedule regression tests after toolchain upgrades. If behavior differs or delivery fails, fix the issue or narrow the selection first. A change in analysis effort is useful for a decision only after those gates pass.
Your checklist
- Pin source, compiler, target architecture and release flags.
- Choose a function with boundary tests and save a baseline.
- Enable one pass at a time and verify the intended function was transformed.
- Compare regression tests, analysis tasks and repeated performance measurements.
- Validate signing, upgrades, crash symbolication and CI.
Primary sources
- O-MVLL: Getting started · Checked 2026-11-11
- O-MVLL: Control-flow flattening · Checked 2026-11-11
- O-MVLL: Strings encoding · Checked 2026-11-11
- Clang command guide · Checked 2026-11-11