Advertisement
Guest User

sdcompress

a guest
Aug 9th, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. local ipack = require "ipack"
  2.  
  3. local args = {...}
  4. local infile = args[1]
  5. local outfile = args[2]
  6. local f=io.open(infile,"rb")
  7. local g=io.open(outfile,"wb")
  8. local a=f:read("*a")
  9. f:close()
  10. local f=io.open(outfile,"wb")
  11. local n = string.byte(a:sub(1,1))+5
  12. local i = 2
  13. repeat
  14.  print(n,i)
  15.  print(a:sub(i,i+n),a:sub(i,i+n):len())
  16.  s=ipack.decompress(a:sub(i,i+n),8,0)
  17.  print(s)
  18.  g:write(s)
  19.  n=string.byte(a:sub(i+s:len(),i+s:len()))
  20.  i=n+1+s:len()
  21. until n == nil
  22. f:close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement