Advertisement
CoLDarkness

bytecod

Jan 21st, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. arg = {...}
  2. function loadf(d)
  3. local f = fs.open(d,"r")
  4. local dat = f.readAll()
  5. f.close()
  6. return loadstring(dat)
  7. end
  8.  
  9. binary = string.dump(loadf(arg[1]))
  10. formatted_binary = ""
  11. for i = 1,string.len(binary) do
  12. dec, _ = ("\\%3d"):format(binary:sub(i,i):byte()):gsub(' ','0')
  13. formatted_binary = formatted_binary..dec
  14. end
  15.  
  16. out = fs.open("/lul","w")
  17. out.writeLine('loadstring("'..formatted_binary..'")()')
  18. out.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement