diff --git a/content/docs/macros/MV_ENC_FUNC.md b/content/docs/macros/MV_ENC_FUNC.md index 2547f9f..8b7d00b 100644 --- a/content/docs/macros/MV_ENC_FUNC.md +++ b/content/docs/macros/MV_ENC_FUNC.md @@ -11,6 +11,8 @@ lastmod: "2025-05-01T18:47:58-05:00" will virtualize and encrypt the passed function constant with the provided `encryptKey`. Then `decryptKey` is evaluated at runtime to grab the key. There are no restrictions on the length or the allowed characters of the keys, only that they are the same. +{{% alert context="info" text="**Note**: `LPH_ENCFUNC` is an available alias." /%}} + ## Valid Usage ```lua local total = 0 diff --git a/content/docs/macros/MV_OMIT_FUNCTION.md b/content/docs/macros/MV_OMIT_FUNCTION.md index 71e5a98..0d551bc 100644 --- a/content/docs/macros/MV_OMIT_FUNCTION.md +++ b/content/docs/macros/MV_OMIT_FUNCTION.md @@ -11,7 +11,9 @@ lastmod: "2025-05-01T18:47:58-05:00" 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. -`MV_OMIT_FUNCTION` is also an available alias. +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." /%}} ## Valid Usage @@ -24,4 +26,19 @@ donMangleMe() 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" + ``` \ No newline at end of file