Skip to content

Commit

Permalink
Update haxx_overwrite
Browse files Browse the repository at this point in the history
what i did here is a wack and ugly way of adding support, but it works so... yeah
  • Loading branch information
LukeZGD committed Jul 15, 2023
1 parent b0f3852 commit a4c17b5
Show file tree
Hide file tree
Showing 7 changed files with 3,109 additions and 226 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,27 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
files: idevicererestore_linux.zip

idevicererestore-win:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3

- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true

- name: Run compile script
run: |
cd ./src/idevicererestore
./compile.sh patch
mv idevicerestore/bin ../..
cd ../..
- uses: actions/upload-artifact@v3
with:
name: idevicererestore_win
path: bin/
# idevicererestore-win:
# runs-on: windows-latest
# defaults:
# run:
# shell: msys2 {0}
# steps:
# - uses: actions/checkout@v3
#
# - uses: msys2/setup-msys2@v2
# with:
# msystem: MINGW64
# update: true
#
# - name: Run compile script
# run: |
# cd ./src/idevicererestore
# ./compile.sh patch
# mv idevicerestore/bin ../..
# cd ../..
#
# - uses: actions/upload-artifact@v3
# with:
# name: idevicererestore_win
# path: bin/
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# daibutsuCFW

- daibutsuCFW fork used for [Legacy iOS Kit](https://github.com/LukeZGD/Legacy-iOS-Kit)
- idevicererestore and xpwn builds for Linux and Windows can be [downloaded here](https://github.com/LukeZGD/daibutsuCFW/releases/tag/latest)
- For idevicererestore, the patch version is used for Legacy iOS Kit - It uses `tmp/tmp.bbfw` and `tmp/BuildManifest.plist` for the baseband to be used
- haxx_overwrite supports all A5/A6 devices iOS 8.0-8.4.1
- Offsets are obtained using updated dsc patchfinder in [daibutsu](https://github.com/kok3shidoll/daibutsu)

### List of devices supported by haxx_overwrite (dyld haxx)
- iPhone 4S [iPhone4,1]
- iPhone 5 [iPhone5,1]
- iPhone 5 [iPhone5,2]
- iPhone 5C [iPhone5,3]
- iPhone 5C [iPhone5,4]
- iPod touch 5th gen [iPod5,1]
- iPad 2 [iPad2,1]
- iPad 2 [iPad2,2]
- iPad 2 [iPad2,3]
- iPad 2 [iPad2,4]
- iPad mini [iPad2,5]
- iPad mini [iPad2,6]
- iPad mini [iPad2,7]
- iPad 3rd gen [iPad3,1]
- Pad 3rd gen [iPad3,2]
- iPad 3rd gen [iPad3,3]
- iPad 4th gen [iPad3,4]
- iPad 4th gen [iPad3,5]
- iPad 4th gen [iPad3,6]

29 changes: 0 additions & 29 deletions readme.md

This file was deleted.

64 changes: 64 additions & 0 deletions src/daibutsu/dyld/dyld_offsets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash
#set -x
# needs dmg, hfsplus, haxx
devices=(iPhone4,1 iPhone5,1 iPhone5,2 iPhone5,3 iPhone5,4 iPad2,1 iPad2,2 iPad2,3 iPad2,4 iPad2,5 iPad2,6 iPad2,7 iPad3,1 iPad3,2 iPad3,3 iPad3,4 iPad3,5 iPad3,6 iPod5,1)
rv=0
#rm if.c of.c
for device in "${devices[@]}"; do
echo "$device"
json=$(curl "https://firmware-keys.ipsw.me/device/$device")
len=$(echo "$json" | jq length)
builds=()
i=0
while (( i < len )); do
builds+=($(echo "$json" | jq -r ".[$i].buildid"))
((i++))
done
for build in "${builds[@]}"; do
isIOS9=
case $build in
"12"* ) :;;
"13A"* | "13B"* ) isIOS9=1;;
* ) continue;;
esac
echo "$build"
ipsw="$(curl https://api.ipsw.me/v2.1/$device/$build/filename)"
ipsw="${ipsw%?????}"
if [[ ! -e $ipsw.ipsw ]]; then
url="$(curl https://api.ipsw.me/v2.1/$device/$build/url)"
curl -LO "$url"
fi
try=("https://github.com/LukeZGD/Legacy-iOS-Kit-Keys/raw/master/$device/$build/index.html"
"https://api.m1sta.xyz/wikiproxy/$device/$build"
"http://127.0.0.1:8888/firmware/$device/$build")
device_fw_key=
for i in "${try[@]}"; do
device_fw_key="$(curl -L $i)"
if [[ -n $device_fw_key ]]; then
break
fi
done
RootName=$(echo "$device_fw_key" | jq -j '.keys[] | select(.image == "RootFS") | .filename')
RootKey=$(echo "$device_fw_key" | jq -j '.keys[] | select(.image == "RootFS") | .key')
unzip -o -j "$ipsw.ipsw" $RootName -d .
./dmg extract $RootName out.dmg -k $RootKey
isA6=
dyld="dyld_shared_cache_armv7"
case $device in
iPad3,[456] | iPhone5,[1234] ) isA6=1; dyld+="s";;
esac
./hfsplus out.dmg extract System/Library/Caches/com.apple.dyld/$dyld
./haxx $dyld dyld_haxx | tee out
off=$(cat out)
((rv++))
echo "if(rv == $rv){" | tee -a of.c
echo " // ${device}_$build" | tee -a of.c
echo "$off" | tee -a of.c
echo -e " return;\n}" | tee -a of.c
echo "} else if(!strcmp(argv[1], \"--${device}_$build\")) {" | tee -a if.c
echo " rv=$rv;" | tee -a if.c
[[ -n $isA6 ]] && echo " isA6=$isA6;" | tee -a if.c
[[ -n $isIOS9 ]] && echo " isIOS9=$isIOS9;" | tee -a if.c
rm $ipsw.ipsw $RootName out.dmg $dyld dyld_haxx
done
done
13 changes: 13 additions & 0 deletions src/daibutsu/dyld/export_stuff.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
4c4
< #include "util.h"
---
> #include <stdint.h>
61c61
< printf("mvsdataaddressoffset: %llx\n", res);
---
> //printf("mvsdataaddressoffset: %llx\n", res);
79c79
< }
\ No newline at end of file
---
> }
Loading

0 comments on commit a4c17b5

Please sign in to comment.