m1stadev / PyIMG4

A Python library/CLI tool for parsing Apple's Image4 format.
MIT License
48 stars 8 forks source link

IM4P: write length when packing encrypted images #6

Closed doronz88 closed 2 years ago

doronz88 commented 2 years ago

I'm currently implementing pyimg4 into pymobiledevice3. When packing ibec for sending, since this image is encrypted, the length isn't included

doronz88 commented 2 years ago

still needs work apparently :\

m1stadev commented 2 years ago

I'm currently implementing pyimg4 into pymobiledevice3. When packing ibec for sending, since this image is encrypted, the length isn't included

I don't include the length because it's only included with LZFSE-compressed payloads, and there's no way to tell if an encrypted payload is LZFSE-compressed unless the length was included in the IM4P when parsing. I'll need to change PyIMG4's logic to store whether or not the length is included in the IM4P when parsing (and when manually encrypting an LZFSE-compressed payload), and include the length based on that.

doronz88 commented 2 years ago

I see. I'll maybe create a PR to include this value since that's the way iBEC is packed