🔏
MoonSec Obfuscator
  • MoonSec Obfuscator Macros
  • MoonSec REST API docs
Powered by GitBook
On this page
  • Encrypt a string:
  • Exclude string from encryption:
  • Get decrypted string table: GetDST(<void>)
  • EQ Macro: __secureeq(variable1, variable2)

Was this helpful?

MoonSec Obfuscator Macros

This documentation will show you how to use macros properly.

Encrypt a string:

If you want to encrypt a specific string, use this macro. Just add "ENCRYPT:" in a string as a prefix.

local str1 = "ENCRYPT:Hi LOL"
local str2 = [[ENCRYPT:Whats good?]]
local api = game:HttpGet("ENCRYPT:https://f3d.at")
local a = [[ENCRYPT:
Multiline
thing]]

Exclude string from encryption:

If you want to encrypt all strings but a specific one, include 'NO_ENCRYPT:' in the string.

local c = "NO_ENCRYPT:Hello there";
local f = [[NO_ENCRYPT:Hello world!]]
local x = 'NO_ENCRYPT:Hello!';
local s = [[NO_ENCRYPT:
Multiline
string
]]

Strings smaller than 4 characters or longer than 512 characters will not be encrypted.

Get decrypted string table: GetDST(<void>)

Returns the table that stores decrypted strings. This can be used for debugging purposes or to modify a string directly from the script.

table.foreach(GetDST(), print)

for i,v in pairs(GetDST()) do
    if v == "Hello world" then
        GetDST()[i] = "New value"
    end
end

EQ Macro: __secureeq(variable1, variable2)

This macro is still under development and currently not public, but here is the usage.

This macro encrypts the if-else statement and decrypts it only if statement actually equals true, therefore stops JMP / EQ hooking based attacks to crack whitelist systems.

This macro is under development, if you use it now, it will act like a regular __eq.

local WhitelistedHWID = "abcd1234" -- example string 1
local MyHWID = Player:GetHWID() -- example string 2

if __secureeq(MyHWID, WhitelistedHWID) then
    print("Authorized")
end

if __secureeq("1244", "12".."44") then
    print("Equals")
end

if __secureeq(nil, 7) then
    print("No way")
end

You shouldn't use any "or" operator to connect multiple statements while using secureeq macro. If one side equals true, it will cause strings to stay encrypted and break your code.

You shouldn't assign or overwrite secureeq function. You can still use it as == operator but it will not have extra security if you use it outside an if-else statement. (e.g local test = __secureeq(1,2))

NextMoonSec REST API docs

Last updated 4 years ago

Was this helpful?