Advertisement
PaymentOption

Simple Error Check for Light Shot

Jan 23rd, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. function checkFileForVirus(filePath)
  2.    
  3.     local old_sleep = _G["sleep"]
  4.     _G["sleep"] = function()
  5.     end
  6.    
  7.     local environment = {
  8.         ["os"] = {},
  9.         ["io"] = {},
  10.         ["shell"] = {},
  11.         ["term"] = term,
  12.         ["fs"] = {}
  13.     }
  14.    
  15.     local isVirus, virusError = xpcall(os.run, environment, filePath)
  16.     _G["sleep"] = old_sleep
  17.    
  18.     return isVirus
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement