started docs!

This commit is contained in:
2025-05-02 02:25:57 -05:00
parent bb9174511e
commit 5092be7c4d
27 changed files with 518 additions and 1 deletions

3
content/docs/_index.md Normal file
View File

@@ -0,0 +1,3 @@
---
title: "MoonVeil Docs"
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

View File

@@ -0,0 +1,20 @@
---
weight: 999
title: "Dashboard"
description: "Interactive web interface"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
Once you've signed in, you'll be taken to the dashboard. This can also be navigated elsewhere by clicking 'Dashboard' in the top navbar.
{{< 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.
{{< figure src="/img/dashboard-options.png" alt="Dashboard Options" width="auto" >}}
You can use the options menu to toggle different features of the obfuscator and flip through several presets. Additionally, you can use the bottom most buttons to load from a local file, copy the obfuscated script to your clipboard or save to a local file.

View File

@@ -0,0 +1,35 @@
---
weight: 100
title: "MV_ENC_FUNC"
description: "Encrypts functions"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_ENC_FUNC<A..., R...>(vmFunction: (A...) -> R..., encryptKey: string, decryptKey: string): (A...) -> R...`
will virtualize and encrypt the passed function constant with the provided `encryptKey`. Then `decryptKey` is evaluated at runtime to grab the key.
## Valid Usage
```lua
local foo = 'ok'
local total = 0
local getKey = MV_VM(function()
-- WARNING: this is just an example! don't do this
return "pass" .. "word123"
end)
for i = 1, 10 do
-- referenced upvalues will be captured
MV_ENC_FUNC(function()
print("in virtualized function # 1", i)
total = total + i
end, "password123", getKey())()
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

@@ -0,0 +1,21 @@
---
weight: 100
title: "MV_ENC_STR"
description: "Encrypts strings"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_ENC_STR(str: string, encryptKey: string, decryptKey: string): string`
will encrypt the passed string constant with the provided `encryptKey`. Then `decryptKey` is evaluated at runtime to grab the key.
## Valid Usage
```lua
local getKey = MV_VM(function()
return "pass" .. "word123"
end)
return MV_ENC_STR("hello world", "password123", getKey())
```

View File

@@ -0,0 +1,22 @@
---
weight: 100
title: "MV_INDEX_TO_NUM"
description: "Obfuscates named indexes"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_INDEX_TO_NUM(tbl: {}): {}`
will replace all instances of named indexes with a unique number constant.
## Valid Usage
```lua
local foo = MV_INDEX_TO_NUM({total = 0})
for i = 1, 10 do
foo.total = foo.total + i
end
return foo.total
```

View File

@@ -0,0 +1,22 @@
---
weight: 100
title: "MV_OMIT_FUNCTION"
description: "Omit all mangling steps"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_OMIT_FUNCTION<A..., R...>(omit: (A...) -> R...): (A...) -> R...`
will omit all mangling steps from the passed function, will also disregard any indexes set by `MV_INDEX_TO_NUM`
## Valid Usage
```lua
local dontMangleMe = MV_OMIT_FUNCTION(function()
print("im in plaintext!")
end)
donMangleMe()
```

View File

@@ -0,0 +1,23 @@
---
weight: 100
title: "MV_VM"
description: "Virtualize function"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
`declare function MV_VM<A..., R...>(vmFunction: (A...) -> R...): (A...) -> R...`
will mark the passed function to be lifted into the VM.
## Valid Usage
```lua
local virtualizedFunction = MV_VM(function(a, b, c)
print(a .. b .. c .. " im in the vm!")
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

@@ -0,0 +1,8 @@
---
weight: 100
title: "Macros"
description: "Obfuscator API"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---

View File

@@ -0,0 +1,8 @@
---
weight: 200
title: "Options"
description: "Options for the obfuscator"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---

View File

@@ -0,0 +1,21 @@
---
weight: 100
title: "Flatten control flow"
description: "Control flow flattener"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
This option will enable the Control Flow Flattener (CFF). This feature is conservative in it's estimates of what can be flattened, if a block can't be flattened without side effects, it will be discarded from the flattening queue. CFF is applied recursively to failed blocks, meaning if a block is discarded from the flattening queue, its children may be flattened individually.
The control flow flattener supports the following branching syntaxes:
- `if` statements
- `while` and `repeat` loops
- numeric `for` loops
- `for-in` loops and even support for [Luau's generalized iteration](https://luau.org/syntax#generalized-iteration)
The following child options are available:
- `Wrap CFF blocks`: This will move some CFF blocks into their own closure in a lookup table.
- `Hoist locals`: Will move local storage into a lookup table for CFF blocks. Useful to cut down on the number of used locals.

View File

@@ -0,0 +1,18 @@
---
weight: 100
title: "Mangle Statements"
description: "Constant decomposition and statement patching"
icon: "article"
date: "2025-05-01T18:47:58-05:00"
lastmod: "2025-05-01T18:47:58-05:00"
---
This option will enable non-destructive constant decomposition and various statement patching.
The following child options are available:
- `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)`.
- `Mangle Named Indexes`: Replaces `x.foo` with `x[<obfuscated "foo">]`. This will mangle the string regardless of whether `Mangle Strings` is enabled.
- `Mangle Globals`: Globals are replaced with a cached global table indexed by an obfuscated string. eg. `print` becomes `_ENV[<obfuscated "print">]`

View File

@@ -0,0 +1,12 @@
---
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/) and provide many useful tools for obfuscation.