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.49k stars 355 forks source link

Fix missing argument in idaapi.add_menu_item #9

Closed pedrib closed 8 years ago

pedrib commented 8 years ago

The missing argument causes keypatch loading to fail in the following condition: 1- start IDA and load any binary, keypatch starts fine 2- close the binary and open a new one. keypatch fails with: Failed while executing plugin_t.init(): Traceback (most recent call last): File "/plugins/keypatch.py", line 1169, in init idaapi.add_menu_item("Edit/Patch program/", "Keypatch:: Patcher (Ctrl+Alt+K)", 0, self.patcher, None) File "/python/ida_kernwin.py", line 332, in add_menu_item return _ida_kernwin.add_menu_item(*args) TypeError: add_menu_item expected 6 arguments, got 5

This affects at least 6.9 and 6.95.

aquynh commented 8 years ago

merged, thanks!

actually this code path is just for older IDA with older IDAPython version. v6.9 & newer should execute the other path. are you really affected by this issue??

pedrib commented 8 years ago

On 21/08/16 10:29, Nguyen Anh Quynh wrote:

merged, thanks!

actually this code path is just for older IDA with older IDAPython version. v6.9 & newer should execute the other path. ar you really affected by this issue??

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/keystone-engine/keypatch/pull/9#issuecomment-241247572, or mute the thread https://github.com/notifications/unsubscribe-auth/AFEMqN2_n1t5JUDQCzE4e1yOlD3JrqrQks5qiBpmgaJpZM4JpQZN.

Yes, both 6.9 and 6.95 are affected by it.

aquynh commented 8 years ago

i am on v6.8 & 6.9, but do not execute that path. as a result, i have menu Edit | Keypatch, with all the tools under that menu.

but looks like for your machine, all the tools go to Edit | Patch program menu? this is strange, because you should have a newer IDAPython (coming with your new IDAPro), thus this should not happen. hmm, how to explain this?

aquynh commented 8 years ago

i just pushed a commit, so we do not duplicate menu items in Edit\Patch program when we open the second binary, as in your scenario.