Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Anonymise me By rahph
- --THIS IS THE PART WHERE WE INJECT MY CRAPPY API
- print("Injecting menu API (Embeeded)")
- _G.menuApi = {}
- _G.menuApi.display = function(sTitle,tOptions,tSelectionCallbacks)
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print(sTitle)
- for i=1,#tOptions do
- print(i .. ") " .. tOptions[i])
- end
- write("Selection > ")
- local sel = tonumber(read())
- if sel then
- if tSelectionCallbacks[sel] then
- tSelectionCallbacks[sel]()
- break
- else
- print("Malformed selection")
- sleep(1)
- end
- else
- print("Malformed selection")
- sleep(1)
- end
- end
- end
- local shouldRestore
- if _G.backup then
- shouldRestore = true
- end
- print("Done!")
- -- Backup routines
- if not shouldRestore then
- _G.backup = {}
- _G.backup.os = {}
- _G.backup.os.version = _G.os.version
- _G.backup.os.getComputerLabel = _G.os.getComputerLabel
- _G.backup.os.getComputerID = _G.os.getComputerID
- end
- --Program code
- function spoofID()
- print("What should be the new ID?")
- local newid = tonumber(read())
- if newid then
- _G.os.getComputerID = function() return newid end
- else
- print("No!")
- end
- sleep(1)
- end
- function spoofLabel()
- print("What should the new label be?")
- local newlabel = read()
- _G.os.getComputerLabel = function() return newLabel end
- sleep(1)
- end
- function spoofVersion()
- print("What should the new version be?")
- local newversion = read()
- _G.os.version = function() return newversion end
- sleep(1)
- end
- function restoreAll()
- _G.os.version = _G.backup.os.version
- _G.os.getComputerID = _G.backup.os.getComputerID
- _G.os.getComputerLabel = _G.backup.os.getComputerLabel
- _G.backup = nil
- end
- local exit = false
- if not shouldRestore then
- while not exit do
- menuApi.display("What would you like to do?",{
- "Spoof my ID",
- "Spoof the computer label",
- "Spoof the os.version() string",
- "Exit"
- },
- {
- function()
- spoofID()
- end,
- function()
- spoofLabel()
- end,
- function()
- spoofVersion()
- end,
- function()
- exit = true
- end
- })
- end
- else
- menuApi.display("You already anonymised yourself. Restore to change",{
- "Restore all",
- "Exit"
- },
- {
- function()
- restoreAll()
- end,
- function()
- exit = true
- end
- })
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement