2007-10-20 09:03:51 +02:00
|
|
|
// Ignore callback members
|
|
|
|
%ignore loader_t::accept_file;
|
|
|
|
%ignore loader_t::load_file;
|
|
|
|
%ignore loader_t::save_file;
|
|
|
|
%ignore loader_t::move_segm;
|
|
|
|
%ignore loader_t::init_loader_options;
|
2010-04-23 12:55:20 +02:00
|
|
|
%ignore plugin_t;
|
2007-10-20 09:03:51 +02:00
|
|
|
|
|
|
|
%ignore vloader_failure;
|
|
|
|
%ignore loader_failure;
|
|
|
|
|
|
|
|
// TODO: These could be wrapped if needed
|
|
|
|
%ignore load_info_t;
|
2010-01-05 19:24:04 +01:00
|
|
|
%ignore add_plugin_option;
|
2011-04-18 18:07:00 +02:00
|
|
|
%ignore get_plugins_path;
|
2007-10-20 09:03:51 +02:00
|
|
|
%ignore build_loaders_list;
|
|
|
|
%ignore free_loaders_list;
|
|
|
|
%ignore get_loader_name_from_dll;
|
|
|
|
%ignore get_loader_name;
|
|
|
|
%ignore init_loader_options;
|
|
|
|
%ignore load_nonbinary_file;
|
|
|
|
%ignore impinfo_t;
|
|
|
|
%ignore import_module;
|
|
|
|
%ignore plugin_info_t;
|
|
|
|
%ignore get_plugins;
|
|
|
|
%ignore invoke_plugin;
|
|
|
|
%ignore dbg_info_t;
|
|
|
|
%ignore get_debugger_plugins;
|
|
|
|
%ignore init_plugins;
|
|
|
|
%ignore term_plugins;
|
|
|
|
|
|
|
|
// Callback and loader-only symbols are ignored (for now)
|
|
|
|
%ignore html_header_cb_t;
|
|
|
|
%ignore html_footer_cb_t;
|
|
|
|
%ignore html_line_cb_t;
|
|
|
|
%ignore gen_outline_t;
|
|
|
|
%ignore create_filename_cmt;
|
|
|
|
%ignore hook_cb_t;
|
|
|
|
%ignore hook_type_t;
|
|
|
|
%ignore hook_to_notification_point;
|
|
|
|
%ignore unhook_from_notification_point;
|
|
|
|
%ignore invoke_callbacks;
|
|
|
|
|
2008-10-01 17:03:57 +02:00
|
|
|
// Ignore this experimental function
|
|
|
|
%ignore gen_dev_event;
|
|
|
|
|
2007-10-20 09:03:51 +02:00
|
|
|
// Ignore kernel-only & unexported symbols
|
|
|
|
%ignore LDSC;
|
|
|
|
%ignore PLUGIN;
|
|
|
|
%ignore LNE_MAXSEG;
|
|
|
|
%ignore dlldata;
|
|
|
|
%ignore DLLDATASTART;
|
|
|
|
%ignore ldrdata;
|
|
|
|
%ignore LDRDATASTART;
|
|
|
|
%ignore idadll_t;
|
|
|
|
%ignore load_dll;
|
|
|
|
%ignore RE_NOFILE;
|
|
|
|
%ignore RE_NOTIDP;
|
|
|
|
%ignore RE_NOPAGE;
|
|
|
|
%ignore RE_NOLINK;
|
|
|
|
%ignore RE_BADRTP;
|
|
|
|
%ignore RE_BADORD;
|
|
|
|
%ignore RE_BADATP;
|
|
|
|
%ignore RE_BADMAP;
|
|
|
|
%ignore load_dll_or_die;
|
|
|
|
%ignore load_dll_or_say;
|
|
|
|
%ignore free_dll;
|
|
|
|
%ignore IDP_DESC_START;
|
|
|
|
%ignore IDP_DESC_END;
|
|
|
|
%ignore get_idp_desc;
|
|
|
|
%ignore init_fileregions;
|
|
|
|
%ignore term_fileregions;
|
|
|
|
%ignore save_fileregions;
|
|
|
|
%ignore add_fileregion;
|
|
|
|
%ignore move_fileregions;
|
2010-06-28 14:36:40 +02:00
|
|
|
%ignore del_fileregions;
|
2007-10-20 09:03:51 +02:00
|
|
|
%ignore local_gen_idc_file;
|
|
|
|
%ignore print_all_places;
|
|
|
|
%ignore save_text_line;
|
|
|
|
%ignore print_all_structs;
|
|
|
|
%ignore print_all_enums;
|
2010-03-05 12:35:28 +01:00
|
|
|
%ignore enum_processor_modules;
|
2010-06-28 14:36:40 +02:00
|
|
|
%ignore enum_plugins;
|
2007-10-20 09:03:51 +02:00
|
|
|
%ignore database_id0;
|
|
|
|
%ignore is_database_ext;
|
|
|
|
%ignore ida_database_memory;
|
2008-10-01 17:03:57 +02:00
|
|
|
%ignore ida_workdir;
|
2007-10-20 09:03:51 +02:00
|
|
|
%ignore is_temp_database;
|
|
|
|
%ignore pe_create_idata;
|
|
|
|
%ignore pe_load_resources;
|
|
|
|
%ignore pe_create_flat_group;
|
2008-10-01 17:03:57 +02:00
|
|
|
%ignore initializing;
|
|
|
|
%ignore highest_processor_level;
|
2007-10-20 09:03:51 +02:00
|
|
|
%ignore dbcheck_t;
|
|
|
|
%ignore DBCHK_NONE;
|
|
|
|
%ignore DBCHK_OK;
|
|
|
|
%ignore DBCHK_BAD;
|
|
|
|
%ignore DBCHK_NEW;
|
|
|
|
%ignore check_database;
|
|
|
|
%ignore open_database;
|
2008-10-01 17:03:57 +02:00
|
|
|
%ignore get_workbase_fname;
|
2007-10-20 09:03:51 +02:00
|
|
|
%ignore close_database;
|
|
|
|
%ignore compress_btree;
|
|
|
|
%ignore get_input_file_from_archive;
|
|
|
|
%ignore loader_move_segm;
|
|
|
|
%ignore generate_ida_copyright;
|
2008-10-01 17:03:57 +02:00
|
|
|
%ignore clear_plugin_options;
|
2007-10-20 09:03:51 +02:00
|
|
|
%ignore is_in_loader;
|
|
|
|
%ignore get_ids_filename;
|
2009-06-20 15:51:07 +02:00
|
|
|
%ignore is_embedded_dbfile_ext;
|
2007-10-20 09:03:51 +02:00
|
|
|
|
|
|
|
%ignore mem2base;
|
2010-04-23 12:55:20 +02:00
|
|
|
%rename (mem2base) py_mem2base;
|
2011-10-14 16:24:38 +02:00
|
|
|
%ignore update_snapshot_attributes;
|
|
|
|
%ignore build_snapshot_tree;
|
|
|
|
%ignore visit_snapshot_tree;
|
|
|
|
%ignore snapshot_t;
|
|
|
|
%ignore snapshots_t;
|
2010-04-23 12:55:20 +02:00
|
|
|
%ignore load_plugin;
|
|
|
|
%rename (load_plugin) py_load_plugin;
|
|
|
|
%ignore run_plugin;
|
|
|
|
%rename (run_plugin) py_run_plugin;
|
2007-10-20 09:03:51 +02:00
|
|
|
|
|
|
|
%include "loader.hpp"
|
|
|
|
|
|
|
|
%inline %{
|
2010-04-23 12:55:20 +02:00
|
|
|
//<inline(py_loader)>
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
#<pydoc>
|
|
|
|
def mem2base(mem, ea, fpos):
|
|
|
|
"""
|
|
|
|
Load database from the memory.
|
|
|
|
@param mem: the buffer
|
|
|
|
@param ea: start linear addresses
|
|
|
|
@param fpos: position in the input file the data is taken from.
|
|
|
|
if == -1, then no file position correspond to the data.
|
|
|
|
@return:
|
|
|
|
- Returns zero if the passed buffer was not a string
|
|
|
|
- Otherwise 1 is returned
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
#</pydoc>
|
|
|
|
*/
|
|
|
|
static int py_mem2base(PyObject *py_mem, ea_t ea, long fpos = -1)
|
2007-10-20 09:03:51 +02:00
|
|
|
{
|
2010-04-23 12:55:20 +02:00
|
|
|
Py_ssize_t len;
|
|
|
|
char *buf;
|
|
|
|
if ( PyString_AsStringAndSize(py_mem, &buf, &len) == -1 )
|
|
|
|
return 0;
|
2011-04-18 18:07:00 +02:00
|
|
|
|
2010-04-23 12:55:20 +02:00
|
|
|
return mem2base((void *)buf, ea, ea+len, fpos);
|
2007-10-20 09:03:51 +02:00
|
|
|
}
|
2010-04-23 12:55:20 +02:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
#<pydoc>
|
|
|
|
def load_plugin(name):
|
|
|
|
"""
|
|
|
|
Loads a plugin
|
|
|
|
@return:
|
|
|
|
- None if plugin could not be loaded
|
|
|
|
- An opaque object representing the loaded plugin
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
#</pydoc>
|
|
|
|
*/
|
|
|
|
static PyObject *py_load_plugin(const char *name)
|
|
|
|
{
|
|
|
|
plugin_t *r = load_plugin(name);
|
|
|
|
if ( r == NULL )
|
|
|
|
Py_RETURN_NONE;
|
2011-10-14 16:24:38 +02:00
|
|
|
else
|
|
|
|
return PyCObject_FromVoidPtr(r, NULL);
|
2010-04-23 12:55:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
#<pydoc>
|
|
|
|
def run_plugin(plg):
|
|
|
|
"""
|
|
|
|
Runs a plugin
|
|
|
|
@param plg: A plugin object (returned by load_plugin())
|
|
|
|
@return: Boolean
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
#</pydoc>
|
|
|
|
*/
|
|
|
|
static bool py_run_plugin(PyObject *plg, int arg)
|
|
|
|
{
|
|
|
|
if ( !PyCObject_Check(plg) )
|
|
|
|
return false;
|
2011-10-14 16:24:38 +02:00
|
|
|
else
|
|
|
|
return run_plugin((plugin_t *)PyCObject_AsVoidPtr(plg), arg);
|
2010-04-23 12:55:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//</inline(py_loader)>
|
|
|
|
|
2007-10-20 09:03:51 +02:00
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
|
|
|