2007-12-06 14:56:20 +01:00
|
|
|
%module(docstring="IDA Pro Plugin SDK API wrapper",directors="1") idaapi
|
2007-10-20 09:03:51 +02:00
|
|
|
// Suppress 'previous definition of XX' warnings
|
|
|
|
#pragma SWIG nowarn=302
|
|
|
|
// Enable automatic docstring generation
|
|
|
|
%feature(autodoc);
|
|
|
|
%{
|
|
|
|
#include <Python.h>
|
|
|
|
#define USE_DANGEROUS_FUNCTIONS 1
|
|
|
|
#ifdef HAVE_SSIZE_T
|
|
|
|
#define _SSIZE_T_DEFINED 1
|
|
|
|
#endif
|
|
|
|
#include "ida.hpp"
|
2008-07-17 20:46:46 +02:00
|
|
|
#include "idp.hpp"
|
|
|
|
#include "allins.hpp"
|
2007-10-20 09:03:51 +02:00
|
|
|
#include "auto.hpp"
|
|
|
|
#include "bytes.hpp"
|
|
|
|
#include "dbg.hpp"
|
|
|
|
#include "diskio.hpp"
|
|
|
|
#include "entry.hpp"
|
|
|
|
#include "enum.hpp"
|
|
|
|
#include "expr.hpp"
|
|
|
|
#include "frame.hpp"
|
|
|
|
#include "fixup.hpp"
|
|
|
|
#include "funcs.hpp"
|
2008-11-02 16:00:52 +01:00
|
|
|
#include "gdl.hpp"
|
2007-10-20 09:03:51 +02:00
|
|
|
#include "idd.hpp"
|
|
|
|
#include "ints.hpp"
|
|
|
|
#include "kernwin.hpp"
|
|
|
|
#include "lines.hpp"
|
|
|
|
#include "loader.hpp"
|
|
|
|
#include "moves.hpp"
|
2008-07-22 20:23:05 +02:00
|
|
|
#include "netnode.hpp"
|
2007-10-20 09:03:51 +02:00
|
|
|
#include "nalt.hpp"
|
|
|
|
#include "name.hpp"
|
|
|
|
#include "offset.hpp"
|
|
|
|
#include "queue.hpp"
|
|
|
|
#include "search.hpp"
|
|
|
|
#include "srarea.hpp"
|
|
|
|
#include "strlist.hpp"
|
|
|
|
#include "struct.hpp"
|
|
|
|
#include "typeinf.hpp"
|
|
|
|
#include "ua.hpp"
|
|
|
|
#include "xref.hpp"
|
|
|
|
%}
|
|
|
|
|
|
|
|
%constant ea_t BADADDR = 0xFFFFFFFF;
|
|
|
|
%constant sel_t BADSEL = 0xFFFFFFFF;
|
2009-01-19 20:40:14 +01:00
|
|
|
%constant nodeidx_t BADNODE = 0xFFFFFFFF;
|
2007-10-20 09:03:51 +02:00
|
|
|
|
|
|
|
// Help SWIG to figure out the ulonglong type
|
|
|
|
#ifdef SWIGWIN
|
|
|
|
typedef unsigned __int64 ulonglong;
|
|
|
|
typedef __int64 longlong;
|
|
|
|
#else
|
|
|
|
typedef unsigned long long ulonglong;
|
|
|
|
typedef long long longlong;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
%include "typemaps.i"
|
|
|
|
|
|
|
|
%include "cstring.i"
|
|
|
|
%include "carrays.i"
|
|
|
|
%include "cpointer.i"
|
|
|
|
|
|
|
|
%include "typeconv.i"
|
|
|
|
|
|
|
|
%include "pro.h"
|
|
|
|
|
2009-01-19 20:40:14 +01:00
|
|
|
// Do not move this. We need to override the define from pro.h
|
|
|
|
#define CASSERT(type)
|
|
|
|
|
2007-10-20 09:03:51 +02:00
|
|
|
// Convert all of these
|
|
|
|
%cstring_output_maxstr_none(char *buf, size_t bufsize);
|
|
|
|
|
2008-08-31 19:58:56 +02:00
|
|
|
%array_class(uchar, uchar_array);
|
|
|
|
%array_class(tid_t, tid_array);
|
|
|
|
%array_class(ea_t, ea_array);
|
2008-08-31 19:54:16 +02:00
|
|
|
%array_class(sel_t, sel_array);
|
2009-01-19 20:40:14 +01:00
|
|
|
%array_class(uval_t, uval_array);
|
2007-10-20 09:03:51 +02:00
|
|
|
%pointer_class(int, int_pointer);
|
2008-02-26 20:53:27 +01:00
|
|
|
%pointer_class(ea_t, ea_pointer);
|
2008-04-10 21:43:44 +02:00
|
|
|
%pointer_class(sval_t, sval_pointer);
|
2008-08-31 19:46:06 +02:00
|
|
|
%pointer_class(sel_t, sel_pointer);
|
2007-10-20 09:03:51 +02:00
|
|
|
|
|
|
|
%include "ida.i"
|
2008-11-02 19:34:05 +01:00
|
|
|
%include "idd.i"
|
2007-10-20 09:03:51 +02:00
|
|
|
%include "idp.i"
|
2008-07-22 20:23:05 +02:00
|
|
|
%include "netnode.i"
|
|
|
|
%include "nalt.i"
|
2007-10-20 09:03:51 +02:00
|
|
|
|
2008-07-17 20:46:46 +02:00
|
|
|
%include "allins.i"
|
2009-01-19 20:40:14 +01:00
|
|
|
%include "area.i"
|
2007-10-20 09:03:51 +02:00
|
|
|
%include "auto.i"
|
|
|
|
%include "bytes.i"
|
|
|
|
%include "dbg.i"
|
|
|
|
%include "diskio.i"
|
|
|
|
%include "entry.i"
|
|
|
|
%include "enum.i"
|
|
|
|
%include "expr.i"
|
|
|
|
%include "fixup.i"
|
|
|
|
%include "frame.i"
|
|
|
|
%include "funcs.i"
|
|
|
|
|
|
|
|
%inline {
|
|
|
|
/* Small wrapper to get the inf structure */
|
|
|
|
idainfo *get_inf_structure(void)
|
|
|
|
{
|
|
|
|
return &inf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-02 16:00:52 +01:00
|
|
|
%include "gdl.i"
|
2007-10-20 09:03:51 +02:00
|
|
|
%include "ints.i"
|
|
|
|
%include "kernwin.i"
|
|
|
|
%include "lines.i"
|
|
|
|
%include "loader.i"
|
|
|
|
%include "moves.i"
|
|
|
|
%include "name.i"
|
|
|
|
%include "offset.i"
|
|
|
|
%include "queue.i"
|
|
|
|
%include "search.i"
|
|
|
|
%include "segment.i"
|
|
|
|
%include "srarea.i"
|
|
|
|
%include "strlist.i"
|
|
|
|
%include "struct.i"
|
|
|
|
%include "typeinf.i"
|
|
|
|
%include "ua.i"
|
|
|
|
%include "xref.i"
|
2008-10-07 19:21:58 +02:00
|
|
|
|
|
|
|
%inline {
|
|
|
|
void enable_extlang_python(bool enable);
|
2009-01-19 21:38:59 +01:00
|
|
|
void enable_python_cli(bool enable);
|
2009-01-19 20:40:14 +01:00
|
|
|
}
|