Compare commits

...

25 Commits

Author SHA1 Message Date
761953e518 i love links 2025-10-17 03:32:37 -06:00
c00cf12b71 better compatibility table 2025-10-17 03:22:30 -06:00
ca94e59b53 MV_INLINE: more better limitations expressed 2025-10-13 01:41:44 -06:00
1adfca2a9f typos 2025-10-12 03:24:32 -06:00
0b2fc6f495 added performance guide 2025-10-12 03:03:18 -06:00
5065d5d788 minor improvements, typos, etc. 2025-09-18 00:10:25 -06:00
cae0341554 better phrasing 2025-09-14 20:37:49 -06:00
5d34ae2cd5 added MV_CFF, MV_OMIT_CFF & MV_OMIT_VM macros 2025-09-14 20:08:47 -06:00
2d15abca01 update dashboard
long overdue lol
2025-09-09 19:41:58 -05:00
fe88a4ec2f update MV_INLINE example 2025-09-09 19:37:27 -05:00
dcd0835e9e legal: typos 2025-09-08 17:09:19 -05:00
3f7045fce5 update example 2025-08-30 17:38:35 -05:00
3584b962fd more better 2025-08-19 13:43:31 -05:00
0a14bc975e added MV_INLINE 2025-08-19 13:23:41 -05:00
ef0440905d updated macro docs to provide example output 2025-08-16 21:03:51 -05:00
aa1d007ef9 more better wording 2025-08-15 13:30:20 -05:00
36d2aaba62 typo 2025-08-15 13:26:42 -05:00
6dcea53551 change alert type to info 2025-08-15 13:24:50 -05:00
b8fc134521 better macro documentation 2025-08-15 13:22:14 -05:00
4f06486bd9 rip 'Wrap CFF blocks' </3 2025-08-12 06:05:08 -05:00
e517aa2fbc added MV_OBFUSCATED 2025-08-07 16:38:35 -05:00
74f35b55ab added 'Lift Constants' option 2025-07-31 23:59:02 -05:00
6d4951c402 virtualization is free now 2025-07-28 17:42:24 -05:00
b2609d5d30 added MV_CRASH 2025-07-17 21:14:50 -05:00
8d4b8fdfca added MV_COMPRESS 2025-07-12 20:38:33 -05:00
22 changed files with 357 additions and 29 deletions

View File

@@ -0,0 +1,35 @@
---
weight: 999
title: "Luraph Compatibility Guide"
description: "Compatibility guide for Luraph"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
MoonVeil provides a compatibility layer to support users which already use Luraph's suite of Macros.
Many of Luraph's macros do features or optimizations that are already built into MoonVeil. Though MoonVeil will still accept scripts which try to use these macros, they will have no effect. Below is a table of compatibility between Luraph and MoonVeil.
{{% table %}}
| Luraph Macro | MoonVeil Alias | Description |
| ----- | ----- | ----- |
| `LPH_ENCFUNC` | [MV_ENC_FUNC](/docs/macros/mv_enc_func) | Virtualizes and encrypts functions |
| `LPH_ENCSTR` | `MV_NO_OP` | Not applicable |
| `LPH_ENCNUM` | `MV_NO_OP` | Not applicable |
| `LPH_CRASH` | [MV_CRASH](/docs/macros/mv_crash) | Crashes the VM |
| `LPH_NO_VIRTUALIZE` | [MV_OMIT](/docs/macros/mv_omit) | Omits a function from all obfuscation steps |
| `LPH_JIT` | `MV_NO_OP` | MoonVeil provides built-in optimizations |
| `LPH_JIT_MAX` | `MV_NO_OP` | MoonVeil provides built-in optimizations |
| `LPH_NO_UPVALUES` | `MV_NO_OP` | Not applicable |
| `LPH_LINE` | [MV_LINE](/docs/macros/mv_line) | Current line number |
| `LPH_OBFUSCATED` | [MV_OBFUSCATED](/docs/macros/mv_obfuscated) | Detects obfuscation |
{{% /table %}}
{{% alert context="info" text="`MV_NO_OP` isn't user accessible, and is only used to provide source compatibility." /%}}
A minor difference between Luraph and MoonVeil is that MoonVeil does not automatically virtualize your script (outside of the [Virtualize Script](/docs/options/virtualization/) option). Instead, you can selectively virtualize blocks using the [MV_VM](/docs/macros/mv_vm) or [MV_ENC_FUNC](/docs/macros/mv_enc_func) macros. This gives you much more control over the obfuscation process, enabling you to have much better performance.
Though you can use Luraph's macros in MoonVeil, MoonVeil additionally provides many other [macros](/docs/macros) which are not available in Luraph.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 KiB

After

Width:  |  Height:  |  Size: 198 KiB

View File

@@ -11,9 +11,7 @@ Once you've signed in, you'll be taken to the dashboard. This can also be naviga
{{< figure src="/img/dashboard-1.png" alt="Dashboard" width="auto" >}}
The Dashboard is the main interface for the obfuscator. You simply type the script you'd like to obfuscate into the left-side code editor and your obfuscated script will appear on the right-side as you make changes.
In the bottom right corner you'll see a Plus icon which will open the options menu.
The Dashboard is the main interface for the obfuscator. You simply type the script you'd like to obfuscate into the left-side code editor and use the target icon in the bottom right to obfuscate it. Additionally on the bottom right corner you'll see a Plus icon which will open the options menu.
{{< figure src="/img/dashboard-options.png" alt="Dashboard Options" width="auto" >}}

View File

@@ -18,10 +18,11 @@ You agree that while using the Services, you will not attempt to reverse enginee
## Disclaimer of Warranty
MOONVEIL PROVIDES THESE SERVICES AS-IS. YOUR USE OF THESE SERVICES IS AT YOUR OWN RISK, AND MOONVEIL AND ALL AFFILIATES DISCLAIM ALL WARRANTIES IN RELATION WITH THE SERVICES AND YOUR USAGE OF THE SERVICES. MOONVEIL DOES NOT WARRANT THAT THE CONTENT AVAILABLE FOR DOWNLOAD WILL BE FREE OR VIRUSES, MALWARE, CONTANMINATION, OR DESTRUCTIVE QUALITIES. YOU AGREE THAT YOU ASSUME ALL RISK AS TO THE CHARACTERISTICS OF THE DOWNLOADED CONTENT. MOONVEIL ARE NOT RESPONSIBLE FOR ANY DAMAGES FACED DUE TO CONTENT PROVIDED ON THE SERVICES.
Limitation of Liability
MOONVEIL PROVIDES THESE SERVICES AS-IS. YOUR USE OF THESE SERVICES IS AT YOUR OWN RISK, AND MOONVEIL AND ALL AFFILIATES DISCLAIM ALL WARRANTIES IN RELATION WITH THE SERVICES AND YOUR USAGE OF THE SERVICES. MOONVEIL DOES NOT WARRANT THAT THE CONTENT AVAILABLE FOR DOWNLOAD WILL BE FREE OF VIRUSES, MALWARE, CONTANMINATION, OR DESTRUCTIVE QUALITIES. YOU AGREE THAT YOU ASSUME ALL RISK AS TO THE CHARACTERISTICS OF THE DOWNLOADED CONTENT. MOONVEIL IS NOT RESPONSIBLE FOR ANY DAMAGES FACED DUE TO CONTENT PROVIDED ON THE SERVICES.
IN NO EVENT SHALL MOONVEIL BE LIABLE FOR ANY UNAVAILABILITY OR INOPERABILITY OF THE WEBSITE, TECHNICAL MALFUNCTION, COMPUTER ERROR, CORRUPTION OR LOSS OF INFORMATION, OR OTHER INJURY, DAMAGE OR DISRUPTION OF ANY KIND BEYOND THE REASONABLE CONTROL OF MOONVEIL. IN NO EVENT WILL MOONVEIL BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR EXEMPLARY DAMAGES, INCLUDING BUT NOT LIMITED TO, LOSS OF PROFITS OR LOSS OF BUSINESS OPPORTUNITY, EVEN IF SUCH DAMAGES ARE FORESEEABLE AND WHETHER OR NOT MOONVEIL HAS BEEN ADVISED OF THE POSSIBILITY THEREOF. MOONVEIL ASSUMES NO LIABILITY FOR ANY SERVICES PROVIDED ON THE WEBSITE. YOU AGREE TO INDEMIFY MOONVEIL AND ALL MEMBERS, OFFICERS, DIRECTORS, AGENTS, AND SUCCESSORS FROM AND AGAINST ANY AND ALL LIABILITIES, OBLIGATIONS, LOSSES, DAMAGES, TAXES, CLAIMS, ACTIONS AND SUITES FOR ANY AND ALL REQASONABLE COSTS, EXPENSES, AND DISBURSEMENTS OF ANY KIND AND NATURE WHATSOEVER.
## Limitation of Liability
IN NO EVENT SHALL MOONVEIL BE LIABLE FOR ANY UNAVAILABILITY OR INOPERABILITY OF THE WEBSITE, TECHNICAL MALFUNCTION, COMPUTER ERROR, CORRUPTION OR LOSS OF INFORMATION, OR OTHER INJURY, DAMAGE OR DISRUPTION OF ANY KIND BEYOND THE REASONABLE CONTROL OF MOONVEIL. IN NO EVENT WILL MOONVEIL BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR EXEMPLARY DAMAGES, INCLUDING BUT NOT LIMITED TO, LOSS OF PROFITS OR LOSS OF BUSINESS OPPORTUNITY, EVEN IF SUCH DAMAGES ARE FORESEEABLE AND WHETHER OR NOT MOONVEIL HAS BEEN ADVISED OF THE POSSIBILITY THEREOF. MOONVEIL ASSUMES NO LIABILITY FOR ANY SERVICES PROVIDED ON THE WEBSITE. YOU AGREE TO INDEMNIFY MOONVEIL AND ALL MEMBERS, OFFICERS, DIRECTORS, AGENTS, AND SUCCESSORS FROM AND AGAINST ANY AND ALL LIABILITIES, OBLIGATIONS, LOSSES, DAMAGES, TAXES, CLAIMS, ACTIONS AND SUITES FOR ANY AND ALL REASONABLE COSTS, EXPENSES, AND DISBURSEMENTS OF ANY KIND AND NATURE WHATSOEVER.
## Governing Law and Severability

View File

@@ -0,0 +1,31 @@
---
weight: 100
title: "MV_CFF"
description: "Force a CFF pass"
icon: "code_blocks"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_CFF<A..., R...>(vmFunction: (A...) -> R..., enableExpressionDecomposition?: boolean): (A...) -> R...`
will force the [CFF](/docs/options/flatten-control-flow) pass onto the passed function. Expression decomposition is enabled by default, but can be disabled with the second argument.
## Valid Usage
```lua
MV_CFF(function()
for i = 0, 10 do
print('this is flattened!', i)
end
MV_OMIT_CFF(function() print('this isnt') end)()
end)()
-- passing false as a second argument will disable expression decomposition, leading to much smaller output
MV_CFF(function()
for i = 0, 10 do
print('this is flattened!', i)
end
MV_OMIT_CFF(function() print('this isnt') end)()
end, false)()
```

View File

@@ -0,0 +1,26 @@
---
weight: 100
title: "MV_COMPRESS"
description: "Compresses strings"
icon: "code_blocks"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_COMPRESS(data: string): string`
will compress the passed string and decompress at runtime.
{{% alert context="info" text="**Note**: `LPH_ENCSTR` is an available alias, although not a direct replacement." /%}}
## Valid Usage
```lua
return MV_COMPRESS([[Lorem ipsum odor amet, consectetuer adipiscing elit. Ipsum curae senectus ut tempor rhoncus sed aliquam fermentum. Luctus consectetur consectetur vitae parturient risus enim. Justo venenatis dictumst eget tincidunt eu fermentum. Erat elementum molestie ad aliquam donec mauris tempor. Justo dictumst dapibus ultricies potenti scelerisque class sociosqu vivamus. Dignissim lobortis tristique nullam placerat lectus maximus class dolor.
Class eros ligula facilisis viverra adipiscing. Convallis penatibus lacinia hac pretium tempor mauris risus. Aliquet sagittis quisque dignissim duis volutpat eleifend sagittis. Mollis duis congue non auctor duis sapien senectus. Magna aptent ac nostra nisl; penatibus sagittis dis. Tempus sapien porta dolor luctus tempus felis habitant phasellus.
Volutpat quam senectus tristique egestas dui risus praesent maecenas adipiscing. Ante est platea cursus consequat quisque curabitur euismod. Himenaeos blandit augue; sed condimentum curae curabitur aliquam. Hac hendrerit arcu maecenas nisi iaculis donec natoque gravida. Sapien pretium nascetur, nisl in feugiat ultricies. Pretium ipsum ultricies et non blandit accumsan arcu. Egestas enim litora tortor nisi aenean posuere. Tortor posuere purus facilisi augue ipsum.
Metus ultrices netus rhoncus sed mi et neque ex. Tincidunt commodo metus quisque hendrerit tristique nostra amet sociosqu. Curae egestas feugiat massa torquent a vel faucibus faucibus. Euismod posuere cubilia penatibus class molestie torquent tristique commodo nam. Nullam rhoncus ad sem, habitasse euismod porta gravida. Ut curabitur tristique orci vestibulum rhoncus. Habitasse pulvinar risus congue dis cras consequat inceptos. Nulla hac interdum commodo enim magna; habitant id? Lacus pretium per accumsan praesent rutrum vestibulum.]])
```

View File

@@ -0,0 +1,25 @@
---
weight: 100
title: "MV_CRASH"
description: "Crashes the VM"
icon: "code_blocks"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_CRASH(void): void`
crashes the VM and corrupts the state.
{{% alert context="info" text="**Note**: `LPH_CRASH` is an available alias" /%}}
## Valid Usage
```lua
MV_VM(function() MV_CRASH() end)()
MV_VM(function()
local a = MV_CRASH()
end)()
```
{{% alert context="warning" text="**Note**: This macro can only be used in virtualized blocks." /%}}

View File

@@ -14,6 +14,7 @@ will virtualize and encrypt the passed function constant with the provided `encr
{{% alert context="info" text="**Note**: `LPH_ENCFUNC` is an available alias." /%}}
## Valid Usage
```lua
local total = 0
@@ -32,5 +33,4 @@ end
return total
```
{{% alert context="warning" text="**Note**: if your plan doesn't include virtualization support, `MV_ENC_FUNC` is a no-op where the passed function is mangled normally and not virtualized or encrypted!" /%}}

View File

@@ -14,9 +14,20 @@ will replace all instances of named indexes with a unique number constant.
## Valid Usage
```lua
local foo = MV_INDEX_TO_NUM({total = 0})
local foo = MV_INDEX_TO_NUM({total = 0, b = 2})
for i = 1, 10 do
foo.total = foo.total + i
end
return foo.total
return foo.total + foo.b
```
turns into:
```lua
-- note that the order of the indexes has been changed as well
local a={[24453]=2,[19314]=0}
for b=1,10 do
a[19314]=a[19314]+b
end
return a[19314] + a[24453]
```

View File

@@ -0,0 +1,52 @@
---
weight: 100
title: "MV_INLINE"
description: "Make preprocessor macros"
icon: "code_blocks"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_INLINE<A..., R...>(inlineFunction: (A...) -> R...): (A...) -> R...`
will mark the passed function to be inlined where used.
Some limitations apply:
- The passed function cannot be variadic (i.e. no ... usage)
- The passed function cannot tailcall or otherwise recursively call itself.
- You must use this macro in it's specific form, i.e. `local <var> = MV_INLINE(function() ... end)`
Note that this pass acts more like a preprocessor that replaces the function calls with the results of the function (if any), and can have strange effects in some cases.
For example, when an inlined function is called, its function body is inserted right before the statement the call is in. This can lead to some unexpected behavior when used in `or` or `if` expressions:
```lua
local called = false
local testFunc = MV_INLINE(function()
called = true
return 'hi'
end)
local foo = 'bar' or testFunc()
print(foo, called)
```
Will print `bar true`, where under normal circumstances testFunc should not be executed. This is because the `or` expression is evaluated after the inserted body.
## Valid Usage
```lua
local testFunc = MV_INLINE(function(start, endn)
local total = 0
for i = start, endn do
total = total + i
end
return total
end)
local testFunc2 = MV_INLINE(function()
return testFunc(1, 10), testFunc(11, 20), testFunc(1, 15)
end)
print(testFunc2())
```

View File

@@ -19,4 +19,11 @@ will be replaced with a number constant representing the current line.
local a = MV_LINE
print(a, MV_LINE)
```
> prints `1 2`
turns into:
```lua
print(1,2)
```
{{% alert context="info" text="**Note**: the 'a' local got folded yet retains the original line number" /%}}

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()
```
turns into:
```lua
do
validateWhitelist()
end
return runWithoutDebugging()
```

View File

@@ -0,0 +1,24 @@
---
weight: 100
title: "MV_OMIT_CFF"
description: "Omit from CFF"
icon: "code_blocks"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_OMIT_CFF<A..., R...>(cffFunction: (A...) -> R...): (A...) -> R...`
Similar to [MV_OMIT](/docs/macros/MV_OMIT), this will omit only the [CFF](/docs/options/flatten-control-flow) steps from the passed function. This can be useful to keep performance-critical sections unobfuscated but still have other AST passes applied to them.
## Valid Usage
```lua
MV_CFF(function()
for i = 0, 10 do
print('this is flattened!', i)
end
MV_OMIT_CFF(function() print('this isnt') end)()
end)()
```
> Make sure to call the macro result!

View File

@@ -1,7 +1,7 @@
---
weight: 100
title: "MV_OMIT"
description: "Omit all mangling steps"
description: "Omit from all steps"
icon: "code_blocks"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
@@ -9,12 +9,14 @@ lastmod: "2025-05-01T18:47:58-05:00"
`declare function MV_OMIT(omit: any): any`
will omit all mangling 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.
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
@@ -22,7 +24,7 @@ local dontMangleMe = MV_OMIT(function()
print("this whole function is in plaintext!")
end)
donMangleMe()
dontMangleMe()
local a = MV_OMIT("plaintext string")
print(a .. "im obfuscated")

View File

@@ -0,0 +1,24 @@
---
weight: 100
title: "MV_OMIT_VM"
description: "Omit from VM"
icon: "code_blocks"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_OMIT_VM<A..., R...>(vmFunction: (A...) -> R...): (A...) -> R...`
Similar to [MV_OMIT](/docs/macros/MV_OMIT), this will only omit the passed function from the VM. This can be useful to keep performance-critical sections unobfuscated but still have other AST passes applied to them.
## Valid Usage
```lua
MV_VM(function()
for i = 0, 10 do
print('this is virtualized!', i)
end
MV_OMIT_VM(function() print('this isnt') end)()
end)()
```
> Make sure to call the macro result!

View File

@@ -20,4 +20,3 @@ end)
virtualizedFunction("1", "2", "3")
```
{{% alert context="info" text="**Note**: if your plan doesn't include virtualization support, `MV_VM` is a no-op where the passed function is mangled normally and not virtualized." /%}}

View File

@@ -19,5 +19,4 @@ The control flow flattener supports the following branching syntaxes:
The following child options are available:
- `Expression Decomposition`: Breaks apart expressions into CFF blocks and temporaries, can kill performance.
- `Wrap CFF blocks`: Will move compatible CFF blocks into their own closure in a lookup table. Can speed up larger flattening targets.
- `Hoist locals`: Will move local storage into a lookup table. Useful to cut down on the number of used locals.

View File

@@ -11,6 +11,7 @@ This option will enable non-destructive constant decomposition and various state
The following child options are available:
- `Lift Constants`: Percentage of function constants to lift into a lookup table. 0 is disabled while 100 is all constants.
- `Mangle Numbers`: Replaces number constants with a randomized binary expression which evaluates to that number.
- `Mangle Strings`: Performs light obfuscation of string constants.
- `Mangle Self-calls`: Replaces `x:foo()` with `x.foo(x)`.

View File

@@ -9,8 +9,6 @@ lastmod: "2025-05-01T18:47:58-05:00"
The MoonVeil virtualization pass handles lifting and compiling selected virtualized blocks using the [MV_VM](/docs/macros/mv_vm) or [MV_ENC_FUNC](/docs/macros/mv_enc_func) macros. The virtualizer handles the generation of a uniquely hardened luau interpreter implemented in luau and transpiles virtualized blocks to it. Each script has a completely unique instruction set with hot-patching mnemonics, shuffled opcode encoding and behavior.
{{% alert context="info" text="**Note**: This requires a paid plan to enable, otherwise the macros act as no-ops" /%}}
The following child options are available:
- `Virtualize Script`: Wrap the entire script in an `MV_VM` macro, effectively marking the entire script (excluding [MV_OMIT](/docs/macros/mv_omit_function) blocks).

View File

@@ -0,0 +1,67 @@
---
weight: 999
title: "Performance Guide"
description: "Performance guide for MoonVeil"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
MoonVeil provides multiple solutions to improve and optimize the performance of your scripts.
## Using the 'Fast VM' preset
This preset is available in [your dashboard's settings](/docs/dashboard/). If you're still having performance issues, continue reading.
## Omitting Obfuscation from blocks
Not all code needs to be obfuscated. Large libraries that deal with unimportant code such as UI libraries, data serialization libraries, etc. can be left unobfuscated.
MoonVeil allows you to omit obfuscation from specific blocks of your script, by wrapping the block in an [MV_OMIT](/docs/macros/mv_omit_function) macro:
```lua
MV_OMIT(function()
for i = 0, 10 do
print(i)
end
end)()
```
Code that runs frequently (e.g. per game tick, render frame, or otherwise multiple times per second) may cause application freezes, drop FPS, reduce throughput, and increase latency even if optimized properly. Most of the time obfuscation is not necessary on these functions. For example:
```lua
game:GetService("RunService").RenderStepped:Connect(MV_OMIT(function()
Label.Text = "FPS: " .. game:GetService("Stats").FramesPerSecond
-- or whatever
end))
```
## Obfuscation only through macros
Who says you need to obfuscate your whole script? If you know what you're doing, you can selectively tell MoonVeil to **only** obfuscate certain parts of your script using the [MV_VM](/docs/macros/mv_vm), [MV_ENC_FUNC](/docs/macros/mv_enc_func), and [MV_CFF](/docs/macros/mv_cff) macros. This gives you much more control over the obfuscation process, you simply tell MoonVeil what parts of your script you want to obfuscate:
```lua
local getThing = MV_VM(function()
for i = 0, 10 do
print(i)
end
-- this will be SO slow, but does work!
MV_CFF(function()
for i = 0, 10 do
print(i)
end
end)()
return "hello world"
end)
MV_ENC_FUNC(function()
print('yay function unencrypted')
for i = 0, 10 do
print(i)
end
end, "hello world", getThing())()
```
Then using the `Minify` preset will only run the passes you've specified. For a full list of macros, see the [documentation](/docs/macros).

View File

@@ -1,12 +0,0 @@
---
weight: 999
title: "Using Macros"
description: "Guide to using macros"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
[Macros](./macros/) are a collection of reserved global functions available for use in your scripts. These are only available at obfuscation-time and are not available at runtime, meaning trying to access these functions dynamically will fail.
They can be used in any script in [your dashboard](./dashboard/) or through the [API](./api/) and provide many useful tools for obfuscation.