I am trying to recreate a patch for an ARM binary. As it shows in attached picture, I have provided the before and after sections of file. In patched file, a new subroutine is added in a cave, and then it branches to an existing subroutine that has changed to an instruction.

My question is, how do you recreate such a patch? I know how to edit bytes in IDA, but not sure how to add new ones.

enter image description here

2 Answers 2


I realized this is done first by determining a code cave. Afterwards, just patch the binary using an application like Hex Fiend. The rest will show in IDA


You can perform the task you're looking for using either one of the following approaches:

  • Use the built-in IDA feature to assemble instructions and patch the binary available by accessing Edit > Patch Program > Assembly after highlighting the instruction you want to replace
  • Use Keypatch as it adds support for more architectures than what IDA provides by default

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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