facebook / fishhook

A library that enables dynamically rebinding symbols in Mach-O binaries running on iOS.
BSD 3-Clause "New" or "Revised" License
5.17k stars 965 forks source link

Fixed the crash on iOS 15 perfectly: changing vm prot according to wh… #87

Closed haolianfu closed 2 years ago

haolianfu commented 3 years ago

…ether having VM_PROT_WRITE rather than being const seg.

d6638219 commented 3 years ago

I tried, but still crash

haolianfu commented 3 years ago

I tried, but still crash

I push a new commit just now, please try again.

haolianfu commented 3 years ago

The XNU based systems seem having some issues internally, the __DATA_CONST segment should have read only attribute, but some iOS/MacOSX system libraries might write it too. The vm_region/vm_region_64 API reports this segment having only VM_PROT_READ protection attribute, but it is able to be written on some machine and not on some others.

d6638219 commented 3 years ago

I tried, but still crash

I push a new commit just now, please try again.

This is OK. Will this affect the hook function? Includes all iOS versions.

haolianfu commented 3 years ago

I tried, but still crash

I push a new commit just now, please try again.

This is OK. Will this affect the hook function? Includes all iOS versions.

All the hook functionalities will work fine just like before across all iOS versions.

Just as I mentioned in a previous message, some iOS systems have internal Bugs when dealing with vm prot/vm max prot, but the second commit is OK for all these iOS versions.

terryso commented 3 years ago

It works for me in macOS 12 beta

Huang-Libo commented 2 years ago

It works for me in iOS 14.7.1 (iPhone 12)