-
Notifications
You must be signed in to change notification settings - Fork 6
add moonsec macro definitions #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rex-rbx
wants to merge
4
commits into
rocult:main
Choose a base branch
from
rex-rbx:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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? | ||
| --#endregion | ||
|
|
||
| --#region Console | ||
|
|
@@ -354,3 +355,5 @@ type WebSocket = { | |
| } | ||
| declare WebSocket: WebSocket | ||
| --#endregion | ||
| declare getthreadcontext(): number | ||
| declare setthreadcontext(context: number): any? | ||
|
Comment on lines
+358
to
+359
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add docs for these new defs or remove the lines |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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