Annotating code¶
A practical cheat-sheet for marking functions. For why it works this way, see Concepts → Annotation model; for every key, the Annotation grammar.
The pattern¶
__attribute__((annotate("obf: <passes>"))) // C / C++
[[clang::annotate("obf: <passes>")]] // C++ attribute form
A macro keeps it readable and greppable:
#define OBF(spec) __attribute__((annotate("obf: " spec)))
OBF("mba(prob=70), bcf(prob=30)")
int f(int x) { return x * 3 + 7; }
Copy-paste recipes¶
Expression-level only — cheap, fast.
Structural + post-hardening.
Virtualise — replaces the whole body. Pre-obfuscate first for a harder lift.
Rules that bite¶
- Only annotated functions change.
mainand everything else is untouched unless marked. - Order in the annotation doesn't matter — the driver reorders
topologically.
"obf: vm, mba"runsmbathenvm. vmandflatteningconflict — never both on one function.- Stacking annotations is safe — multiple
annotateon one function merge (enablement additive, params last-wins). - Keys use no dashes —
maxSites, notmax-sites.
Confirm it parsed¶
If a pass you wrote isn't listed, the spec didn't parse — check parentheses and key names. Next: Quickstart runs the full compile loop.