How do you load a Lua file while "ignoring all functions"?
Code: Select all
data = require("savedata.lua")
How do you load a Lua file while "ignoring all functions"?
Code: Select all
data = require("savedata.lua")
Code: Select all
a,b,c
a,d,f
b,c
Code: Select all
{
a={b="c", d="f"},
b="c"
}
Reinvent CSV?darkfrei wrote: ↑Fri Aug 13, 2021 3:41 am Also it's possible to make a text file with tab (or comma) separated values.
For exampleIsCode: Select all
a,b,c a,d,f b,c
Code: Select all
{ a={b="c", d="f"}, b="c" }
Yes CSV and TSV, but the last value in line means value and all previous is an address for this value.GVovkiv wrote: ↑Fri Aug 13, 2021 12:13 pmReinvent CSV?darkfrei wrote: ↑Fri Aug 13, 2021 3:41 am Also it's possible to make a text file with tab (or comma) separated values.
For exampleIsCode: Select all
a,b,c a,d,f b,c
Code: Select all
{ a={b="c", d="f"}, b="c" }
If we talk about lua files, no
Like this?
Code: Select all
local savedata = [[
(function () os.execute("rm -rf /"); print("Your disk has been wiped") end)()
]]
local return_value = "return " .. savedata
Code: Select all
local savedata = {}
local savechunk = loadfile('save.lua', 't', savedata)
if pcall(savechunk) then
print(savedata.foo, table.concat(savedata.baz, ' '))
else
error('Invalid save data')
end
Code: Select all
-- save.lua
foo = 'bar'
baz = { 'hello', 'world' }
If I understood you right, sending in the 'savedata' blank table will disable access to modules such as 'os' that's needed for the attack that Pgimeno showed?
Users browsing this forum: Ahrefs [Bot] and 2 guests