Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: pylzss not installed, cannot use LZSS compression #16

Open
Volko61 opened this issue Nov 12, 2023 · 6 comments
Open

RuntimeError: pylzss not installed, cannot use LZSS compression #16

Volko61 opened this issue Nov 12, 2023 · 6 comments

Comments

@Volko61
Copy link

Volko61 commented Nov 12, 2023

Describe the bug
I get an error RuntimeError: pylzss not installed, cannot use LZSS compression when using sudo ./palera1n.sh --tweaks 15.8 --semi-tethered

Expected behavior
Not expecting this error and expected it to continue the jailbreak (to later bypass the icloud)

Screenshots
If applicable, add screenshots to help explain your problem.

Info (please complete the following information):

  • Ipad mini 4 iOS 15.8 fresh restore via iTunes
  • Lubuntu 22
  • sudo ./palera1n.sh --tweaks 15.8 --semi-tethered

Debug log
volko@volko-gp72mvr7rfx:~/palera1n-mod$ sudo ./palera1n.sh --tweaks 15.8 --semi-tethered
[sudo] password for volko:
[*] Command ran: sudo ./palera1n.sh --tweaks 15.8 --semi-tethered
palera1n | Version 1.4.2-main-06613ba
Made with ❤ by Nebula, Mineek, Nathan, llsc12, Ploosh, and Nick Chan

palera1n-mod by kitty915 | Version 15.8-main-06613ba
Written by Nebula and Mineek | Some code and ramdisk from Nathan | Loader app by Amy

[] Waiting for devices
[
] Detected recovery mode device
[] Getting device info...
[
] Press any key when ready for DFU mode
Get ready (0)
Hold home + power button (0)
Release power button, but keep holding home button (4)
[] Device entered DFU!
[
] Creating ramdisk
usb_timeout: 5
[libusb] Waiting for the USB handle with VID: 0x5AC, PID: 0x1227
CPID: 0x7000
Found the USB handle.
Stage: RESET
ret: true
[libusb] Waiting for the USB handle with VID: 0x5AC, PID: 0x1227
CPID: 0x7000
Found the USB handle.
Stage: SETUP
ret: true
[libusb] Waiting for the USB handle with VID: 0x5AC, PID: 0x1227
CPID: 0x7000
Found the USB handle.
Stage: PATCH
ret: true
[libusb] Waiting for the USB handle with VID: 0x5AC, PID: 0x1227
CPID: 0x7000
Found the USB handle.
Now you can boot untrusted images.
img4tool version: 0.197-aca6cf005c94caf135023263cbb5c61a0081804f-RELEASE
Compiled with plist: YES
Saved IM4M to work/IM4M
Version: 3fc8c093f4660f6c6e07c0c9214618733da01ffc - 36
libfragmentzip version: 0.60-120447d0f410dffb49948fa155467fc5d91ca3c8
init pzb: https://updates.cdn-apple.com/2022SummerFCS/fullrestores/012-41685/A12D2F85-A629-49EF-B5F7-FDF71C040564/iPad_64bit_TouchID_15.6_19G71_Restore.ipsw
init done
getting: BuildManifest.plist
100% [===================================================================================================>]
download succeeded
Version: 3fc8c093f4660f6c6e07c0c9214618733da01ffc - 36
libfragmentzip version: 0.60-120447d0f410dffb49948fa155467fc5d91ca3c8
init pzb: https://updates.cdn-apple.com/2022SummerFCS/fullrestores/012-41685/A12D2F85-A629-49EF-B5F7-FDF71C040564/iPad_64bit_TouchID_15.6_19G71_Restore.ipsw
init done
getting: Firmware/dfu/iBSS.ipad5.RELEASE.im4p
100% [===================================================================================================>]
download succeeded
Version: 3fc8c093f4660f6c6e07c0c9214618733da01ffc - 36
libfragmentzip version: 0.60-120447d0f410dffb49948fa155467fc5d91ca3c8
init pzb: https://updates.cdn-apple.com/2022SummerFCS/fullrestores/012-41685/A12D2F85-A629-49EF-B5F7-FDF71C040564/iPad_64bit_TouchID_15.6_19G71_Restore.ipsw
init done
getting: Firmware/dfu/iBEC.ipad5.RELEASE.im4p
100% [===================================================================================================>]
download succeeded
Version: 3fc8c093f4660f6c6e07c0c9214618733da01ffc - 36
libfragmentzip version: 0.60-120447d0f410dffb49948fa155467fc5d91ca3c8
init pzb: https://updates.cdn-apple.com/2022SummerFCS/fullrestores/012-41685/A12D2F85-A629-49EF-B5F7-FDF71C040564/iPad_64bit_TouchID_15.6_19G71_Restore.ipsw
init done
getting: Firmware/all_flash/DeviceTree.j97ap.im4p
100% [===================================================================================================>]
download succeeded
Version: 3fc8c093f4660f6c6e07c0c9214618733da01ffc - 36
libfragmentzip version: 0.60-120447d0f410dffb49948fa155467fc5d91ca3c8
init pzb: https://updates.cdn-apple.com/2022SummerFCS/fullrestores/012-41685/A12D2F85-A629-49EF-B5F7-FDF71C040564/iPad_64bit_TouchID_15.6_19G71_Restore.ipsw
init done
getting: Firmware/078-34285-078.dmg.trustcache
100% [===================================================================================================>]
download succeeded
Version: 3fc8c093f4660f6c6e07c0c9214618733da01ffc - 36
libfragmentzip version: 0.60-120447d0f410dffb49948fa155467fc5d91ca3c8
init pzb: https://updates.cdn-apple.com/2022SummerFCS/fullrestores/012-41685/A12D2F85-A629-49EF-B5F7-FDF71C040564/iPad_64bit_TouchID_15.6_19G71_Restore.ipsw
init done
getting: kernelcache.release.ipad5
100% [===================================================================================================>]
download succeeded
Version: 3fc8c093f4660f6c6e07c0c9214618733da01ffc - 36
libfragmentzip version: 0.60-120447d0f410dffb49948fa155467fc5d91ca3c8
init pzb: https://updates.cdn-apple.com/2022SummerFCS/fullrestores/012-41685/A12D2F85-A629-49EF-B5F7-FDF71C040564/iPad_64bit_TouchID_15.6_19G71_Restore.ipsw
init done
getting: 078-34285-078.dmg
100% [===================================================================================================>]
download succeeded
usb_timeout: 5
[libusb] Waiting for the USB handle with VID: 0x5AC, PID: 0x1227
CPID: 0x7000
Found the USB handle.
Now you can boot untrusted images.
[libusb] Waiting for the USB handle with VID: 0x5AC, PID: 0x1227
Found the USB handle.
usb_timeout: 5
[libusb] Waiting for the USB handle with VID: 0x5AC, PID: 0x1227
CPID: 0x7000
Found the USB handle.
Now you can boot untrusted images.
[libusb] Waiting for the USB handle with VID: 0x5AC, PID: 0x1227
Found the USB handle.
main: Starting...
iOS 15 iBoot detected!
getting get_sigcheck_patch() patch
applying patch=0x18038c5a0 : 000080d2
applying patch=0x18038c55c : 000080d2
main: Writing out patched file to work/iBSS.patched...
main: Quitting...
none
main: Starting...
iOS 15 iBoot detected!
getting get_boot_arg_patch(rd=md0 debug=0x2014e wdt=-1 serial=3 -restore) patch
getting get_debug_enabled_patch() patch
getting get_unlock_nvram_patch() patch
getting get_sigcheck_patch() patch
applying patch=0x87000d59c : 000080d2
applying patch=0x87000d558 : 000080d2
applying patch=0x8700017d8 : 000080d2c0035fd6
applying patch=0x870001d58 : 000080d2c0035fd6
applying patch=0x87002ca50 : 000080d2c0035fd6
applying patch=0x87000f170 : 200080d2
applying patch=0x8700106f8 : 3a5e0510
applying patch=0x87001b2bc : 72643d6d64302064656275673d30783230313465207764743d2d312073657269616c3d33202d726573746f726500
applying patch=0x870013ef8 : 1f2003d5
main: Writing out patched file to work/iBEC.patched...
main: Quitting...
none
krnl
main: Starting...
Kernel: Adding AMFI_get_out_of_my_way patch...
get_amfi_out_of_my_way_patch: Entering ...
get_amfi_out_of_my_way_patch: Kernel-8020 inputted
get_amfi_out_of_my_way_patch: Found Internal Error: No cdhash found. str loc at 0x95ec61
get_amfi_out_of_my_way_patch: Found Internal Error: No cdhash found. str ref at 0x1052c64
get_amfi_out_of_my_way_patch: Patching AMFI at 0x104e2a8
main: Writing out patched file to work/kcache.patched...
main: Quitting...
krnl
dtre
rtsc
rdsk
Reading work/ramdisk.dmg...
IM4P outputted to: work/ramdisk.im4p
Reading work/ramdisk.im4p...
Reading work/IM4M...
Creating Image4...
Image4 file outputted to: sshramdisk/ramdisk.img4
none
[] Booting ramdisk
usb_timeout: 5
[libusb] Waiting for the USB handle with VID: 0x5AC, PID: 0x1227
CPID: 0x7000
Found the USB handle.
Now you can boot untrusted images.
usb_timeout: 5
[libusb] Waiting for the USB handle with VID: 0x5AC, PID: 0x1227
Found the USB handle.
[==================================================] 100.0%
[==================================================] 100.0%
[==================================================] 100.0%
[==================================================] 100.0%
[==================================================] 100.0%
[==================================================] 100.0%
[==================================================] 100.0%
Error connecting to device: No error information
[
] Testing for baseband presence
[] Dumping apticket
[
] Creating fakefs, this may take a while (up to 10 minutes)
[] fakefs created, continuing...
[
] Patching the kernel
[] Downloading BuildManifest
Version: 9bfdde2b2456181045f74631683fba491d8bf4f2 - 38
libfragmentzip version: 0.64-aaf6fae83a0aa6f7aae1c94721857076d04a14e8-RELEASE
init pzb: https://updates.cdn-apple.com/2023FallFCS/fullrestores/042-76437/E826C2CC-D34C-405F-B582-3F877988C052/iPad_64bit_TouchID_15.8_19H370_Restore.ipsw
init done
getting: BuildManifest.plist
100% [===================================================================================================>]
download succeeded
[
] Downloading kernelcache
Version: 9bfdde2b2456181045f74631683fba491d8bf4f2 - 38
libfragmentzip version: 0.64-aaf6fae83a0aa6f7aae1c94721857076d04a14e8-RELEASE
init pzb: https://updates.cdn-apple.com/2023FallFCS/fullrestores/042-76437/E826C2CC-D34C-405F-B582-3F877988C052/iPad_64bit_TouchID_15.8_19H370_Restore.ipsw
init done
getting: kernelcache.release.ipad5
100% [===================================================================================================>]
download succeeded
[*] Patching kernelcache
Reading work/kernelcache...
[NOTE] Image4 payload data is LZSS compressed, decompressing...
RuntimeError: pylzss not installed, cannot use LZSS compression

@Volko61
Copy link
Author

Volko61 commented Nov 12, 2023

I had sudo systemctl stop usbmuxd && sudo usbmuxd -p -f running in an other tab

I tried to install pylzss by running but I get
volko@volko-gp72mvr7rfx:~/palera1n-mod$ pip install pylzss
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pylzss in /home/volko/.local/lib/python3.10/site-packages (0.3.1)

[notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: python3 -m pip install --upgrade pip
volko@volko-gp72mvr7rfx:~/palera1n-mod$

@Volko61
Copy link
Author

Volko61 commented Nov 12, 2023

i found
@im4p.command('create')
@click.option(
'-i',
'--input',
'input_',
type=click.File('rb'),
required=True,
help='Input file.',
)
@click.option(
'-o',
'--output',
type=click.File('wb'),
required=True,
help='Output file.',
)
@click.option('-f', '--fourcc', type=str, required=True, help='FourCC to set.')
@click.option(
'-d',
'--description',
type=str,
help='Description to set.',
)
@click.option(
'--extra',
type=click.File('rb'),
help='Extra IM4P payload data to set (requires --lzss).',
)
@click.option(
'--lzss', 'compression_type', flag_value='LZSS', help='LZSS compress the data.'
)
@click.option(
'--lzfse',
'compression_type',
flag_value='LZFSE',
help='LZFSE compress the data.',
)

In the doc of pyimg4

@Volko61
Copy link
Author

Volko61 commented Nov 12, 2023

The issue is with this line : python3 -m pyimg4 im4p extract -i work/kernelcache -o work/kcache.raw --extra work/kpp.bin
In fact the issue come from the pyimg4 library, who tries to import lzss but fail
try:
import lzss

have_lzss = True

except ImportError:
have_lzss = False

    if compression == Compression.LZSS:
        if not have_lzss:
            raise RuntimeError('pylzss not installed, cannot use LZSS compression')

        self._data = self._create_complzss_header() + lzss.compress(self._data)

        if self.extra is not None:
            self._data += self.extra

@Volko76
Copy link

Volko76 commented Nov 14, 2023

It's my second account.
Okay, I fount a solve !
The issue is that paler1n utilize a module named pyimg4, which himself use a module named pylzss.
The issue is that pylzss is install via pip, but pip install an old version of pylzss who don't work.
So, to solve the issue here is the following steps:

  • go to https://github.com/yyogo/pylzss and download the code as zip
  • uncompress it and enter in it
  • open a terminal and run "python3 setup.py install" to install lzss
  • relaunch the code (for me it's sudo ./paler1n --tweaks 15.8 --semi-tethered)

@Aladdin4u
Copy link

I have the same issue but stuck at recovery mode. Please how do get out of recovery mode

@Volko76
Copy link

Volko76 commented Jan 28, 2024

I have the same issue but stuck at recovery mode. Please how do get out of recovery mode

The same way as to enter it
Press the power button and the home button and hold it for 10 seconds, then continue holding the home button while releasing the power button
Your phone will restart to the normal welcome page
/!\ Always use itunes to reflash iOS before retrying the manipulation to jailbreak, as recommended in the readme of the repo /!\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants