From 93a771d89ba52c313974ff6da4764f3aa2cd29bf Mon Sep 17 00:00:00 2001 From: Tom E Date: Sun, 18 Sep 2022 09:02:03 -0400 Subject: [PATCH] Process kernelcache in 1mb blocks to prevent freezing on Linux (#6) * Update kerneldiff.py * Update kerneldiff.py * Update kerneldiff.py * Update kerneldiff.py * hopefully this works * Update palera1n.sh --- kerneldiff.py | 13 ++++++++++--- palera1n.sh | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/kerneldiff.py b/kerneldiff.py index 650204f..467f1f7 100644 --- a/kerneldiff.py +++ b/kerneldiff.py @@ -21,16 +21,23 @@ if __name__ == "__main__": p = open(patched, "rb").read() o = open(original, "rb").read() + a = 0 diff = [] + diffFile = open(args[3], 'w+') + diffFile.write('#AMFI\n\n') for i in range(sizeO): originalByte = o[i] patchedByte = p[i] if originalByte != patchedByte: + if a == 1e6: + for d in diff: + data = str(d[0]) + " " + (str(d[1])) + " " + (str(d[2])) + diffFile.write(data + '\n') + diff = [] + a = 0 diff.append([hex(i), hex(originalByte), hex(patchedByte)]) + a += 1 - diffFile = open(args[3], 'w+') - diffFile.write('#AMFI\n\n') for d in diff: data = str(d[0]) + " " + (str(d[1])) + " " + (str(d[2])) diffFile.write(data + '\n') - print(data) diff --git a/palera1n.sh b/palera1n.sh index 6b2b6fc..7dc885e 100755 --- a/palera1n.sh +++ b/palera1n.sh @@ -222,7 +222,7 @@ if [ ! -e boot ]; then if [ "$os" = 'Darwin' ]; then $dir/img4 -i work/"$(/usr/bin/plutil -extract "BuildIdentities".0."Manifest"."StaticTrustCache"."Info"."Path" xml1 -o - work/BuildManifest.plist | grep '' | cut -d\> -f2 | cut -d\< -f1 | head -1 | sed 's/Firmware\///')" -o boot/trustcache.img4 -M work/IM4M -T rtsc > /dev/null else - $dir/img4 -i work/"$(Linux/PlistBuddy work/BuildManifest.plist -c "Print BuildIdentities:0:Manifest:StaticTrustCache:Info:Path" | sed 's/"//g'| sed 's/Firmware\///')" -o boot/trustcache.img4 -M work/IM4M -T rtsc > /dev/null + $dir/img4 -i work/"$($dir/PlistBuddy work/BuildManifest.plist -c "Print BuildIdentities:0:Manifest:StaticTrustCache:Info:Path" | sed 's/"//g'| sed 's/Firmware\///')" -o boot/trustcache.img4 -M work/IM4M -T rtsc > /dev/null fi #if [[ "$@" == *"install"* ]]; then