@Lakr233 wrote:
想看原文自己尝试的朋友可以走传送门
https://alephsecurity.com/2019/06/17/xnu-qemu-arm64-1/想方便的体验一下功能的往下看
首先你需要准备文件:
1 ipsw
2 https://github.com/alephsecurity/xnu-qemu-arm64
3 https://github.com/Co2333/iQemu-iPsw-iPreparer注意,目前QEMU只支持从不超过2G大小的只读磁盘镜像启动,只支持iPhone6s Plus机型。
请务必使用git clone下载仓库,然后更新子模块。QEMU的编译就不多说了。
mkdir build; cd build; ../configure; make
然后使用终端以root身份运行iemu_prep_out,请注意各类路径不要有空格,你的用户名不能有空格(鬼知道你们都会干点啥😂)如果ipsw包含多设备信息,那么准备期间可能会选择一些选项。由于要从GitHub下载脚本和iOSBinpack,请先export proxy。请注意开始操作之前强烈推荐卸载多余的磁盘避免名字重复出现空格操作失败
然后你就会得到下面这样的输出。其中iPhone6s Plus主板为n66ap
最后你会得到下面的文件列表
kernel.fout secure_monitor.fout file static_tc.fout boot_image.fout device_tree.fout
和启动指令
qemu-system-aarch64 -M iPhone6splus-n66-s8000,kernel-filename=kernel.fout,dtb-filename=device_tree.fout,secmon-filename=secure_monitor.fout,ramdisk-filename=boot_image.fout,tc-filename=static_tc.fout,kern-cmd-args="debug=0x8 kextlog=0xfff cpus=1 rd=md0 serial=2" -cpu max -m 6G -serial mon:stdio
要想启动QEMU,需要执行至少如下的编译。
cd xnu-qemu-arm64 ./configure --target-list=aarch64-softmmu --disable-capstone make -j16
最后,你会在目录下面找到我们要的QEMU
./xnu-qemu-arm64/aarch64-softmmu/qemu-system-aarch64
我们 cd 到输出目录,也就是你一开始指定的输出目录,检查文件列表是否完整,可靠。(不要出现0b的文件应该就没问题)(请一定在输出目录启动QEMU,把QEMU拖进终端)(然后剩下的参数直接复制)
Enjoy!
Darwin localhost 18.2.0 Darwin Kernel Version 18.2.0: Tue Oct 16 21:02:23 PDT 2018; root:xnu-4903.222.5~1/RELEASE_ARM64_S8000 iPhone8,2
话说XNU QEMU的contributor都800人了还只有36颗小星星哇真的可怜。。。
Posts: 5
Participants: 4