Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' function frombase64(data) data = string.gsub(data, '[^'..b..'=]', '') return (data:gsub('.', function(x) if (x == '=') then return '' end local r,f='',(b:find(x)-1) for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end return r; end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x) if (#x ~= 8) then return '' end local c=0 for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end return string.char(c) end)) end function lzw_decode(s) local str = { } for i=1,#s/2,1 do table.insert(str, s:byte(i * 2 - 1) * 256 + s:byte(i * 2)) end local dict_size = 256 local dict = {} for i = 0, dict_size-1 do dict[i] = string.char(i) end local w = string.char(str[1]) local result = w for i = 2, #str do local k = str[i] local entry = '' if dict[k] then entry = dict[k] elseif k == dict_size then entry = w .. w:sub(1,1) else return nil end result = result .. entry dict[dict_size] = w .. entry:sub(1,1) dict_size = dict_size + 1 w = entry end return result end d = 'AAsvaW50cm9Ib3VzZQEADC4ACgAAAAkAUwBjAGgAZQBtAGEAdABpAGMABwAAAAYAQgBsAG8AYwBrAHMAAAAAACUAIABZARkBGgEaAAIBHQEeAR8BHgEVAFkAAwEkASUAAwBZASABKQEdASIBJgEkAAQBLwEwATEBMAADAAIBLAEnARkAAwEyAToBLwE0ATYBGgArAUABQQFCATEBPQAAASMBNwBZACsBFQFLAUsAKwFEATUBRgEuAUEBTAFMAU4BMwErAUcABAFKAVQBVQFPATUBOAFaAVwBXQFXATUBHQE5AVsBYgAAAVYBPAEgAWcBaQEVAWsABAE0AR8BZwFCAXYBQAFeAAIBQQE7AXwBLwF2AUkBfQF8ACsAEQAUAUAAEQFxAYEBOQFaAUIBgAEeAScBcwGKAScAEQF+AAEBagGDAU4BNAEmATgABQGcAAMBkwFhAAEAAQArAY0BowEkAZwBpwGcAFkBnwFbAYYBTgF6AUc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FhAZXBKYFugAMAFQAaQBsAGUARQBuAQkBCQBlAHMBAAEVAAIAAwH9AHgBSwXTAAAABQBUAGUAeAB0ADQBFQZ2AAEAeQJ0BSwGfAZ+AHQAMwaCAf0AegFLAAoGhwZ9Bn8AMgEVBSwAAgBpAGQFgABTAGkAZwBuBpEGiQAxAUsGgwZ4BZcGnwZ/BoEB7wH9BoUCqgamBooGjAABBo4BFQaQBnsGkgB0BpQAAAaWBpgGmgacBp4GtAagBnkGuAZtBm8AaQZxBnMGdAENAEwAZQBuAGcAdABoAAAAJAZ2AAkAVwBFAE8AZgBmAHMAZQB0AFgAwwC/BtwG3gCoBtEG0wbVBtcG2QBZAUwG4QbUBTEAZwBpAG4AWgbeBt0AvgA8BugG4wbYAHQAWgFLASsABgBIAGUGnABoAHQAAAALBvMG6gbsBuYFWwcCBpwG7AbbBt0G3QC7ADcBNQAFAFcGmAbNAAAAGAAA' data = frombase64(d) print('Where do you want to extract introHouse?') dir = read() if dir:sub(1,1) ~= '/' then dir = '/'..fs.getDir(shell.getRunningProgram())..'/'..dir end fs.delete(dir) local i = 1 local path = '' while i <= #data do local c = data:byte(i) if c == 0 then i = i + 1 local l = data:byte(i) path = dir..'/'..data:sub(i + 1, i + l) i = i + l + 1 elseif c == 1 then i = i + 3 local l = data:byte(i - 2) * 65536 + data:byte(i - 1) * 256 + data:byte(i) local f = fs.open(path, 'w') f.write(lzw_decode(data:sub(i + 1, i + l))) f.close() i = i + l + 1 elseif c == 2 then fs.makeDir(path) i = i + 1 end end print('Extraced to '..dir..'.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement