Back in 2017, the whole Apple’s iBoot source code have been leaked to the public and many people hurried up to download it.
But.
Obviously it sounded too good to be true: the leak were not complete and the source code dated from the iOS 9 era.
That’s why some techniques (specified in this post) have been adapted to make the compilation succeeding!
0x1: Informations
We have the source code yes, but we’re kind of limited in our possible actions because:
- the available targets are only N41AP-N42AP-N48AP-N49AP(we can still add more platforms however),
- depends of Apple Internals Tools which cannot be found on the internet like we would find a repo on GitHub.
However, the images (iBEC.bin, iBSS.bin, iBoot.bin, LLB.bin) obtained once we’re done are compiled, decrypted and can be found with the BUILD_TAG DEBUG, DEVELOPEMENT (and RELEASE) depending on what you’ve chose, and this is pretty sweet!
Also, if you wish to add more available platforms, please take a look to Nyan Satan’s post about this!
0x2. Prepare and compile
Contrary to what Nyan Satan had been said, I have been compiled the iBoot on macOS 10.14 so your OS version does not matter as long you have the requiered binaries.
- If you get an sdk error, change $(SDKVERSION)by10.0(l.33) ofconfig.mk,
- By default, the tools/directory has no privileges, give it some:chmod +x tools/*.
- The gkalsr_debugis useless, comment out to fix the error inlib/mach/macho.c(l.29),
- The -lcompiler_rt-staticvariable is useless, you have to remove it inbuild.mk(l.25),
- The sdk set by default is wrong, set iphoneosin the main Makefile instead ofiPhoneOS(l.53),
- You can also modify the BUILD_TAGin the main Makefile (l.158), up to you to choose the text.
- Even if you have already installed WhiteTails, you need to change the path of device_map.dbby removing$(SDKVERSION)indevice_map.mk(l.36),
- if you don’t have img4payloadnorimage3maker, replaceimg4payloadbyimg4by xerub intools.mk(l.49) (img3makeris on GitHub).
We should be okay, so the last step is nwo to compile everything by doing:
1
make APPLICATIONS="iBoot" TARGETS="nXX" BUILDS="DEVELOPMENT DEBUG" PRODUCTS="iBSS iBEC LLB iBoot"
Replace nXX by the platform of your choice like: `TARGETS=”n42”
0x3. Conclusion
Voilà! That should do the job!
Well, now a lot of opportunities are possible, the most common are:
- Debug, fun, researches, […],
- Load image in RAM(see (multi-)kloader),
- Boot in diags mode (diag-nXX.img3+iBEC.bin),
- Use AppleInternalstuff with (cables and software),
- etcetera etcetera…
It is up to you to decides which usage you will do!
Anyways that is all I wanted to say, I hope this was helpuful!
You can follow me on my twitter if you liked this post and you can also support me by looking at my others projects on GitHub!
Thank you for your time. ヾ(・ω・*)
