Files
MoonVeil-Docs/content/docs/macros/MV_OMIT_FUNCTION.md
2025-10-17 03:22:30 -06:00

46 lines
1.3 KiB
Markdown

---
weight: 100
title: "MV_OMIT"
description: "Omit from all steps"
icon: "code_blocks"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_OMIT(omit: any): any`
will omit all obfuscation steps from the passed expression, will also disregard any indexes set by `MV_INDEX_TO_NUM`. Passing a function to this can be useful to keep performance-critical sections unobfuscated.
When used in a virtualized block (using the [MV_VM](./MV_VM) or [MV_ENC_FUNC](./MV_ENC_FUNC) macros), this will lift the function from the virtualized block as a separate standalone minified function in plaintext.
{{% alert context="info" text="**Note**: `MV_OMIT_FUNCTION` && `LPH_NO_VIRTUALIZE` are also available aliases." /%}}
Additionally if you'd like to only omit the function from certain AST passes, you can use the [MV_OMIT_CFF](./MV_OMIT_CFF) or [MV_OMIT_VM](./MV_OMIT_VM) macros.
## Valid Usage
```lua
local dontMangleMe = MV_OMIT(function()
print("this whole function is in plaintext!")
end)
dontMangleMe()
local a = MV_OMIT("plaintext string")
print(a .. "im obfuscated")
local foo = 'hello'
MV_ENC_FUNC(function()
MV_OMIT(function(aa)
if aa == "lol" then
foo = "OK"
else
foo = "NO"
end
end)("lol")
print(foo)
end, "abc", "abc")()
-- will print "OK"
```