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 05a4b6f..ce4c83c 100644
Binary files a/out_of_tree/parsed_notifications.zip and b/out_of_tree/parsed_notifications.zip differ
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