Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions docs/moonsec.d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"@moonsec/global/MS_ENCRYPT": {
"documentation": "Encrypts the provided string literal using MoonSec's internal string-encryption system. This macro only accepts literal strings, as the encryption is performed at parse time. The macro call is removed and replaced with an encrypted constant in the final output.",
"learn_more_link": "https://raw.githubusercontent.com/spxnso/lua-obfuscators/refs/heads/master/obfuscators/moonsec/versions/v3/README.md",
"code_sample": "print(MS_ENCRYPT('Hello World'))\nlocal a = MS_ENCRYPT([[Oh god]])\nprint(a, \"ENCRYPT:Another hello world\")",
"params": [
{
"name": "toEncrypt",
"type": "string",
"documentation": "A literal string to be encrypted at compile time."
}
],
"returns": [
"string"
]
},

"@moonsec/global/MS_WATERMARK": {
"documentation": "Sets a custom watermark to be injected into the obfuscated file. The watermark is required to remain present; removing or altering it will break the script at runtime. This macro is only usable with literal strings, as it is processed and removed before final compilation.",
"learn_more_link": "https://raw.githubusercontent.com/spxnso/lua-obfuscators/refs/heads/master/obfuscators/moonsec/versions/v3/README.md",
"code_sample": "MS_WATERMARK('This file was skidded with your mom in my bed')\nprint('hello world')",
"params": [
{
"name": "watermark",
"type": "string",
"documentation": "A literal string to embed as the file's required watermark."
}
],
"returns": []
},

"@moonsec/global/MOONSEC_EXIT": {
"documentation": "Immediately terminates the executing script and all of its threads. This is a hard stop that halts the interpreter context and guarantees no further Lua code will continue executing.",
"learn_more_link": "https://raw.githubusercontent.com/spxnso/lua-obfuscators/refs/heads/master/obfuscators/moonsec/versions/v3/README.md",
"code_sample": "for i = 1, 15 do\n spawn(function()\n while wait(1) do print('x') end\n end)\nend\n\nprint('bye bye')\nMOONSEC_EXIT()\nprint('this will never be printed')",
"params": [],
"returns": [
"never"
]
},

"@moonsec/global/MOONSEC_GET_SCRIPT_ID": {
"documentation": "Returns the unique script identifier assigned to this specific obfuscated output. The ID is newly generated for every obfuscation pass, and always falls between 111111111 and 999999999.",
"learn_more_link": "https://raw.githubusercontent.com/spxnso/lua-obfuscators/refs/heads/master/obfuscators/moonsec/versions/v3/README.md",
"code_sample": "print(MOONSEC_GET_SCRIPT_ID())",
"params": [],
"returns": [
"number"
]
}
}
3 changes: 3 additions & 0 deletions types/environment.d.luau
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ declare function newcclosure<A..., R...>(function_to_wrap: GenericFunction<A...,
declare function restorefunction(functionToRestore: AnyFunction): ()

declare function getnamecallmethod(): string
declare function setnamecallmethod(ncm: string): any?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove since should be completed by #11

--#endregion

--#region Console
Expand Down Expand Up @@ -354,3 +355,5 @@ type WebSocket = {
}
declare WebSocket: WebSocket
--#endregion
declare getthreadcontext(): number
declare setthreadcontext(context: number): any?
Comment on lines +358 to +359

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add docs for these new defs or remove the lines

5 changes: 5 additions & 0 deletions types/moonsec.d.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--#region MoonSec Macros
declare function MS_ENCRYPT(toEncrypt: string): string
declare function MS_WATERMARK(watermark: string): ()
declare function MOONSEC_EXIT(): never
declare function MOONSEC_GET_SCRIPT_ID(): number