From 94d7cf8858ca53a0636f69c11b2ce9b1050ebdfe Mon Sep 17 00:00:00 2001 From: doronz88 Date: Mon, 19 Aug 2024 11:27:09 +0300 Subject: [PATCH] build_identity: extract kernelcache im4p --- ipsw_parser/build_identity.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ipsw_parser/build_identity.py b/ipsw_parser/build_identity.py index 6865d12..bc63ba1 100644 --- a/ipsw_parser/build_identity.py +++ b/ipsw_parser/build_identity.py @@ -7,6 +7,7 @@ from cached_property import cached_property from plumbum import local +from pyimg4 import IM4P from ipsw_parser.component import Component @@ -161,7 +162,10 @@ def extract(self, output: Path) -> None: kernel_output = output / 'System/Library/Caches/com.apple.kernelcaches' / kernel_path.parts[-1] logger.info(f'extracting kernel into: {kernel_output}') - kernel_output.write_bytes(kernel_component.data) + # kernel_output.write_bytes(kernel_component.data) + im4p = IM4P(kernel_component.data) + im4p.payload.decompress() + kernel_output.write_bytes(im4p.payload.output().data) for cryptex in ('App', 'OS'): name = {