Add Befator Inc Security

This commit is contained in:
Bommels05 2025-10-20 16:18:50 +02:00
parent 3ac962f765
commit 16da0a1837
3 changed files with 113 additions and 0 deletions

22
bios.lua Normal file
View File

@ -0,0 +1,22 @@
local function main()
print("Befator Inc Security: Starting Computer...")
if not fs.exists("security.lua") or not fs.exists("real_startup.lua") then
term.setTextColour(colors.red)
write("Befator Inc Security: System Integrity failure")
while true do
local i = 0
while i < 3 do
write(".")
os.sleep(1)
i = i + 1
end
write("\nReinstallation required")
os.sleep(1)
end
else
shell.execute("security.lua")
end
end
pcall(main)
shell.execute("reboot")

View File

@ -219,6 +219,9 @@ local cor = coroutine.create(
lStore.store("installer/packagenext.lua")
lStore.store("installer/licensenextclicky.lua")
lStore.store("security.lua")
lStore.store("bios.lua")
local ok, err = pcall(function() lStore.run("Installer.sgui") end)
if not ok then
printError(err)

88
security.lua Normal file
View File

@ -0,0 +1,88 @@
--Disable Shell
--multishell.setTitle = function()
-- error("Access Denied")
--end
--shell.execute = multishell.setTitle
--Disable Store, Cloud
http.request = function()
return false, "Network Access Denied"
end
--http.post = http.get
--Disable Lua
local originalWrite = _G.write
_G.write = function(text)
if text == "lua> " then
error("Befator Inc Security: Lua Interpreter Access Denied")
end
return originalWrite(text)
end
--Protect self and disable rom
local function shouldProtect(path)
return fs.getName(path) == "security.lua"
end
local originalOpen = fs.open
fs.open = function(path, mode)
if (shouldProtect(path) or path:find("^rom/programs") ~= nil) then
error("Befator Inc Security: Access Denied")
else
return originalOpen(path, mode)
end
end
local origininalDel = fs.delete
fs.delete = function(path)
if shouldProtect(path) then
error("Befator Inc Security: Access Denied")
else
return origininalDel(path)
end
end
local origininalMove = fs.move
fs.move = function(path, dest)
if shouldProtect(path) then
error("Befator Inc Security: Access Denied")
else
return origininalMove(path, dest)
end
end
local origininalCopy = fs.copy
fs.copy = function(path, dest)
if shouldProtect(path) then
error("Befator Inc Security: Access Denied")
else
return origininalCopy(path, dest)
end
end
local origininalExists = fs.exists
fs.exists = function(path)
if shouldProtect(path) then
return false
else
return origininalExists(path)
end
end
local origininalList = fs.list
fs.list = function(path)
local ls = origininalList(path)
for i=#ls,1,-1 do
if ls[i] == "security.lua" then
table.remove(ls, i)
end
end
return ls
end
--OS Config
fs.delete("/User/Desktop/Cloud.llnk")
fs.delete("/User/Desktop/Store.llnk")
fs.delete("/LevelOS/Global_Login.lua")
fs.delete("/LevelOS/data/changelog.lconf")
--Force Login Screen
local f = fs.open("/LevelOS/data/account.txt", "w")
f.write("Befator's Sklave")
f.close()
shell.execute("real_startup")