dualbootfun / dualbootfun.github.io

41 stars 10 forks source link

apfs_invert failed #9

Open miniexploit opened 3 years ago

miniexploit commented 3 years ago

Hi, thanks for the restored_hax.c. But seems like it's not working. I managed to run apfs_invert:

/System/Library/Filesystems/apfs.fs/apfs_invert -d /dev/disk0s1 -s 3 -n out.dmg

However, there's still an error:

*** Mounting outer volume (/dev/disk0s1 s3)...
nx_dev_init:684: device initialization failed: 2
nx_kernel_mount:991: device initialization failed: 2
mount_outer_volume:800: nx_mount returned 2
MachXNU commented 2 years ago

Have you been able to solve your issue ? because I have it too. I tried reproducing this step on a Mac, and it looks like this issue is due to the lack of root privileges (I mean : this error message happens when you run apfs_invert without sudo. With sudo, it works fine) However, it's very strange because, if you put getuid() in restored_hax, you'll see that it returns 0, so this is run as root... Adding entitlements didn't help neither...

dualra1n commented 2 years ago

you can use sshrd to create a ssh ramdisk so after you put that command /System/Library/Filesystems/apfs.fs/apfs_invert -d /dev/disk0s1 -s 3 -n out.dmg and change number 3 with second os