mikeryan / unuzip

decompress FreeBSD UZIP image files
MIT License
5 stars 3 forks source link

uzip file that fails to decompress the last block #1

Open darkstar opened 5 years ago

darkstar commented 5 years ago

I have an uzip 2.0 file which decompresses fine except for the last block where it fails:

UZIP v2.0 file detected
Decompressing rootfs.img to rootfs.ufs

Block size:         6144
Total blocks:     199510
Total size:   1225789440

  0%
 10%
 20%
 30%
 40%
 50%
 60%
 70%
 80%
 90%
Error: decompression error at 199509

I modified the output in that case to see what is going on:

Error: decompression error at 199509, expected 6144 bytes, got 2048

Seems there's 4096 bytes "missing" somehow. In my case I just added code to write the partial block to the output and the resulting image seems to work just fine...

I cannot post a link to the uzip-image in question (it contains copyrighted code) but I can share it with you privately if you want to take a look at it. It's around 350mb.