Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Program Title: BlueLock
- Version: v2.0
- Author: BlueZero
- Platform: ComputerCraft
- --]]
- os.pullEvent = os.pullEventRaw
- security = true
- maxTries = 4
- tries = 0
- function splash()
- shell.run("clear")
- print("\n\n")
- print([[
- __________ .__
- \______ \| | __ __ ____
- | | _/| | | | \_/ __ \
- | | \| |__| | /\ ___/
- |______ /|____/|____/ \___ >
- .____ \/ __ \/
- | | ____ ____ | | __
- | | / _ \ _/ ___\ | |/ /
- | |___( <_> )\ \___ | <
- |_______ \\____/ \___ >|__|_ \
- \/ \/ \/]])
- sleep(2)
- return blueLock()
- end
- function blueLock()
- gateKeeper()
- local hashFile = fs.open("bluelock-2.0/misc/hashpw", "r")
- local hashRead = hashFile.readAll()
- hashFile.close()
- credits = "be379a30f1aa05d130468f4818fc077ccd2a8b9c972cf5dc901eed1be8587ab8"
- bluezero = "3937018735b580b5ea239c5ff656e7cc710cf8266c60c9caa6d7633d686b44c8"
- if userHash == hashRead then
- return passCorrect()
- end
- if userHash == credits then
- shell.run("clear")
- print("")
- print([[
- ___ _ __ _
- / __\| | _ _ ___ / / ___ ___ | | __
- /__\//| || | | | / _ \ / / / _ \ / __|| |/ /
- / \/ \| || |_| || __// /___| (_) || (__ | <
- \_____/|_| \| | \___||_|\_\
- ___ _ | | _
- / __\| | _| | ___ | | __
- /__\//| || | | / __|| |/ /
- / \/ \| || | || (__ | <
- \_____/|_| \| | \___||_|\_\
- ___ _ | | _
- / __\| | _| | ___ | | __
- /__\//| || | | / __|| |/ /
- / \/ \| || |_| || __// /___| (_) || (__ | <
- \_____/|_| \__,_| \___|\____/ \___/ \___||_|\_\
- ]])
- term.setCursorPos(15,7)
- write(" Bluelock 2.0")
- term.setCursorPos(15,9)
- write(" Design & Programming")
- term.setCursorPos(15,10)
- write(" BlueZero")
- term.setCursorPos(15,12)
- write(" Hashbrowns")
- term.setCursorPos(15,13)
- write(" GravityScore")
- sleep(3)
- return blueLock()
- end
- if userHash == bluezero then
- print([[
- __/\\\___/\\\\\\\\\\\\\_____/\\\_
- _\/\\\__\/\\\/////////\\\__\/\\\_
- _\/\\\__\/\\\_______\/\\\__\/\\\_
- _\///___\/\\\\\\\\\\\\\\___\///__
- ________\/\\\/////////\\\________
- __/\\\__\/\\\_______\/\\\___/\\\_
- _\/\\\__\/\\\_______\/\\\__\/\\\_
- _\/\\\__\/\\\\\\\\\\\\\/___\/\\\_
- _\///___\/////////////_____\///__
- __/\\\___/\\\\\\\\\\\\\\\___/\\\_
- _\/\\\__\////////////\\\___\/\\\_
- _\/\\\____________/\\\/____\/\\\_
- _\///___________/\\\/______\///__
- ______________/\\\/______________
- __/\\\______/\\\/___________/\\\_
- _\/\\\____/\\\/____________\/\\\_
- _\/\\\___/\\\\\\\\\\\\\\\__\/\\\_
- _\///___\///////////////___\///__]])
- sleep(4)
- return blueLock()
- end
- if not (userHash == hashRead) or (userHash == credits) or (userHash == bluezero) then
- if tries == maxTries -1 then
- if security == true then
- osProtect()
- end
- else
- tries = tries + 1
- shell.run("clear")
- print("")
- print([[
- ___ _ __ _
- / __\| | _ _ ___ / / ___ ___ | | __
- /__\//| || | | | / _ \ / / / _ \ / __|| |/ /
- / \/ \| || |_| || __// /___| (_) || (__ | <
- \_____/|_| \| | \___||_|\_\
- ___ _ | | _
- / __\| | _| | ___ | | __
- /__\//| || | | / __|| |/ /
- / \/ \| || | || (__ | <
- \_____/|_| \| | \___||_|\_\
- ___ _ | | _
- / __\| | _| | ___ | | __
- /__\//| || | | / __|| |/ /
- / \/ \| || |_| || __// /___| (_) || (__ | <
- \_____/|_| \__,_| \___|\____/ \___/ \___||_|\_\
- ]])
- term.setCursorPos(15,8)
- write("Incorrect Option")
- term.setCursorPos(15,9)
- write("or Password.")
- term.setCursorPos(15,11)
- write("Tries left: "..maxTries - tries)
- sleep(2)
- return blueLock()
- end
- end
- end
- function gateKeeper()
- shell.run("clear")
- os.loadAPI("bluelock-2.0/apis/hash")
- print("")
- print([[
- ___ _ __ _
- / __\| | _ _ ___ / / ___ ___ | | __
- /__\//| || | | | / _ \ / / / _ \ / __|| |/ /
- / \/ \| || |_| || __// /___| (_) || (__ | <
- \_____/|_| \| | \___||_|\_\
- ___ _ | | _
- / __\| | _| | ___ | | __
- /__\//| || | | / __|| |/ /
- / \/ \| || | || (__ | <
- \_____/|_| \| | \___||_|\_\
- ___ _ | | _
- / __\| | _| | ___ | | __
- /__\//| || | | / __|| |/ /
- / \/ \| || |_| || __// /___| (_) || (__ | <
- \_____/|_| \__,_| \___|\____/ \___/ \___||_|\_\
- ]])
- term.setCursorPos(15,7)
- write("Bluelock 2.0 running ")
- term.setCursorPos(15,8)
- write("on computer: "..os.getComputerID())
- term.setCursorPos(15,9)
- write("OS: "..os.version())
- term.setCursorPos(15,10)
- write("To view credits")
- term.setCursorPos(15,11)
- write("type \"credits\".")
- term.setCursorPos(15,13)
- write("Password: ")
- input = io.read()
- userHash = hash.sha256(input)
- shell.run("clear")
- end
- function osProtect()
- shell.run("clear")
- print("")
- print([[
- ___ _ __ _
- / __\| | _ _ ___ / / ___ ___ | | __
- /__\//| || | | | / _ \ / / / _ \ / __|| |/ /
- / \/ \| || |_| || __// /___| (_) || (__ | <
- \_____/|_| \| | \___||_|\_\
- ___ _ | | _
- / __\| | _| | ___ | | __
- /__\//| || | | / __|| |/ /
- / \/ \| || | || (__ | <
- \_____/|_| \| | \___||_|\_\
- ___ _ | | _
- / __\| | _| | ___ | | __
- /__\//| || | | / __|| |/ /
- / \/ \| || |_| || __// /___| (_) || (__ | <
- \_____/|_| \__,_| \___|\____/ \___/ \___||_|\_\
- ]])
- term.setCursorPos(15,8)
- textutils.slowWrite("Too many failed", 50)
- term.setCursorPos(15,9)
- textutils.slowWrite("attempts.", 50)
- sleep(2)
- term.setCursorPos(15,11)
- textutils.slowWrite("Good try, dumbass.", 50)
- sleep(0.5)
- os.shutdown()
- end
- function passCorrect()
- shell.run("clear")
- print("\n\n")
- print([[
- _____ _
- | __ \ | |
- | |__) |_ _ ___ _____ _____ _ __ __| |
- | ___/ _ / __/ __\ \ /\ / / _ \| '__/ _ |
- | | | (_| \__ \__ \\ V V / (_) | | | (_| |
- |_| \__,_|___/___/ \_/\_/ \___/|_| \__,_|
- /\ | | | |
- / \ ___ ___ ___ _ __ | |_ ___ __| |
- / /\ \ / __/ __/ _ \ '_ \| __/ _ \/ _ |
- / ____ \ (_| (_| __/ |_) | || __/ (_| |
- /_/ \_\___\___\___| .__/ \__\___|\__,_|
- | |
- |_| ]])
- sleep(2)
- shell.run("clear")
- error()
- end
- function newCheck()
- shell.run("clear")
- if fs.exists("startup") then
- local rf = fs.open("startup", "r")
- local ef = fs.open("startup", "a")
- lines = rf.readAll()
- rf.close()
- while lines do
- if lines and string.find(lines, 'shell.run("bluelock-2.0/bluelock")', 1, true) then
- return install()
- else
- print("Preparing for first time run.")
- sleep(1)
- print("\nStartup File Detected. Adding BlueLock to startup file.\n\nNote: If you have a custom sequence for your startup file BlueLock has been added to the end of the file.\n\nBe sure to place BlueLock's startup opperation in a more appropriate spot in your file.")
- ef.write([[shell.run("bluelock-2.0/bluelock")]].."\n")
- ef.close()
- sleep(10)
- return install()
- end
- end
- elseif not fs.exists("startup") then
- local ef = fs.open("startup", "a")
- print("Preparing for first time run.\n")
- sleep(1)
- print("Startup File Not Detected, creating Startup File.")
- ef.write([[shell.run("bluelock-2.0/bluelock")]])
- ef.close()
- sleep(3)
- return install()
- end
- end
- function install()
- if fs.exists("bluelock") then
- shell.run("clear")
- write("Installing BlueLock.\n")
- sleep(1)
- write("Creating BlueLock Directory... ")
- fs.makeDir("bluelock-2.0")
- sleep(0.5)
- write("Done\n")
- sleep(0.5)
- write("Creating API Directory... ")
- fs.makeDir("bluelock-2.0/apis")
- sleep(0.5)
- write("Done.\n")
- sleep(0.5)
- write("Creating Data Storage... ")
- fs.makeDir("bluelock-2.0/misc")
- sleep(0.5)
- write("Done.\n")
- sleep(0.5)
- write("Moving BlueLock to BlueLock Directory... ")
- fs.move("bluelock", "bluelock-2.0/bluelock")
- sleep(0.5)
- write("Done.\n")
- sleep(0.5)
- write("Downloading API.\n")
- sleep(0.5)
- local response = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode("TDYrY85F"))
- if response then
- sleep(0.5)
- print("API Downloaded, Writing File.")
- local gotCode = response.readAll()
- response.close()
- local hashFile = fs.open("hash", "w")
- hashFile.write(gotCode)
- hashFile.close()
- sleep(0.5)
- print("File Written Successfully.")
- else
- error("Could not download API.")
- end
- sleep(0.5)
- write("Moving API to API Directory... ")
- fs.move("hash", "bluelock-2.0/apis/hash")
- sleep(0.5)
- write("Done.\n")
- sleep(0.5)
- write("Downloading Misc Tools.\n")
- sleep(0.5)
- local response = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode("D8ssqvAn"))
- if response then
- sleep(0.5)
- print("Tools downloaded, Writing File.")
- local gotCode = response.readAll()
- response.close()
- local hashFile = fs.open("passchange", "w")
- hashFile.write(gotCode)
- hashFile.close()
- sleep(0.5)
- print("File Written Successfully.")
- else
- error("Could not download Misc Tools.")
- end
- sleep(0.5)
- write("Moving Tools to Main Directory... ")
- fs.move("passchange", "bluelock-2.0/misc/passchange")
- sleep(0.5)
- write("Done.\n")
- sleep(2)
- return createPassword()
- else
- return splash()
- end
- end
- function createPassword()
- if not fs.exists("bluelock-2.0/misc/hashpw") then
- local hash1 = ""
- local hash2 = ""
- os.loadAPI("bluelock-2.0/apis/hash")
- sleep(2)
- shell.run("clear")
- print("Please enter your password.\n\nBe careful! Password is Case Sensitive!\n")
- write("Password: ")
- userInput = io.read()
- hash1 = hash.sha256(userInput)
- shell.run("clear")
- print("Please enter your password again.\n")
- write("Password: ")
- userInput = io.read()
- hash2 = hash.sha256(userInput)
- shell.run("clear")
- if hash1 == hash2 then
- local hFile = fs.open("bluelock-2.0/misc/hashpw", "w")
- hFile.write(hash1)
- hFile.close()
- return splash()
- else
- print("Passwords don't match, please try again.")
- fs.delete("bluelock-2.0/misc/hashpw")
- return createPassword()
- end
- else
- return splash()
- end
- end
- newCheck()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement