same as the last one except luash has better sandboxing now

This commit is contained in:
Izaya 2017-09-13 13:37:26 +10:00
parent 9bbaf67696
commit 781ac82904
2 changed files with 21 additions and 10 deletions

View File

@ -6,7 +6,7 @@
-- Found Here: https://bitbucket.org/Boolsheet/bslf/src/1ee664885805/bit.lua
--
-- Data card support added by https://github.com/SuPeRMiNoR2
_G.sha = {}
sha = {}
if component then
if component.data and not component.ocemu then
shamode = "hardware"
@ -216,3 +216,4 @@ local function datac256(data)
return toHex(datac.sha256(data))
end
end
return sha

View File

@ -1,17 +1,18 @@
cd=fs.cd
rm=fs.rm
mkdir=fs.mkdir
cp=fs.cp
mv=fs.mv
function ls(p)
local shutil = {}
shutil.cd=fs.cd
shutil.rm=fs.rm
shutil.mkdir=fs.mkdir
shutil.cp=fs.cp
shutil.mv=fs.mv
function shutil.ls(p)
for k,v in ipairs(fs.list(p)) do print(v) end
end
function cat(p)
function shutil.cat(p)
local f=io.open(p)
print(f:read("*a"))
f:close()
end
function ps(f)
function shutil.ps(f)
local f=f or ""
print("PID\tName")
for k,v in pairs(os.tasks()) do
@ -20,13 +21,22 @@ function ps(f)
end
end
end
function mem()
function shutil.mem()
print(" \tTotal\tFree\tUsed")
io.write("Mem\t")
io.write(tostring(math.floor(computer.totalMemory()/1024)).."K\t")
io.write(tostring(math.floor(computer.freeMemory()/1024)).."K\t")
print(tostring(math.floor((computer.totalMemory()-computer.freeMemory())/1024)).."K\t")
end
function shutil.genenv()
local et = os.genenv()
for k,v in pairs(shutil) do
if k ~= "genenv" then
et[k] = v
end
end
return et
end
function loadfile(fn)
local f=io.open(fn,"rb")
local S=f:read("*a")