keystone-engine / keypatch

Multi-architecture assembler for IDA Pro. Powered by Keystone Engine.
http://www.keystone-engine.org/keypatch
GNU General Public License v2.0
1.47k stars 355 forks source link

What's the proper way to export the patched idb by keypatch into a binary? #68

Open hotwinter opened 4 years ago

hotwinter commented 4 years ago

The situation I'm running into is follows:

  1. I patch an instruction with keypatch, using IDA's Edit->Patch Program->Apply Patches to Input File
  2. I undo that patch

In this case if I go to Apply Patches to Input File again, IDA would think there's no bytes to be patched (because the database is the same as the initial database) as it shows Applied 0/0 patch(es), but in the real world, the binary has already been patched since step 1, and this is not undone. Thus I'm curious what's the correct way to export the patched idb with undos from keypatch?