83 Commits

Author SHA1 Message Date
Arnaud Diederen af978e79e6 IDAPython for IDA 9.1 2025-03-13 16:17:53 +01:00
Arnaud Diederen ae62cd4df5 IDAPython for IDA 8.4 2024-02-21 14:22:30 +01:00
Arnaud Diederen e1c108a7df Minor updates (pydoc injections) 2023-07-31 16:26:58 +02:00
Elias Bachaalany 8f566fe8dd customer_viewer.py: replaced hardcoded VK_... numerical values with IDA's IK_... compatibility constants 2023-06-26 12:08:35 -07:00
Arnaud Diederen e6841a95a3 IDAPython for IDA 8.3 2023-06-12 10:39:14 +02:00
Arnaud Diederen dcca75f50e Backport fixes; add bookmarks sample 2023-05-23 12:21:29 +02:00
Harding 11cff555b8 Fix: replaced a magic constant with a constant 2023-05-19 22:50:43 +02:00
Elias Bachaalany e2f5d10a5b Merge branch 'master' into fix/idp-hook-example 2023-05-05 21:47:01 -07:00
Elias Bachaalany ab9597c49b fixed typo in custom_graph_with_actions.py
minor typo
2023-03-31 09:47:48 -07:00
Arnaud Diederen e06d4d0986 Added missing support for ida_kernwin.Chooser.OnGetEA 2023-01-30 10:50:06 +01:00
Arnaud Diederen a2a75975f2 Backported fixes - mostly issues discovered with Python 3.11+ 2023-01-16 11:14:55 +01:00
Arnaud Diederen 201a874e81 BUGFIX: IDAPython: upon failure, ida_hexrays.decompile() now always returns None (instead of either throw a ida_hexrays.DecompilationFailure or return None.)
The type `ida_hexrays.DecompilationFailure` is still present (but is a dummy) because otherwise scripts might break. It is never thrown anymore.

Note that `vds_xrefs.py` still need the `str(cfunc))` kludge, because of a caveat in when/how the decompiler actually updates the global xrefs cache. This will be fixed in the next IDA minor release

In addition, this commit introduces the notion of a typemap to convert form an `ea_t` to a `func_t *` for the `decompile()` call, but doesn't generalize its use.
Since this is a relatively far-ranging change, this will only be introduced in the next IDA minor release as well.
2023-01-16 10:50:06 +01:00
Elias Bachaalany 901762a8fb Merge pull request #35 from 0xeb/vds_xrefs
fixed decompile() calls.

See PR #32
2023-01-07 13:51:50 -08:00
Elias Bachaalany aed1402239 fixed decompile() calls.
try/except around decompile() are not applicable.

Re-did PR#32
2023-01-07 13:40:16 -08:00
Elias Bachaalany 58d8506d60 Show the chooser when the script is launched
It is a bit confusing for beginners when they run the script and nothing happens. Now, when the script is launched, it shows the chooser
2023-01-07 13:23:30 -08:00
Arnaud Diederen 425d9e585e IDAPython for IDA 8.2 2022-12-19 10:10:14 +01:00
Arnaud Diederen 023c5ba53c IDAPython for IDA 8.0 2022-08-22 10:14:21 +02:00
Arnaud Diederen 3ce5b7f06d IDAPython for IDA 7.7 2022-01-17 11:28:09 +01:00
Arnaud Diederen 3a256f3896 Backported fixes 2021-05-17 08:57:47 +02:00
Arnaud Diederen e8e2a7bb8c IDAPython for IDA 7.6 SP1 2021-05-04 09:37:45 +02:00
Arnaud Diederen c22e071853 IDAPython for IDA 7.6 2021-03-30 08:54:44 +02:00
Arnaud Diederen 7eea22820f Backported fixes 2021-03-02 13:14:55 +01:00
Arnaud Diederen 604de9cfad IDAPython for IDA 7.5 2020-05-27 14:34:02 +02:00
Arnaud Diederen 9528950917 Backported fixes 2020-04-14 13:50:52 +02:00
Arnaud Diederen 21983ec8d2 Backported fixes 2020-04-07 08:41:19 +02:00
Remi Jullian 7eedd1299a Fix assemble idp hook example 2020-03-21 01:15:05 +01:00
Arnaud Diederen 680b6ac381 Backported fixes 2019-12-16 09:19:02 +01:00
Arnaud Diederen 752ba3896e IDAPython for IDA 7.4 SP1 2019-11-14 15:58:44 +01:00
Arnaud Diederen 5958995d66 IDAPython for IDA 7.4 2019-10-15 15:05:24 +02:00
Arnaud Diederen 7a567eecf0 IDAPython for IDA 7.3 2019-06-26 14:37:39 +02:00
cclauss d7bacfa611 Modernize Python 2 code to get ready for Python 3 2018-12-01 23:58:26 +01:00
Arnaud Diederen 701bb1b44e IDAPython for IDA 7.2 2018-11-06 08:14:17 +01:00
Arnaud Diederen 29ec1ceba2 IDAPython for IDA 7.1 2018-02-28 07:45:21 +01:00
Arnaud Diederen d99a893697 IDAPython for IDA 7.0: Initial commit, plus bugfixes up to 2017 Oct, 13th. 2017-10-13 15:08:08 +02:00
Elias Bachaalany b6f9477e02 fixed example 2017-06-19 08:36:46 -07:00
Arnaud Diederen 31c7776117 Applied all fixes to IDAPython 6.95, to this date (2017 Jan 17th.) 2017-01-17 12:15:35 +01:00
Arnaud Diederen e22e859a41 Applied all fixes to IDAPython 6.95, to this date (2016 Sept 26th.) 2016-09-26 11:16:26 +02:00
Arnaud Diederen 62ddab8db6 IDAPython for IDA 6.95: Initial commit 2016-08-09 10:01:18 +02:00
Arnaud Diederen c04b70e0e5 Brought in all fixes since Jan 8th, 2016.
Specifically:
 BUGFIX: IDAPython's choose.choose() was broken.
 BUGFIX: calling idaapi.del_hotkey() twice with the same argument could crash IDA.
 BUGFIX: IDAPython's IDC emulation of idc.GetTevRegMem() was not working.
 BUGFIX: IDAPython: execute_ui_requests() could crash IDA.
 BUGFIX: IDAPython: IDP_Hooks instances could prevent the decompiler from working properly
2016-03-09 10:33:06 +01:00
Arnaud Diederen f9f3ccb63b IDA Pro 6.8 support
What's new: https://www.hex-rays.com/products/ida/6.8/index.shtml
2015-04-20 14:26:30 +02:00
elias.bachaalany@gmail.com bbf628d3a3 IDA Pro 6.7 support 2015-02-08 02:59:53 +00:00
elias.bachaalany@gmail.com fbb5bfabd6 IDA Pro 6.6 support
What's new:
- added the decompiler bindings
- Expose simpleline_t type to IDAPython. That lets the user to set the bgcolor & text for each line in the decompilation.
- Wrapped new functions from the IDA SDK

Various fixes:
for non-code locations, idc.GetOpnd() would create instructions instead of returning empty result
- idb_event::area_cmt_changed was never received in IDB_Hooks (and descendants)
- idb_event::ti_changed, and idb_event::op_ti_changed notifications were not accessible in IDAPython
- op_t.value was truncated to 32 bits under IDA64.
- print_tinfo() wouldn't return a valid string.
- readsel2() was not usable.
- read_selection() was buggy for 64-bit programs.
- StructMembers() considered holes in structures, and didn't properly iterate through the whole structure definition.
- There was no way to call calc_switch_cases() from IDAPython.
- when using multi-select/multi-edit choosers, erroneous event codes could be sent at beginning & end of batch deletion of lines.
- When, in a PluginForm#OnCreate, the layout of IDA was requested to change (for example by starting a debugging session), that PluginForm could be deleted and create an access violation.
- tinfo_t objects created from IDAPython could cause an assertion failure at exit time.
- Usage of IDAPython's DropdownListControl was broken.
2014-07-04 22:02:42 +00:00
elias.bachaalany@gmail.com 78c79f85b9 IDA Pro 6.5 support
What's new:
- Proper multi-threaded support 
- Better PyObject reference counting with ref_t and newref_t helper classes
- Improved the pywraps/deployment script
- Added IDAViewWrapper class and example
- Added idc.GetDisasmEx()
- Added idc.AddSegEx()
- Added idc.GetLocalTinfo()
- Added idc.ApplyType()
- Updated type information implementation
- Introduced the idaapi.require() - see http://www.hexblog.com/?p=749
- set REMOVE_CWD_SYS_PATH=1 by default in python.cfg (remove current directory from the import search path).

Various bugfixes:
- fixed various memory leaks
- asklong/askaddr/asksel (and corresponding idc.py functions) were returning results truncated to 32 bits in IDA64
- fix wrong documentation for idc.SizeOf
- GetFloat/GetDouble functions did not take into account endianness of the processor
- idaapi.NO_PROCESS was not defined, and was causing GetProcessPid() to fail
- idc.py: insert escape characters to string parameter when call Eval()
- idc.SaveFile/savefile were always overwriting an existing file instead of writing only the new data
- PluginForm.Close() wasn't passing its arguments to the delegate function, resulting in an error.
2013-12-30 01:34:23 +00:00
elias.bachaalany@gmail.com c88a77e809 Contributed by EiNSTeiN_:
- added support for 'long' addresses 
- updated copyright notice in hexrays.i
- added methods to remove or insert elements in the qlist<cinsn_t> list
- added support for ctree_visitor_t / ctree_parentee_t / cfunc_parentee_t / user_lvar_visitor_t
- updated vds3 sample
- added vds4 and vds7 python samples (ported from their C++ counter parts)
2013-07-16 23:09:33 +00:00
elias.bachaalany@gmail.com 7eb6d04c6e Contributed by EiNSTeiN_:
- Fixed compilation error on Linux
- Minor bugfix in hexrays.i
- Added two more samples: vds3.py and vds_xrefs.py
2013-07-05 23:12:04 +00:00
elias.bachaalany@gmail.com db58b31711 - Experimental: integrated Hex-Rays Decompiler bindings that were contributed by EiNSTeiN:
https://github.com/EiNSTeiN-/hexrays-python
- Added '--with-hexrays' switch to the build script so it wrap Hex-Rays Decompiler API
- Added one Hex-Rays decompiler sample: vds1.py
2013-07-03 01:40:54 +00:00
elias.bachaalany 69d5c83d28 - IDA Pro 6.3 support
- The Functions() generator function now accepts function tail start parameter
- Added into idc.py: DbgRead/DbgWrite/SetTargetAssembler and stack pointer related functions
- Wrapped more type info related functions
2012-06-24 20:49:11 +00:00
skochinsky@gmail.com 1258fab948 IDAPython 1.5.3
- IDA Pro 6.2 support
- added set_idc_func_ex(): it is now possible to add new IDC functions using Python
- added visit_patched_bytes() (see ex_patch.py)
- added support for the multiline text input control in the Form class
- added support for the editable/readonly dropdown list control in the Form class
- added execute_sync() to register a function call into the UI message queue
- added execute_ui_requests() / check ex_uirequests.py
- added add_hotkey() / del_hotkey() to bind Python methods to hotkeys
- added register_timer()/unregister_timer(). Check ex_timer.py
- added the IDC (Arrays) netnode manipulation layer into idc.py
- added idautils.Structs() and StructMembers() generator functions
- removed the "Run Python Statement" menu item. IDA now has a unified dialog. 
  Use RunPlugin("python", 0) to invoke it manually.
- better error messages for script plugins, loaders and processor modules
- bugfix: Dbg_Hooks.dbg_run_to() was receiving wrong input
- bugfix: A few Enum related functions were not properly working in idc.py
- bugfix: GetIdaDirectory() and GetProcessName() were broken in idc.py
- bugfix: idaapi.get_item_head() / idc.ItemHead() were not working
2011-10-14 14:24:38 +00:00
elias.bachaalany f5ec434bf7 IDAPython 1.5.2
- added ui_term/ui_save/ui_saved/ui_get_ea_hint UI notifications
- added ph_get_operand_info() to retrieve operand information while debugging
- added PteDump.py script
- some code refactoring
- bugfix: idaapi.netnode.getblob() was limited to MAXSPECSIZE
- bugfix: idc.GetString()/idaapi.get_ascii_contents()/idautils.Strings() were limited to MAXSTR string length
- bugfix: idaapi.del_menu_item() was failing to delete some menu items
- bugfix: dbg_bpt was called instead of dbg_trace for a DBG_Hooks class implementation (old bug from 0.9.x)
- bugfix: Form.GetControlValue() was not working with numeric controls
- bugfix: SetBptCnd() was broken
- bugfix: idaapi.get_func_cmt() was memory leaking
2011-06-10 15:21:21 +00:00
elias.bachaalany 7e63ea0747 - bugfix: idaapi.del_menu_item() was failing to delete some menu items 2011-05-19 15:06:49 +00:00