1

I want to manipulate iOS binary file and change two strings in it. I used hex editor to search and change these strings. But after the binary file is uploaded and replaced with the origin app's binary file, it closes immediately when I launch the app, even though I fixed mode and permission of binary, the problem still exists. any suggestions will be appreciated

1
  • This is likely because you invalidated the signature of the binary.
    – NirIzr
    Nov 9, 2021 at 16:14

1 Answer 1

3

All apps and binaries that are executed on Apple platforms need to be signed by key/certificate issued by Apple. By modifying a single byte in the app binaries, you have invalidated this signature and thus iOS will refuse to execute this binary.

Look into the system log of the device, there you will find the error message about the invalid signature of the binary.

Even on jailbroken devices, this signature is still checked. However, depending on the jailbreak, usually a shortcut to accept "fake signed binaries" is added by the jailbreak. Therefore, binaries signed by ldid or ldid2 are accepted by the OS as valid signature. You can try to resign your binary with one of those tools and re-try.

Additionally, I recommend not to overwrite the binary as this often causes cache problems. The recommended way if to delete the binary and then copy the new binary to the same place. This seems to avoid some problems.

1
  • 1
    NB: overwriting is known to cause problems with signing because the kernel caches some state based on the file’s inode which does not change if you overwrite the file in place, thus the recommendation to delete and make a new copy.
    – Igor Skochinsky
    Nov 3, 2021 at 22:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.