xerub / img4lib

image4 vfs
336 stars 99 forks source link

Add possibility to patch encrypted im4p files if ivkey is present #8

Open krisanovdev opened 4 years ago

krisanovdev commented 4 years ago

Hi, I wanna to patch ibss.im4p, I've already decrypted it and patched. I do not know how to pack it back to encrypted im4p.

xerub commented 4 years ago

you can patch it with -P, there is an example of the patchfile format in the project README. alternatively, you can decrypt, patch, encrypt using openssl enc -aes-256-cbc -nopad, then put back with img4 -R

justtryingthingsout commented 4 years ago

how do i use img4 -R? i keep getting [e] cannot open 'rawimg.bin' when i do img4 -i rawimg.bin -R out.im4p

justtryingthingsout commented 4 years ago

also img4 -i original.im4p -R rawimg.bin -o out.im4p does nothing, checked with vbindiff and diff

xerub commented 3 years ago

You can't replace the payload in an im4p. im4p is the payload. What you can do, however, is to replace the payload (aka im4p) inside an img4. The img4 is a container holding im4p, im4m and (optionally) im4r