From e22e859a41fec29ec1dc818d8fe7eac35ef23fca Mon Sep 17 00:00:00 2001 From: Arnaud Diederen Date: Mon, 26 Sep 2016 11:16:26 +0200 Subject: [PATCH] Applied all fixes to IDAPython 6.95, to this date (2016 Sept 26th.) --- Scripts/3rd/BboeVt.py | 0 Scripts/AsmViewer.py | 0 Scripts/CallStackWalk.py | 0 Scripts/DbgCmd.py | 0 Scripts/DrvsDispatch.py | 0 Scripts/ExchainDump.py | 0 Scripts/FindInstructions.py | 0 Scripts/ImpRef.py | 0 Scripts/ImportExportViewer.py | 0 Scripts/SEHGraph.py | 0 Scripts/VaDump.py | 0 Scripts/VirusTotal.py | 0 Scripts/callstack_test.py | 0 Scripts/msdnapihelp.py | 0 api_contents.txt | 3 + build.py | 0 examples/chooser.py | 0 examples/colours.py | 0 examples/debughook.py | 0 examples/ex1_idaapi.py | 0 examples/ex1_idautils.py | 0 examples/ex_actions.py | 0 examples/ex_askusingform.py | 0 examples/ex_choose2.py | 0 examples/ex_cli.py | 0 examples/ex_custdata.py | 0 examples/ex_custview.py | 0 examples/ex_dbg.py | 0 examples/ex_debug_names.py | 0 examples/ex_func_chooser.py | 0 examples/ex_gdl_qflow_chart.py | 0 examples/ex_graph.py | 0 examples/ex_imports.py | 0 examples/ex_prefix_plugin.py | 0 examples/ex_pyqt.py | 0 examples/ex_strings.py | 0 examples/ex_uihook.py | 0 examples/hotkey.py | 0 examples/idapythonrc.py | 0 examples/structure.py | 0 out_of_tree/parsed_notifications.zip | Bin 574022 -> 574022 bytes pydoc_injections.txt | 2 +- python/idautils.py | 2 + python/idc.py | 38 +------ python/init.py | 0 pywraps/py_bytes.py | 8 ++ pywraps/py_bytes_custdata.py | 0 pywraps/py_diskio.py | 0 pywraps/py_funcs.hpp | 2 + pywraps/py_gdl.py | 0 pywraps/py_graph.py | 0 pywraps/py_idaapi.py | 19 ++-- pywraps/py_kernwin.py | 0 pywraps/py_kernwin_askusingform.py | 86 +++++++++++----- pywraps/py_kernwin_choose2.py | 0 pywraps/py_kernwin_cli.py | 0 pywraps/py_kernwin_custview.hpp | 7 +- pywraps/py_kernwin_custview.py | 0 pywraps/py_kernwin_plgform.py | 0 pywraps/py_lines.py | 0 pywraps/py_nalt.py | 0 pywraps/sidc.py | 0 swig/dbg.i | 12 ++- swig/enum.i | 2 +- swig/expr.i | 4 + swig/fixup.i | 5 +- swig/idp.i | 4 + swig/lines.i | 4 + swig/struct.i | 4 + swig/typeconv.i | 10 -- tools/chkapi.py | 32 ++++++ tools/deploy/header.i.in | 25 +++++ tools/docs/hrdoc.cfg | 147 +++++++++++++++++++++++++++ tools/docs/hrdoc.py | 0 tools/genhooks/genhooks.py | 2 - tools/swigdocs.py | 0 76 files changed, 330 insertions(+), 88 deletions(-) mode change 100755 => 100644 Scripts/3rd/BboeVt.py mode change 100755 => 100644 Scripts/AsmViewer.py mode change 100755 => 100644 Scripts/CallStackWalk.py mode change 100755 => 100644 Scripts/DbgCmd.py mode change 100755 => 100644 Scripts/DrvsDispatch.py mode change 100755 => 100644 Scripts/ExchainDump.py mode change 100755 => 100644 Scripts/FindInstructions.py mode change 100755 => 100644 Scripts/ImpRef.py mode change 100755 => 100644 Scripts/ImportExportViewer.py mode change 100755 => 100644 Scripts/SEHGraph.py mode change 100755 => 100644 Scripts/VaDump.py mode change 100755 => 100644 Scripts/VirusTotal.py mode change 100755 => 100644 Scripts/callstack_test.py mode change 100755 => 100644 Scripts/msdnapihelp.py mode change 100755 => 100644 build.py mode change 100755 => 100644 examples/chooser.py mode change 100755 => 100644 examples/colours.py mode change 100755 => 100644 examples/debughook.py mode change 100755 => 100644 examples/ex1_idaapi.py mode change 100755 => 100644 examples/ex1_idautils.py mode change 100755 => 100644 examples/ex_actions.py mode change 100755 => 100644 examples/ex_askusingform.py mode change 100755 => 100644 examples/ex_choose2.py mode change 100755 => 100644 examples/ex_cli.py mode change 100755 => 100644 examples/ex_custdata.py mode change 100755 => 100644 examples/ex_custview.py mode change 100755 => 100644 examples/ex_dbg.py mode change 100755 => 100644 examples/ex_debug_names.py mode change 100755 => 100644 examples/ex_func_chooser.py mode change 100755 => 100644 examples/ex_gdl_qflow_chart.py mode change 100755 => 100644 examples/ex_graph.py mode change 100755 => 100644 examples/ex_imports.py mode change 100755 => 100644 examples/ex_prefix_plugin.py mode change 100755 => 100644 examples/ex_pyqt.py mode change 100755 => 100644 examples/ex_strings.py mode change 100755 => 100644 examples/ex_uihook.py mode change 100755 => 100644 examples/hotkey.py mode change 100755 => 100644 examples/idapythonrc.py mode change 100755 => 100644 examples/structure.py mode change 100755 => 100644 python/idautils.py mode change 100755 => 100644 python/idc.py mode change 100755 => 100644 python/init.py create mode 100644 pywraps/py_bytes.py mode change 100755 => 100644 pywraps/py_bytes_custdata.py mode change 100755 => 100644 pywraps/py_diskio.py mode change 100755 => 100644 pywraps/py_gdl.py mode change 100755 => 100644 pywraps/py_graph.py mode change 100755 => 100644 pywraps/py_idaapi.py mode change 100755 => 100644 pywraps/py_kernwin.py mode change 100755 => 100644 pywraps/py_kernwin_choose2.py mode change 100755 => 100644 pywraps/py_kernwin_cli.py mode change 100755 => 100644 pywraps/py_kernwin_custview.py mode change 100755 => 100644 pywraps/py_kernwin_plgform.py mode change 100755 => 100644 pywraps/py_lines.py mode change 100755 => 100644 pywraps/py_nalt.py mode change 100755 => 100644 pywraps/sidc.py create mode 100644 tools/docs/hrdoc.cfg mode change 100755 => 100644 tools/docs/hrdoc.py mode change 100755 => 100644 tools/swigdocs.py diff --git a/Scripts/3rd/BboeVt.py b/Scripts/3rd/BboeVt.py old mode 100755 new mode 100644 diff --git a/Scripts/AsmViewer.py b/Scripts/AsmViewer.py old mode 100755 new mode 100644 diff --git a/Scripts/CallStackWalk.py b/Scripts/CallStackWalk.py old mode 100755 new mode 100644 diff --git a/Scripts/DbgCmd.py b/Scripts/DbgCmd.py old mode 100755 new mode 100644 diff --git a/Scripts/DrvsDispatch.py b/Scripts/DrvsDispatch.py old mode 100755 new mode 100644 diff --git a/Scripts/ExchainDump.py b/Scripts/ExchainDump.py old mode 100755 new mode 100644 diff --git a/Scripts/FindInstructions.py b/Scripts/FindInstructions.py old mode 100755 new mode 100644 diff --git a/Scripts/ImpRef.py b/Scripts/ImpRef.py old mode 100755 new mode 100644 diff --git a/Scripts/ImportExportViewer.py b/Scripts/ImportExportViewer.py old mode 100755 new mode 100644 diff --git a/Scripts/SEHGraph.py b/Scripts/SEHGraph.py old mode 100755 new mode 100644 diff --git a/Scripts/VaDump.py b/Scripts/VaDump.py old mode 100755 new mode 100644 diff --git a/Scripts/VirusTotal.py b/Scripts/VirusTotal.py old mode 100755 new mode 100644 diff --git a/Scripts/callstack_test.py b/Scripts/callstack_test.py old mode 100755 new mode 100644 diff --git a/Scripts/msdnapihelp.py b/Scripts/msdnapihelp.py old mode 100755 new mode 100644 diff --git a/api_contents.txt b/api_contents.txt index 99cb140..af05240 100644 --- a/api_contents.txt +++ b/api_contents.txt @@ -3939,6 +3939,7 @@ 'intvec_t_truncate', 'invalidate_dbgmem_config', 'invalidate_dbgmem_contents', + 'invalidate_visea_cache', 'is3byte', 'isASCII', 'isAlign', @@ -6274,6 +6275,7 @@ 'set_entry_forwarder', 'set_enum_bf', 'set_enum_cmt', + 'set_enum_flag', 'set_enum_fromtil', 'set_enum_ghost', 'set_enum_hidden', @@ -7078,6 +7080,7 @@ 'update_extra_cmt', 'update_fpd', 'update_func', + 'update_hidden_area', 'update_segm', 'user_cmts_begin', 'user_cmts_clear', diff --git a/build.py b/build.py old mode 100755 new mode 100644 diff --git a/examples/chooser.py b/examples/chooser.py old mode 100755 new mode 100644 diff --git a/examples/colours.py b/examples/colours.py old mode 100755 new mode 100644 diff --git a/examples/debughook.py b/examples/debughook.py old mode 100755 new mode 100644 diff --git a/examples/ex1_idaapi.py b/examples/ex1_idaapi.py old mode 100755 new mode 100644 diff --git a/examples/ex1_idautils.py b/examples/ex1_idautils.py old mode 100755 new mode 100644 diff --git a/examples/ex_actions.py b/examples/ex_actions.py old mode 100755 new mode 100644 diff --git a/examples/ex_askusingform.py b/examples/ex_askusingform.py old mode 100755 new mode 100644 diff --git a/examples/ex_choose2.py b/examples/ex_choose2.py old mode 100755 new mode 100644 diff --git a/examples/ex_cli.py b/examples/ex_cli.py old mode 100755 new mode 100644 diff --git a/examples/ex_custdata.py b/examples/ex_custdata.py old mode 100755 new mode 100644 diff --git a/examples/ex_custview.py b/examples/ex_custview.py old mode 100755 new mode 100644 diff --git a/examples/ex_dbg.py b/examples/ex_dbg.py old mode 100755 new mode 100644 diff --git a/examples/ex_debug_names.py b/examples/ex_debug_names.py old mode 100755 new mode 100644 diff --git a/examples/ex_func_chooser.py b/examples/ex_func_chooser.py old mode 100755 new mode 100644 diff --git a/examples/ex_gdl_qflow_chart.py b/examples/ex_gdl_qflow_chart.py old mode 100755 new mode 100644 diff --git a/examples/ex_graph.py b/examples/ex_graph.py old mode 100755 new mode 100644 diff --git a/examples/ex_imports.py b/examples/ex_imports.py old mode 100755 new mode 100644 diff --git a/examples/ex_prefix_plugin.py b/examples/ex_prefix_plugin.py old mode 100755 new mode 100644 diff --git a/examples/ex_pyqt.py b/examples/ex_pyqt.py old mode 100755 new mode 100644 diff --git a/examples/ex_strings.py b/examples/ex_strings.py old mode 100755 new mode 100644 diff --git a/examples/ex_uihook.py b/examples/ex_uihook.py old mode 100755 new mode 100644 diff --git a/examples/hotkey.py b/examples/hotkey.py old mode 100755 new mode 100644 diff --git a/examples/idapythonrc.py b/examples/idapythonrc.py old mode 100755 new mode 100644 diff --git a/examples/structure.py b/examples/structure.py old mode 100755 new mode 100644 diff --git a/out_of_tree/parsed_notifications.zip b/out_of_tree/parsed_notifications.zip index 05a4b6fd6c2587d1849060b17ab7cc394efe1df9..ce4c83cb22a1412ab6da5209bd7c21c2c74f84ac 100644 GIT binary patch delta 6643 zcmZWseO!-M8~@$i=kA&qsfJ@9SJI-|Kr_=lo74xSvdL zw+|aDB3o1YzoMwYsrCc#SjWo~v#$I}=hui98|}*!AN>~>vE6!aPzSc}$wRAlDD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M%eXHRZ``GjtS`Rv^Y zs~EHi*1mNU^y9XfOw}_+H$y+pc~Bv#c`*8&JXmQ`KAfP7`DC&_R@@f2VJ>VT;d+~q zTj8##+6sAosQ}KVQ~-G%QV8`^R0#R$y$#m2W*f}V{wv7X%CBHuWIIHbZimc2-VS5U z{TkMF?Q2*?{5R01RnU=H`}cm=x0_fjNViW8H+svbFM$~L}PuA65sy= D>O1SD diff --git a/pydoc_injections.txt b/pydoc_injections.txt index 224b348..246f96f 100644 --- a/pydoc_injections.txt +++ b/pydoc_injections.txt @@ -163,8 +163,8 @@ fix_fun: found info for free_custom_icon fix_fun: found info for is_idaq fix_fun: found info for readsel2 ### Processing lines.i -fix_fun: found info for set_user_defined_prefix fix_fun: found info for tag_remove +fix_fun: found info for set_user_defined_prefix fix_fun: found info for generate_disassembly ### Processing loader.i fix_fun: found info for mem2base diff --git a/python/idautils.py b/python/idautils.py old mode 100755 new mode 100644 index 91bd75f..0e6e700 --- a/python/idautils.py +++ b/python/idautils.py @@ -23,10 +23,12 @@ import ida_kernwin import ida_loader import ida_nalt import ida_name +import ida_netnode import ida_segment import ida_strlist import ida_ua import ida_xref + import idc import types import os diff --git a/python/idc.py b/python/idc.py old mode 100755 new mode 100644 index c0fe5bf..935cbb2 --- a/python/idc.py +++ b/python/idc.py @@ -47,6 +47,7 @@ import ida_idp import ida_kernwin import ida_lines import ida_loader +import ida_moves import ida_nalt import ida_name import ida_netnode @@ -8422,43 +8423,6 @@ def SetColor(ea, what, color): return False -#-------------------------------------------------------------------------- -# X M L -#-------------------------------------------------------------------------- - -def SetXML(path, name, value): - """ - Set or update one or more XML values. - - @param path: XPath expression of elements where to create value(s) - @param name: name of the element/attribute - (use @XXX for an attribute) to create. - If 'name' is empty, the elements or - attributes returned by XPath are directly - updated to contain the new 'value'. - @param value: value of the element/attribute - - @return: success (True or False) - """ - return idaapi.set_xml(path, name, value) - - -def GetXML(path): - """ - Get one XML value. - - @param path: XPath expression to an element - or attribute whose value is requested - - @return: the value, None if failed - """ - v = idaapi.value_t() - if idaapi.get_xml(path): - return v.str - else: - return None - - #---------------------------------------------------------------------------- # A R M S P E C I F I C #---------------------------------------------------------------------------- diff --git a/python/init.py b/python/init.py old mode 100755 new mode 100644 diff --git a/pywraps/py_bytes.py b/pywraps/py_bytes.py new file mode 100644 index 0000000..50516db --- /dev/null +++ b/pywraps/py_bytes.py @@ -0,0 +1,8 @@ + +# +def doExtra(ea): + setFlags(ea, get_flags_novalue(ea) | FF_LINE) + +def noExtra(ea): + setFlags(ea, get_flags_novalue(ea) & ~(FF_LINE)) +# diff --git a/pywraps/py_bytes_custdata.py b/pywraps/py_bytes_custdata.py old mode 100755 new mode 100644 diff --git a/pywraps/py_diskio.py b/pywraps/py_diskio.py old mode 100755 new mode 100644 diff --git a/pywraps/py_funcs.hpp b/pywraps/py_funcs.hpp index 8c60b46..4075db0 100644 --- a/pywraps/py_funcs.hpp +++ b/pywraps/py_funcs.hpp @@ -15,6 +15,8 @@ def get_fchunk_referer(ea, idx): static ea_t get_fchunk_referer(ea_t ea, size_t idx) { func_t *pfn = get_fchunk(ea); + if ( pfn == NULL ) + return BADADDR; func_parent_iterator_t dummy(pfn); // read referer info if ( idx >= pfn->refqty || pfn->referers == NULL ) return BADADDR; diff --git a/pywraps/py_gdl.py b/pywraps/py_gdl.py old mode 100755 new mode 100644 diff --git a/pywraps/py_graph.py b/pywraps/py_graph.py old mode 100755 new mode 100644 diff --git a/pywraps/py_idaapi.py b/pywraps/py_idaapi.py old mode 100755 new mode 100644 index 789c8d3..b3f1e04 --- a/pywraps/py_idaapi.py +++ b/pywraps/py_idaapi.py @@ -34,20 +34,27 @@ def require(modulename, package=None): module doesn't exist, it 'import's it, and if it does exist, 'reload()'s it. + The importing module (i.e., the module calling require()) will have + the loaded module bound to its globals(), under the name 'modulename'. + (If require() is called from the command line, the importing module + will be '__main__'.) + For more information, see: . """ + import inspect + frame_obj, filename, line_number, function_name, lines, index = inspect.stack()[1] + importer_module = inspect.getmodule(frame_obj) + if importer_module is None: # No importer module; called from command line + importer_module = sys.modules['__main__'] if modulename in sys.modules.keys(): reload(sys.modules[modulename]) + m = sys.modules[modulename] else: import importlib - import inspect m = importlib.import_module(modulename, package) - frame_obj, filename, line_number, function_name, lines, index = inspect.stack()[1] - importer_module = inspect.getmodule(frame_obj) - if importer_module is None: # No importer module; called from command line - importer_module = sys.modules['__main__'] - setattr(importer_module, modulename, m) sys.modules[modulename] = m + setattr(importer_module, modulename, m) + # ----------------------------------------------------------------------- diff --git a/pywraps/py_kernwin.py b/pywraps/py_kernwin.py old mode 100755 new mode 100644 diff --git a/pywraps/py_kernwin_askusingform.py b/pywraps/py_kernwin_askusingform.py index 1f7b3c5..7f935da 100755 --- a/pywraps/py_kernwin_askusingform.py +++ b/pywraps/py_kernwin_askusingform.py @@ -231,6 +231,9 @@ class Form(object): self.id = 0 """Automatically assigned control ID""" + self.input_field_index = None + """If this control is an input field, once Compile() returns this will hold its index. This is used only to compute the possible STARTITEM index""" + self.arg = None """Control argument value. This could be one element or a list/tuple (for multiple args per control)""" @@ -259,6 +262,11 @@ class Form(object): # Release the parent form reference self.form = None + def is_input_field(self): + """ + Return True if this field acts as an input + """ + return False # # Label controls @@ -327,6 +335,9 @@ class Form(object): def get_tag(self): return "%s%d" % (self.tag, self.id) + def is_input_field(self): + return True + class ChkGroupItemControl(GroupItemControl): """ @@ -465,6 +476,9 @@ class Form(object): self.switdh, ":" if self.hlp is None else self.hlp) + def is_input_field(self): + return True + class NumericInput(InputControl, NumericArgument): """ @@ -585,6 +599,9 @@ class Form(object): hlp) self.arg = _FORMCB_T(lambda view, code, h=handler: h(code)) + def is_input_field(self): + return False + class FormChangeCb(Control): """ @@ -981,8 +998,10 @@ class Form(object): The form controls are wrapped inside curly braces: {ControlName}. - A special operator can be used to return the ID of a given control by its name: {id:ControlName}. + A special operator can be used to return the index of a given control by its name: {id:ControlName}. This is useful when you use the STARTITEM form keyword to set the initially focused control. + (note that, technically, the index is not the same as the ID; that's because STARTITEM + uses raw, 0-based indexes rather than control IDs to determine the focused widget.) @param form: Compiles the form and returns the arguments needed to be passed to AskUsingForm() """ @@ -1000,32 +1019,53 @@ class Form(object): if isinstance(ctrl, Form.GroupControl): ctrl._reset() - p = 0 - while True: + def next_control(form, p, first_pass): i1 = form.find("{", p) - # No more items? - if i1 == -1: - break - - # Check if escaped - if (i1 != 0) and form[i1-1] == "\\": - # Remove escape sequence and restart search - form = form[:i1-1] + form[i1:] - - # Skip current marker - p = i1 - - # Continue search - continue - + if i1 < 0: + return form, None, None, None + if form[i1 - 1] == '\\' and i1 > 0: + if first_pass: + return next_control(form, i1 + 1, first_pass) + else: + # Remove escape sequence and restart search + form = form[:i1 - 1] + form[i1:] + return next_control(form, i1, first_pass) i2 = form.find("}", i1) - if i2 == -1: + if i2 < 0: raise SyntaxError("No matching closing brace '}'") - - # Parse control name - ctrlname = form[i1+1:i2] + ctrlname = form[i1 + 1:i2] if not ctrlname: raise ValueError("Control %d has an invalid name!" % ctrlcnt) + return form, i1, i2, ctrlname + + + last_input_field_index = 0 + # First pass: assign input_field_index values to controls + p = 0 + while True: + form, i1, i2, ctrlname = next_control(form, p, first_pass=True) + if ctrlname is None: + break + p = i2 + + if ctrlname.startswith("id:"): + continue + + ctrl = self.__controls.get(ctrlname, None) + if ctrl is None: + raise ValueError("No matching control '%s'" % ctrlname) + + # If this control is an input, assign its index + if ctrl.is_input_field(): + ctrl.input_field_index = last_input_field_index + last_input_field_index += 1 + + + p = 0 + while True: + form, i1, i2, ctrlname = next_control(form, p, first_pass=False) + if ctrlname is None: + break # Is it the IDOF operator? if ctrlname.startswith("id:"): @@ -1042,7 +1082,7 @@ class Form(object): # Replace control name by tag if idfunc: - tag = str(ctrl.id) + tag = str(ctrl.input_field_index if ctrl.input_field_index is not None else ctrl.id) else: tag = ctrl.get_tag() taglen = len(tag) diff --git a/pywraps/py_kernwin_choose2.py b/pywraps/py_kernwin_choose2.py old mode 100755 new mode 100644 diff --git a/pywraps/py_kernwin_cli.py b/pywraps/py_kernwin_cli.py old mode 100755 new mode 100644 diff --git a/pywraps/py_kernwin_custview.hpp b/pywraps/py_kernwin_custview.hpp index 0de6ea2..4840539 100644 --- a/pywraps/py_kernwin_custview.hpp +++ b/pywraps/py_kernwin_custview.hpp @@ -362,12 +362,7 @@ public: //-------------------------------------------------------------------------- bool refresh_current() { - int x, y; - place_t *pl = get_place(false, &x, &y); - if ( pl == NULL ) - return false; - - return jumpto(pl, x, y); + return refresh(); } //-------------------------------------------------------------------------- diff --git a/pywraps/py_kernwin_custview.py b/pywraps/py_kernwin_custview.py old mode 100755 new mode 100644 diff --git a/pywraps/py_kernwin_plgform.py b/pywraps/py_kernwin_plgform.py old mode 100755 new mode 100644 diff --git a/pywraps/py_lines.py b/pywraps/py_lines.py old mode 100755 new mode 100644 diff --git a/pywraps/py_nalt.py b/pywraps/py_nalt.py old mode 100755 new mode 100644 diff --git a/pywraps/sidc.py b/pywraps/sidc.py old mode 100755 new mode 100644 diff --git a/swig/dbg.i b/swig/dbg.i index 58abf3a..0ddcbc3 100644 --- a/swig/dbg.i +++ b/swig/dbg.i @@ -52,12 +52,22 @@ %ignore internal_get_sreg_base; %rename (internal_get_sreg_base) py_internal_get_sreg_base; +%thread; + +%nonnul_argument_prototype( + inline bool idaapi load_debugger(const char *nonnul_dbgname, bool use_remote), + const char *nonnul_dbgname); +%nonnul_argument_prototype( + inline void idaapi set_debugger_event_cond(const char *nonnul_cond), + const char *nonnul_cond); +%nonnul_argument_prototype( + inline bool idaapi diff_trace_file(const char *nonnul_filename), + const char *nonnul_filename); // We want ALL wrappers around what is declared in dbg.hpp // to release the GIL when calling into the IDA api: those // might be very long operations, that even require some // network traffic. -%thread; %include "dbg.hpp" %nothread; %ignore DBG_Callback; diff --git a/swig/enum.i b/swig/enum.i index 6da8938..78fba87 100644 --- a/swig/enum.i +++ b/swig/enum.i @@ -6,7 +6,7 @@ %ignore init_enums; %ignore save_enums; %ignore term_enums; -%ignore set_enum_flag; +%ignore set_enum_flag(enum_t, uint32, bool); %ignore get_enum_name(tid_t); %ignore get_selected_enum; %ignore add_selected_enum; diff --git a/swig/expr.i b/swig/expr.i index cb701e5..872d5f7 100644 --- a/swig/expr.i +++ b/swig/expr.i @@ -52,6 +52,10 @@ %ignore CompileLineEx; %ignore CompileLine; %rename (CompileLine) CompileLine_wrap; + +%nonnul_argument_prototype( + bool CompileLine_wrap(const char *nonnul_line, char *errbuf, size_t errbufsize), + const char *nonnul_line); %{ // // diff --git a/swig/fixup.i b/swig/fixup.i index a06ba42..22543ef 100644 --- a/swig/fixup.i +++ b/swig/fixup.i @@ -9,5 +9,8 @@ %ignore unregister_custom_fixup; %ignore set_custom_fixup; -%include "fixup.hpp" +%nonnul_argument_prototype( + idaman void ida_export set_fixup(ea_t source, const fixup_data_t *nonnul_fp), + const fixup_data_t *nonnul_fp); +%include "fixup.hpp" diff --git a/swig/idp.i b/swig/idp.i index 8cd5f3b..ee0007a 100644 --- a/swig/idp.i +++ b/swig/idp.i @@ -46,6 +46,10 @@ %ignore IDP_Callback; %ignore _py_getreg; +%nonnul_argument_prototype( + static PyObject *AssembleLine(ea_t ea, ea_t cs, ea_t ip, bool use32, const char *nonnul_line), + const char *nonnul_line); + %include "idp.hpp" %inline %{ diff --git a/swig/lines.i b/swig/lines.i index 47e5bb5..008f314 100644 --- a/swig/lines.i +++ b/swig/lines.i @@ -62,6 +62,10 @@ // %} +%nonnul_argument_prototype( + PyObject *py_tag_remove(const char *nonnul_instr), + const char *nonnul_instr); + %inline %{ // // diff --git a/swig/struct.i b/swig/struct.i index c0e60ba..75e2e34 100644 --- a/swig/struct.i +++ b/swig/struct.i @@ -48,6 +48,10 @@ } } +%nonnul_argument_prototype( + asize_t get_member_size(const member_t *nonnul_mptr), + const member_t *nonnul_mptr); + //------------------------------------------------------------------------- %include "struct.hpp" // Add a get_member() member function to struc_t. diff --git a/swig/typeconv.i b/swig/typeconv.i index ffd5743..8741098 100644 --- a/swig/typeconv.i +++ b/swig/typeconv.i @@ -298,16 +298,6 @@ %apply qstring { _qstring } %apply qstring* { _qstring* } -//--------------------------------------------------------------------- -// varargs (mostly kernwin.hpp) -//--------------------------------------------------------------------- -// This is used for functions like warning(), info() and so on -%typemap(in) (const char *format, ...) -{ - $1 = "%s"; /* Fix format string to %s */ - $2 = (void *) PyString_AsString($input); /* Get string argument */ -}; - #ifdef __EA64__ %apply longlong *INOUT { sval_t *value }; %apply longlong *INOUT { adiff_t *disp }; diff --git a/tools/chkapi.py b/tools/chkapi.py index ceaa77f..0b8da92 100644 --- a/tools/chkapi.py +++ b/tools/chkapi.py @@ -144,6 +144,34 @@ def check_cpp(opts): "nostring" : " --size;", }, + "_wrap_warning__varargs__" : { + "nullptrcheck" : 1, # 1st arg + "mustcall" : "PyString_AsString", + }, + "_wrap_error__varargs__" : { + "nullptrcheck" : 1, + "mustcall" : "PyString_AsString", + }, + "_wrap_tag_remove" : { + "nullptrcheck" : 1, + }, + "_wrap_CompileLine" : { + "nullptrcheck" : 1, + }, + "_wrap_set_fixup" : { + "nullptrcheck" : 2, + }, + "_wrap_get_member_size" : { + "nullptrcheck" : 1, + }, + "_wrap_load_debugger" : { + "nullptrcheck" : 1, + "string" : ["SWIG_PYTHON_THREAD_BEGIN_ALLOW", "SWIG_PYTHON_THREAD_END_ALLOW"], + }, + "_wrap_AssembleLine" : { + "nullptrcheck" : 5, + }, + # no autoEnabled present "SWIG_init" : { "nostring" : "autoEnabled", @@ -297,6 +325,10 @@ def check_cpp(opts): look_for_stuff(chk["string"], False) if "nostring" in chk: look_for_stuff(chk["nostring"], False, lookForPresence=False) + if "nullptrcheck" in chk: + look_for_stuff('"invalid null pointer " "in method \'" "%s" "\', argument " "%d""' % ( + fname.replace("_wrap_", "").replace("__varargs__", ""), + chk["nullptrcheck"]), False) # Ensure all functions were spotted. for fname in functions_coherence.keys(): diff --git a/tools/deploy/header.i.in b/tools/deploy/header.i.in index dab5f8b..159f354 100644 --- a/tools/deploy/header.i.in +++ b/tools/deploy/header.i.in @@ -626,6 +626,12 @@ static PyObject *type##_get_clink_ptr(PyObject *self) { $1 = "%s"; /* Fix format string to %s */ $2 = (void *) PyString_AsString($input); /* Get string argument */ + /* Note: we cannot rely on 'nonnul_argument_prototype' for */ + /* these, since we fiddle with the arguments number */ + if ( $2 == NULL ) + SWIG_exception_fail( + SWIG_ValueError, + "invalid null pointer " "in method '" "$symname" "', argument " "$argnum"" of type '" "$1_type""'"); }; // Help SWIG to figure out the ulonglong type @@ -821,6 +827,25 @@ using Forms::TForm; // get_[next|prev]_serial_enum_member() take serials as input, and have the result present as output %apply unsigned char *INOUT { uchar *in_out_serial }; +%define %nonnul_argument_prototype(PROTO, ARGSIG) +/* first, define the typemap */ +%typemap(check) (ARGSIG) +{ + if ( $1 == NULL ) + SWIG_exception_fail(SWIG_ValueError, "invalid null pointer " "in method '" "$symname" "', argument " "$argnum"" of type '" "$1_type""'"); +} +/* Then, redeclare prototype. Note that we want this prototype _only_ seen */ +/* by SWiG, but not by the later compile phase: because of the defines */ +/* in pro.h, 'idaapi', 'ida_export', etc... will disappear, causing */ +/* VisualStudio to exit with a "same prototype, different modifiers" error. */ +%inline %{ +#ifndef _MSC_VER + PROTO; +#endif +%} +%enddef + + %{ #include #include diff --git a/tools/docs/hrdoc.cfg b/tools/docs/hrdoc.cfg new file mode 100644 index 0000000..3c1f8e3 --- /dev/null +++ b/tools/docs/hrdoc.cfg @@ -0,0 +1,147 @@ +[epydoc] +# The list of objects to document. Objects can be named using +# dotted names, module filenames, or package directory names. +# Aliases for this option include "objects" and "values". +modules: idc, idautils, idaapi, ida_allins ida_area ida_auto ida_bytes ida_dbg ida_diskio ida_entry ida_enum ida_expr ida_fixup ida_fpro ida_frame ida_funcs ida_gdl ida_graph ida_hexrays ida_ida ida_idaapi ida_idd ida_idp ida_ints ida_kernwin ida_lines ida_loader ida_moves ida_nalt ida_name ida_netnode ida_offset ida_pro ida_queue ida_registry ida_search ida_segment ida_srarea ida_strlist ida_struct ida_typeinf ida_ua ida_xref + +# The type of output that should be generated. Should be one +# of: html, text, latex, dvi, ps, pdf. +output: html + +# The path to the output directory. May be relative or absolute. +target: hr-html/ + +# An integer indicating how verbose epydoc should be. The default +# value is 0; negative values will supress warnings and errors; +# positive values will give more verbose output. +verbosity: 0 + +# A boolean value indicating that Epydoc should show a tracaback +# in case of unexpected error. By default don't show tracebacks +debug: 0 + +# If True, don't try to use colors or cursor control when doing +# textual output. The default False assumes a rich text prompt +simple-term: 0 + + +### Generation options + +# The default markup language for docstrings, for modules that do +# not define __docformat__. Defaults to epytext. +docformat: epytext + +# Whether or not parsing should be used to examine objects. +parse: yes + +# Whether or not introspection should be used to examine objects. +introspect: yes + +# Don't examine in any way the modules whose dotted name match this +# regular expression pattern. +#exclude + +# Don't perform introspection on the modules whose dotted name match this +# regular expression pattern. +#exclude-introspect + +# Don't perform parsing on the modules whose dotted name match this +# regular expression pattern. +#exclude-parse + +# The format for showing inheritance objects. +# It should be one of: 'grouped', 'listed', 'included'. +inheritance: listed + +# Whether or not to inclue private variables. (Even if included, +# private variables will be hidden by default.) +private: no + +# Whether or not to list each module's imports. +imports: no + +# Whether or not to include syntax highlighted source code in +# the output (HTML only). +sourcecode: no + +# Whether or not to includea a page with Epydoc log, containing +# effective option at the time of generation and the reported logs. +include-log: no + + +### Output options + +# The documented project's name. +name: IDAPython + +# The CSS stylesheet for HTML output. Can be the name of a builtin +# stylesheet, or the name of a file. +css: white + +# The documented project's URL. +url: http://code.google.com/p/idapython/ + +# HTML code for the project link in the navigation bar. If left +# unspecified, the project link will be generated based on the +# project's name and URL. +link: Hex-Rays + +# The "top" page for the documentation. Can be a URL, the name +# of a module or class, or one of the special names "trees.html", +# "indices.html", or "help.html" +#top: os.path + +# An alternative help file. The named file should contain the +# body of an HTML file; navigation bars will be added to it. +#help: my_helpfile.html + +# Whether or not to include a frames-based table of contents. +frames: yes + +# Whether each class should be listed in its own section when +# generating LaTeX or PDF output. +separate-classes: no + + +### API linking options + +# Define a new API document. A new interpreted text role +# will be created +#external-api: epydoc + +# Use the records in this file to resolve objects in the API named NAME. +#external-api-file: epydoc:api-objects.txt + +# Use this URL prefix to configure the string returned for external API. +#external-api-root: epydoc:http://epydoc.sourceforge.net/api + + +### Graph options + +# The list of graph types that should be automatically included +# in the output. Graphs are generated using the Graphviz "dot" +# executable. Graph types include: "classtree", "callgraph", +# "umlclass". Use "all" to include all graph types +#graph: classtree + +# The path to the Graphviz "dot" executable, used to generate +# graphs. +#dotpath: /usr/local/bin/dot + +# The name of one or more pstat files (generated by the profile +# or hotshot module). These are used to generate call graphs. +#pstat: profile.out + +# Specify the font used to generate Graphviz graphs. +# (e.g., helvetica or times). +graph-font: Helvetica + +# Specify the font size used to generate Graphviz graphs. +#graph-font-size: 10 + + +### Return value options + +# The condition upon which Epydoc should exit with a non-zero +# exit status. Possible values are error, warning, docstring_warning +#fail-on: error diff --git a/tools/docs/hrdoc.py b/tools/docs/hrdoc.py old mode 100755 new mode 100644 diff --git a/tools/genhooks/genhooks.py b/tools/genhooks/genhooks.py index a0c2120..854aafb 100644 --- a/tools/genhooks/genhooks.py +++ b/tools/genhooks/genhooks.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # TODO: # * auto_queue_empty must return 1 by default. How should # that be specified? In idp.hpp, or in a specific, 'recipe' file? diff --git a/tools/swigdocs.py b/tools/swigdocs.py old mode 100755 new mode 100644