IDAPython 8.4
|
Definitions of IDP, LDR, PLUGIN module interfaces. This file also contains: * functions to load files into the database * functions to generate output files * high level functions to work with the database (open, save, close) The LDR interface consists of one structure: loader_t The IDP interface consists of one structure: processor_t The PLUGIN interface consists of one structure: plugin_t Modules can't use standard FILE* functions. They must use functions from <fpro.h> Modules can't use standard memory allocation functions. They must use functions from <pro.h> The exported entry #1 in the module should point to the the appropriate structure. (loader_t for LDR module, for example)
Classes | |
class | idp_desc_t |
Proxy of C++ idp_desc_t class. More... | |
class | idp_name_t |
Proxy of C++ idp_name_t class. More... | |
class | loader_t |
Proxy of C++ loader_t class. More... | |
class | plugin_info_t |
Proxy of C++ plugin_info_t class. More... | |
class | qvector_snapshotvec_t |
Proxy of C++ qvector< snapshot_t * > class. More... | |
class | snapshot_t |
Proxy of C++ snapshot_t class. More... | |
Functions | |
"bool" | load_binary_file (*args) |
load_binary_file(filename, li, _neflags, fileoff, basepara, binoff, nbytes) -> bool Load a binary file into the database. | |
"qstring *" | process_archive (*args) |
process_archive(temp_file, li, module_name, neflags, defmember, loader) -> str Calls loader_t::process_archive() For parameters and return value description look at loader_t::process_archive(). | |
"int" | gen_file (*args) |
gen_file(otype, fp, ea1, ea2, flags) -> int Generate an output file. | |
"int" | file2base (*args) |
file2base(li, pos, ea1, ea2, patchable) -> int Load portion of file into the database. | |
"int" | base2file (*args) |
base2file(fp, pos, ea1, ea2) -> int Unload database to a binary file. | |
"filetype_t" | get_basic_file_type (*args) |
get_basic_file_type(li) -> filetype_t Get the input file type. | |
"size_t" | get_file_type_name (*args) |
get_file_type_name() -> str Get name of the current file type. | |
"void" | set_import_ordinal (*args) |
set_import_ordinal(modnode, ea, ord) Set information about the ordinal import entry. | |
"void" | set_import_name (*args) |
set_import_name(modnode, ea, name) Set information about the named import entry. | |
"int" | load_ids_module (*args) |
load_ids_module(fname) -> int Load and apply IDS file. | |
"char const *" | get_plugin_options (*args) |
get_plugin_options(plugin) -> char const * Get plugin options from the command line. | |
"plugin_t *" | find_plugin (*args) |
find_plugin(name, load_if_needed=False) -> plugin_t * Find a user-defined plugin and optionally load it. | |
"qoff64_t" | get_fileregion_offset (*args) |
get_fileregion_offset(ea) -> qoff64_t Get offset in the input file which corresponds to the given ea. | |
"ea_t" | get_fileregion_ea (*args) |
get_fileregion_ea(offset) -> ea_t Get linear address which corresponds to the specified input file offset. | |
"int" | gen_exe_file (*args) |
gen_exe_file(fp) -> int Generate an exe file (unload the database in binary form). | |
"bool" | reload_file (*args) |
reload_file(file, is_remote) -> bool Reload the input file. | |
"bool" | build_snapshot_tree (*args) |
build_snapshot_tree(root) -> bool Build the snapshot tree. | |
"int" | flush_buffers (*args) |
flush_buffers() -> int Flush buffers to the disk. | |
"bool" | is_trusted_idb (*args) |
is_trusted_idb() -> bool Is the database considered as trusted? | |
"bool" | save_database (*args) |
save_database(outfile, flags, root=None, attr=None) -> bool Save current database using a new file name. | |
"bool" | is_database_flag (*args) |
is_database_flag(dbfl) -> bool Get the current database flag | |
"void" | set_database_flag (*args) |
set_database_flag(dbfl, cnd=True) Set or clear database flag | |
"void" | clr_database_flag (*args) |
clr_database_flag(dbfl) | |
"char const *" | get_path (*args) |
get_path(pt) -> char const * Get the file path | |
"void" | set_path (*args) |
set_path(pt, path) Set the file path | |
"char const *" | get_elf_debug_file_directory (*args) |
get_elf_debug_file_directory() -> char const * Get the value of the ELF_DEBUG_FILE_DIRECTORY configuration directive. | |
"int" | mem2base (*args) |
mem2base(py_mem, ea, fpos=-1) -> int Load database from the memory. | |
"PyObject *" | load_plugin (*args) |
load_plugin(name) -> PyCapsule or None Loads a plugin | |
"bool" | run_plugin (*args) |
run_plugin(plg, arg) -> bool Runs a plugin | |
"bool" | load_and_run_plugin (*args) |
load_and_run_plugin(name, arg) -> bool Load & run a plugin. | |
"PyObject *" | extract_module_from_archive (*args) |
extract_module_from_archive(fname, is_remote=False) -> (NoneType, NoneType), (str, str) Extract a module for an archive file. | |
Variables | |
LDRF_RELOAD = _ida_loader.LDRF_RELOAD | |
LDRF_REQ_PROC = _ida_loader.LDRF_REQ_PROC | |
ACCEPT_ARCHIVE = _ida_loader.ACCEPT_ARCHIVE | |
ACCEPT_CONTINUE = _ida_loader.ACCEPT_CONTINUE | |
ACCEPT_FIRST = _ida_loader.ACCEPT_FIRST | |
NEF_SEGS = _ida_loader.NEF_SEGS | |
NEF_RSCS = _ida_loader.NEF_RSCS | |
NEF_NAME = _ida_loader.NEF_NAME | |
NEF_MAN = _ida_loader.NEF_MAN | |
NEF_FILL = _ida_loader.NEF_FILL | |
NEF_IMPS = _ida_loader.NEF_IMPS | |
NEF_FIRST = _ida_loader.NEF_FIRST | |
NEF_CODE = _ida_loader.NEF_CODE | |
NEF_RELOAD = _ida_loader.NEF_RELOAD | |
NEF_FLAT = _ida_loader.NEF_FLAT | |
NEF_MINI = _ida_loader.NEF_MINI | |
NEF_LOPT = _ida_loader.NEF_LOPT | |
NEF_LALL = _ida_loader.NEF_LALL | |
DLLEXT = _ida_loader.DLLEXT | |
LOADER_DLL = _ida_loader.LOADER_DLL | |
OFILE_MAP = _ida_loader.OFILE_MAP | |
OFILE_EXE = _ida_loader.OFILE_EXE | |
OFILE_IDC = _ida_loader.OFILE_IDC | |
OFILE_LST = _ida_loader.OFILE_LST | |
OFILE_ASM = _ida_loader.OFILE_ASM | |
OFILE_DIF = _ida_loader.OFILE_DIF | |
GENFLG_MAPSEG = _ida_loader.GENFLG_MAPSEG | |
GENFLG_MAPNAME = _ida_loader.GENFLG_MAPNAME | |
GENFLG_MAPDMNG = _ida_loader.GENFLG_MAPDMNG | |
GENFLG_MAPLOC = _ida_loader.GENFLG_MAPLOC | |
GENFLG_IDCTYPE = _ida_loader.GENFLG_IDCTYPE | |
GENFLG_ASMTYPE = _ida_loader.GENFLG_ASMTYPE | |
GENFLG_GENHTML = _ida_loader.GENFLG_GENHTML | |
GENFLG_ASMINC = _ida_loader.GENFLG_ASMINC | |
FILEREG_PATCHABLE = _ida_loader.FILEREG_PATCHABLE | |
FILEREG_NOTPATCHABLE = _ida_loader.FILEREG_NOTPATCHABLE | |
PLUGIN_DLL = _ida_loader.PLUGIN_DLL | |
MODULE_ENTRY_LOADER = _ida_loader.MODULE_ENTRY_LOADER | |
MODULE_ENTRY_PLUGIN = _ida_loader.MODULE_ENTRY_PLUGIN | |
MODULE_ENTRY_IDP = _ida_loader.MODULE_ENTRY_IDP | |
IDP_DLL = _ida_loader.IDP_DLL | |
MAX_DATABASE_DESCRIPTION = _ida_loader.MAX_DATABASE_DESCRIPTION | |
SSF_AUTOMATIC = _ida_loader.SSF_AUTOMATIC | |
SSUF_DESC = _ida_loader.SSUF_DESC | |
SSUF_PATH = _ida_loader.SSUF_PATH | |
SSUF_FLAGS = _ida_loader.SSUF_FLAGS | |
DBFL_KILL = _ida_loader.DBFL_KILL | |
DBFL_COMP = _ida_loader.DBFL_COMP | |
DBFL_BAK = _ida_loader.DBFL_BAK | |
DBFL_TEMP = _ida_loader.DBFL_TEMP | |
PATH_TYPE_CMD = _ida_loader.PATH_TYPE_CMD | |
PATH_TYPE_IDB = _ida_loader.PATH_TYPE_IDB | |
PATH_TYPE_ID0 = _ida_loader.PATH_TYPE_ID0 | |
"int" base2file | ( | * | args | ) |
This function works for wide byte processors too.
fp | (C++: FILE *) pointer to file |
pos | (C++: qoff64_t) position in the file |
ea1 | (C++: ea_t) ,ea2: range of source linear addresses |
ea2 | (C++: ea_t) |
"bool" build_snapshot_tree | ( | * | args | ) |
root | (C++: snapshot_t *) snapshot root that will contain the snapshot tree elements. |
"void" clr_database_flag | ( | * | args | ) |
dbfl | uint32 |
"PyObject *" extract_module_from_archive | ( | * | args | ) |
Parse an archive file, show the list of modules to the user, allow him to select a module, extract the selected module to a file (if the extract module is an archive, repeat the process). This function can handle ZIP, AR, AIXAR, OMFLIB files. The temporary file will be automatically deleted by IDA at the end.
filename | (C++: char *) in: input file. out: name of the selected module. |
is_remote | (C++: bool) is the input file remote? |
true | ok |
false | something bad happened (error message has been displayed to the user) |
"int" file2base | ( | * | args | ) |
This function will include (ea1..ea2) into the addressing space of the program (make it enabled).
li | (C++: linput_t *) pointer of input source |
pos | (C++: qoff64_t) position in the file |
ea1 | (C++: ea_t) ,ea2: range of destination linear addresses |
patchable | (C++: int) should the kernel remember correspondence of file offsets to linear addresses. |
1 | ok |
0 | read error, a warning is displayed |
patchable | (C++: int) should the kernel remember correspondence of file offsets to linear addresses. |
1 | ok |
0 | read error, a warning is displayed |
"plugin_t *" find_plugin | ( | * | args | ) |
name | (C++: const char *) short plugin name without path and extension, or absolute path to the file name |
load_if_needed | (C++: bool) if the plugin is not present in the memory, try to load it |
"int" flush_buffers | ( | * | args | ) |
"int" gen_exe_file | ( | * | args | ) |
fp | (C++: FILE *) |
1 | ok |
0 | failed |
"int" gen_file | ( | * | args | ) |
otype | (C++: ofile_type_t) type of output file. |
fp | (C++: FILE *) the output file handle |
ea1 | (C++: ea_t) start address. For some file types this argument is ignored |
ea2 | (C++: ea_t) end address. For some file types this argument is ignored as usual in ida, the end address of the range is not included |
flags | (C++: int) Generate file flagsOFILE_EXE: |
0 | can't generate exe file |
1 | ok |
"filetype_t" get_basic_file_type | ( | * | args | ) |
This function can recognize libraries and zip files.
li | (C++: linput_t *) |
"char const *" get_elf_debug_file_directory | ( | * | args | ) |
"size_t" get_file_type_name | ( | * | args | ) |
The current file type is kept in idainfo::filetype.
"ea_t" get_fileregion_ea | ( | * | args | ) |
If can't be found, return BADADDR
offset | (C++: qoff64_t) |
"qoff64_t" get_fileregion_offset | ( | * | args | ) |
If the specified ea can't be mapped into the input file offset, return -1.
ea | (C++: ea_t) |
"char const *" get_path | ( | * | args | ) |
pt | (C++: path_type_t) file path type Types of the file pathes |
"char const *" get_plugin_options | ( | * | args | ) |
If the user has specified the options in the -Oplugin_name:options format, them this function will return the 'options' part of it The 'plugin' parameter should denote the plugin name Returns nullptr if there we no options specified
plugin | (C++: const char *) char const * |
"bool" is_database_flag | ( | * | args | ) |
dbfl | (C++: uint32) flag Database flags |
"bool" is_trusted_idb | ( | * | args | ) |
"bool" load_and_run_plugin | ( | * | args | ) |
name | (C++: const char *) char const * |
arg | (C++: size_t) |
"bool" load_binary_file | ( | * | args | ) |
This function usually is called from ui.
filename | (C++: const char *) the name of input file as is (if the input file is from library, then this is the name from the library) |
li | (C++: linput_t *) loader input source |
_neflags | (C++: ushort) Load file flags. For the first file, the flag NEF_FIRST must be set. |
fileoff | (C++: qoff64_t) Offset in the input file |
basepara | (C++: ea_t) Load address in paragraphs |
binoff | (C++: ea_t) Load offset (load_address=(basepara<<4)+binoff) |
nbytes | (C++: uint64) Number of bytes to load from the file.
|
true | ok |
false | failed (couldn't open the file) |
"int" load_ids_module | ( | * | args | ) |
This function loads the specified IDS file and applies it to the database. If the program imports functions from a module with the same name as the name of the ids file being loaded, then only functions from this module will be affected. Otherwise (i.e. when the program does not import a module with this name) any function in the program may be affected.
fname | (C++: char *) name of file to apply |
1 | ok |
0 | some error (a message is displayed). if the ids file does not exist, no message is displayed |
"PyObject *" load_plugin | ( | * | args | ) |
name | char const * |
"int" mem2base | ( | * | args | ) |
py_mem | the buffer |
ea | start linear addresses |
fpos | position in the input file the data is taken from. if == -1, then no file position correspond to the data. |
"qstring *" process_archive | ( | * | args | ) |
Additional parameter 'loader' is a pointer to load_info_t structure.
temp_file | (C++: qstring *) |
li | (C++: linput_t *) |
module_name | (C++: qstring *) |
neflags | (C++: ushort *) |
defmember | (C++: const char *) char const * |
loader | (C++: const load_info_t *) load_info_t const * |
"bool" reload_file | ( | * | args | ) |
This function reloads the byte values from the input file. It doesn't modify the segmentation, names, comments, etc.
file | (C++: const char *) name of the input file. if file == nullptr then returns:
|
is_remote | (C++: bool) is the file located on a remote computer with the debugger server? |
"bool" run_plugin | ( | * | args | ) |
plg | A plugin object (returned by load_plugin()) |
arg | size_t |
"bool" save_database | ( | * | args | ) |
outfile | (C++: const char *) output database file name |
flags | (C++: uint32) Database flags |
root | (C++: const snapshot_t *) optional: snapshot tree root. |
attr | (C++: const snapshot_t *) optional: snapshot attributes |
"void" set_database_flag | ( | * | args | ) |
dbfl | (C++: uint32) flag Database flags |
cnd | (C++: bool) set if true or clear flag otherwise |
"void" set_import_name | ( | * | args | ) |
This function performs 'modnode.supset_ea(ea, name);'
modnode | (C++: uval_t) node with information about imported entries |
ea | (C++: ea_t) linear address of the entry |
name | (C++: const char *) name of the entry |
"void" set_import_ordinal | ( | * | args | ) |
This function performs 'modnode.altset(ord, ea2node(ea));'
modnode | (C++: uval_t) node with information about imported entries |
ea | (C++: ea_t) linear address of the entry |
ord | (C++: uval_t) ordinal number of the entry |
"void" set_path | ( | * | args | ) |
pt | (C++: path_type_t) file path type Types of the file pathes |
path | (C++: const char *) new file path, use nullptr or empty string to clear the file path |
ACCEPT_ARCHIVE = _ida_loader.ACCEPT_ARCHIVE |
ACCEPT_CONTINUE = _ida_loader.ACCEPT_CONTINUE |
ACCEPT_FIRST = _ida_loader.ACCEPT_FIRST |
DBFL_BAK = _ida_loader.DBFL_BAK |
DBFL_COMP = _ida_loader.DBFL_COMP |
DBFL_KILL = _ida_loader.DBFL_KILL |
DBFL_TEMP = _ida_loader.DBFL_TEMP |
DLLEXT = _ida_loader.DLLEXT |
FILEREG_NOTPATCHABLE = _ida_loader.FILEREG_NOTPATCHABLE |
FILEREG_PATCHABLE = _ida_loader.FILEREG_PATCHABLE |
GENFLG_ASMINC = _ida_loader.GENFLG_ASMINC |
GENFLG_ASMTYPE = _ida_loader.GENFLG_ASMTYPE |
GENFLG_GENHTML = _ida_loader.GENFLG_GENHTML |
GENFLG_IDCTYPE = _ida_loader.GENFLG_IDCTYPE |
GENFLG_MAPDMNG = _ida_loader.GENFLG_MAPDMNG |
GENFLG_MAPLOC = _ida_loader.GENFLG_MAPLOC |
GENFLG_MAPNAME = _ida_loader.GENFLG_MAPNAME |
GENFLG_MAPSEG = _ida_loader.GENFLG_MAPSEG |
IDP_DLL = _ida_loader.IDP_DLL |
LDRF_RELOAD = _ida_loader.LDRF_RELOAD |
LDRF_REQ_PROC = _ida_loader.LDRF_REQ_PROC |
LOADER_DLL = _ida_loader.LOADER_DLL |
MAX_DATABASE_DESCRIPTION = _ida_loader.MAX_DATABASE_DESCRIPTION |
MODULE_ENTRY_IDP = _ida_loader.MODULE_ENTRY_IDP |
MODULE_ENTRY_LOADER = _ida_loader.MODULE_ENTRY_LOADER |
MODULE_ENTRY_PLUGIN = _ida_loader.MODULE_ENTRY_PLUGIN |
NEF_CODE = _ida_loader.NEF_CODE |
NEF_FILL = _ida_loader.NEF_FILL |
NEF_FIRST = _ida_loader.NEF_FIRST |
NEF_FLAT = _ida_loader.NEF_FLAT |
NEF_IMPS = _ida_loader.NEF_IMPS |
NEF_LALL = _ida_loader.NEF_LALL |
NEF_LOPT = _ida_loader.NEF_LOPT |
NEF_MAN = _ida_loader.NEF_MAN |
NEF_MINI = _ida_loader.NEF_MINI |
NEF_NAME = _ida_loader.NEF_NAME |
NEF_RELOAD = _ida_loader.NEF_RELOAD |
NEF_RSCS = _ida_loader.NEF_RSCS |
NEF_SEGS = _ida_loader.NEF_SEGS |
OFILE_ASM = _ida_loader.OFILE_ASM |
OFILE_DIF = _ida_loader.OFILE_DIF |
OFILE_EXE = _ida_loader.OFILE_EXE |
OFILE_IDC = _ida_loader.OFILE_IDC |
OFILE_LST = _ida_loader.OFILE_LST |
OFILE_MAP = _ida_loader.OFILE_MAP |
PATH_TYPE_CMD = _ida_loader.PATH_TYPE_CMD |
PATH_TYPE_ID0 = _ida_loader.PATH_TYPE_ID0 |
PATH_TYPE_IDB = _ida_loader.PATH_TYPE_IDB |
PLUGIN_DLL = _ida_loader.PLUGIN_DLL |
SSF_AUTOMATIC = _ida_loader.SSF_AUTOMATIC |
SSUF_DESC = _ida_loader.SSUF_DESC |
SSUF_FLAGS = _ida_loader.SSUF_FLAGS |
SSUF_PATH = _ida_loader.SSUF_PATH |