Skip to content

A python module to handle lzo compression file

License

Notifications You must be signed in to change notification settings

clubby789/python-lzo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##A simple and sometimes naive python lzo library.

This is a python library deals with lzo files compressed with lzop.
There is a python-lzo module in github, but it's for compressing strings using lzo.
This module is for lzop generate *file*. It parses the header structures and check the checksum.

One possible usage is unpack Android(linux) kernel boot.img. And actually it's why I create this ugly module.

##Usage##
You can use it as command line tools:

    python lzo.py file_to_compress

Or import it into your script

    import lzo
    f = lzo.open('compressed.lzo', 'wb')
    data = #some data
    f.write(data)

Open boot.img:

    import lzo
    f = open('boot.img', 'rb')
    f.seek(#calculate your offset)
    LzoFile(fileobj=f, mode = 'rb')



Known issues:
crc32 checksum not supported, because no such function in minilzo library
filter not supported, but version number not current
path name not supported
mtime read but not set


TODO:
check if liblzo presents. Use it if so, otherwise use builtin minilzo
figure out why signature check fails like lzop does

About

A python module to handle lzo compression file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 95.8%
  • Python 4.2%