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

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"
---