added MV_OBFUSCATED
This commit is contained in:
parent
74f35b55ab
commit
e517aa2fbc
40
content/docs/macros/MV_OBFUSCATED.md
Normal file
40
content/docs/macros/MV_OBFUSCATED.md
Normal 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()
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user