diff --git a/content/docs/macros/MV_OBFUSCATED.md b/content/docs/macros/MV_OBFUSCATED.md new file mode 100644 index 0000000..fac6555 --- /dev/null +++ b/content/docs/macros/MV_OBFUSCATED.md @@ -0,0 +1,40 @@ +--- +weight: 100 +title: "MV_OBFUSCATED" +description: "Detect if script is obfuscated" +icon: "code_blocks" +date: "2025-05-01T18:47:58-05:00" +lastmod: "2025-05-01T18:47:58-05:00" +--- + +`declare MV_OBFUSCATED: boolean` + +This macro is a constant value that is set as true during obfuscation, which can allow certain code paths to only run in an obfuscated or unobfuscated context. MoonVeil will optimize out the blocks which should not run. + +{{% alert context="info" text="**Note**: `LPH_OBFUSCATED` is an available alias." /%}} + +## Valid Usage + +```lua +if MV_OBFUSCATED then + validateWhitelist() -- This code will only if the script has been obfuscated. +else + skipWhitelist() + -- This code will only run when the script is not obfuscated. + -- Additionally, there will be no traces of this code in the obfuscated code. +end + +return if MV_OBFUSCATED then runWithoutDebugging() else runWithDebugging() +``` + +Obfuscates to: + +```lua +do + + validateWhitelist() + +end + +return runWithoutDebugging() +``` \ No newline at end of file