added MV_OBFUSCATED

This commit is contained in:
cpunch 2025-08-07 16:38:35 -05:00
parent 74f35b55ab
commit e517aa2fbc

View File

@ -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()
```