Semantic diffusion — sdiff¶
Volatile-slot masking that resists local value propagation and constant folding by the optimizer.
sdiff spreads a value's computation across a small set of volatile slots, so an optimizer
(including an analyst's own -O2) cannot propagate or fold it locally. It complements the algebraic
obfuscation of mba with an optimization-resistance property.
Options¶
| Key | Default | Range | Meaning |
|---|---|---|---|
prob |
45 | 1–100 | Probability (%) to apply at a candidate site. |
slots |
3 | 1–8 | Number of volatile slots used. |
maxSites / max / sites |
80 | 1–2000 | Maximum transformed sites per function. |
Example¶
__attribute__((annotate("obf: sdiff(prob=35,slots=2,maxSites=60)")))
int step(int acc, int x) { return acc + (x * 31); }
More slots = more diffusion, more cost
Each volatile slot is a genuine memory barrier to the optimizer. Higher slots diffuses the
value further but adds real load/store traffic — raise it only for hot, sensitive values.