Module ida_loader
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)
Global Variables
ACCEPT_ARCHIVE
ACCEPT_CONTINUE
ACCEPT_FIRST
DBFL_BAK
DBFL_COMP
DBFL_KILL
DBFL_TEMP
DLLEXT
FILEREG_NOTPATCHABLE
FILEREG_PATCHABLE
GENFLG_ASMINC
GENFLG_ASMTYPE
GENFLG_GENHTML
GENFLG_IDCTYPE
GENFLG_MAPDMNG
GENFLG_MAPLOC
GENFLG_MAPNAME
GENFLG_MAPSEG
IDP_DLL
LDRF_RELOAD
LDRF_REQ_PROC
LOADER_DLL
MAX_DATABASE_DESCRIPTION
MODULE_ENTRY_IDP
MODULE_ENTRY_LOADER
MODULE_ENTRY_PLUGIN
NEF_CODE
NEF_FILL
NEF_FIRST
NEF_FLAT
NEF_IMPS
NEF_LALL
NEF_LOPT
NEF_MAN
NEF_MINI
NEF_NAME
NEF_RELOAD
NEF_RSCS
NEF_SEGS
OFILE_ASM
OFILE_DIF
OFILE_EXE
OFILE_IDC
OFILE_LST
OFILE_MAP
PATH_TYPE_CMD
PATH_TYPE_ID0
PATH_TYPE_IDB
PLUGIN_DLL
SSF_AUTOMATIC
SSUF_DESC
SSUF_FLAGS
SSUF_PATH
Functions
base2file(fp: FILE *, pos: qoff64_t, ea1: ea_t, ea2: ea_t) ‑> int
base2file(fp, pos, ea1, ea2) -> int Unload database to a binary file. This function works for wide byte processors too.
build_snapshot_tree(root: snapshot_t) ‑> bool
build_snapshot_tree(root) -> bool Build the snapshot tree.
clr_database_flag(dbfl: uint32) ‑> void
clr_database_flag(dbfl)
extract_module_from_archive(fname: char const *, is_remote: bool = False) ‑> PyObject *
extract_module_from_archive(fname, is_remote=False) -> PyObject Extract a module for an archive file. 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.
file2base(li: linput_t *, pos: qoff64_t, ea1: ea_t, ea2: ea_t, patchable: int) ‑> int
file2base(li, pos, ea1, ea2, patchable) -> int Load portion of file into the database. This function will include (ea1..ea2) into the addressing space of the program (make it enabled).
find_plugin(name: char const *, load_if_needed: bool = False) ‑> plugin_t *
find_plugin(name, load_if_needed=False) -> plugin_t Find a user-defined plugin and optionally load it.
flush_buffers() ‑> int
flush_buffers() -> int Flush buffers to the disk.
gen_exe_file(fp: FILE *) ‑> int
gen_exe_file(fp) -> int Generate an exe file (unload the database in binary form).
1: can generate an executable file
0: can't generate an executable file retval 1: ok retval 0: failed
gen_file(otype: ofile_type_t, fp: FILE *, ea1: ea_t, ea2: ea_t, flags: int) ‑> int
gen_file(otype, fp, ea1, ea2, flags) -> int Generate an output file.
get_basic_file_type(li: linput_t *) ‑> filetype_t
get_basic_file_type(li) -> filetype_t Get the input file type. This function can recognize libraries and zip files.
get_elf_debug_file_directory() ‑> char const *
get_elf_debug_file_directory() -> char const * Get the value of the ELF_DEBUG_FILE_DIRECTORY configuration directive.
get_file_type_name() ‑> size_t
get_file_type_name() -> str Get name of the current file type. The current file type is kept in idainfo::filetype.
get_fileregion_ea(offset: qoff64_t) ‑> ea_t
get_fileregion_ea(offset) -> ea_t Get linear address which corresponds to the specified input file offset. If can't be found, return BADADDR
get_fileregion_offset(ea: ea_t) ‑> qoff64_t
get_fileregion_offset(ea) -> qoff64_t Get offset in the input file which corresponds to the given ea. If the specified ea can't be mapped into the input file offset, return -1.
get_path(pt: path_type_t) ‑> char const *
get_path(pt) -> char const * Get the file path
get_plugin_options(plugin: char const *) ‑> char const *
get_plugin_options(plugin) -> char const * Get plugin options from the command line. 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
is_database_flag(dbfl: uint32) ‑> bool
is_database_flag(dbfl) -> bool Get the current database flag
is_trusted_idb() ‑> bool
is_trusted_idb() -> bool Is the database considered as trusted?
load_and_run_plugin(name: char const *, arg: size_t) ‑> bool
load_and_run_plugin(name, arg) -> bool Load & run a plugin.
load_binary_file(filename: char const *, li: linput_t *, _neflags: ushort, fileoff: qoff64_t, basepara: ea_t, binoff: ea_t, nbytes: uint64) ‑> bool
load_binary_file(filename, li, _neflags, fileoff, basepara, binoff, nbytes) -> bool Load a binary file into the database. This function usually is called from ui.
0: up to the end of the file retval true: ok retval false: failed (couldn't open the file)
load_ids_module(fname: char *) ‑> int
load_ids_module(fname) -> int Load and apply IDS file. 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.
load_plugin(name: char const *) ‑> PyObject *
load_plugin(name) -> PyCapsule or None Loads a plugin
mem2base(py_mem: PyObject *, ea: ea_t, fpos: qoff64_t = -1) ‑> int
mem2base(py_mem, ea, fpos=-1) -> int Load database from the memory.
process_archive(temp_file: qstring *, li: linput_t *, module_name: qstring *, neflags: ushort *, defmember: char const *, loader: load_info_t const *) ‑> qstring *
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(). Additional parameter 'loader' is a pointer to load_info_t structure.
reload_file(file: char const *, is_remote: bool) ‑> bool
reload_file(file, is_remote) -> bool Reload the input file. This function reloads the byte values from the input file. It doesn't modify the segmentation, names, comments, etc.
1: can reload the input file
0: can't reload the input file is_remote: (C++: bool) is the file located on a remote computer with the debugger server? return: success
run_plugin(plg: PyObject *, arg: size_t) ‑> bool
run_plugin(plg, arg) -> bool Runs a plugin
save_database(outfile: char const * = None, flags: uint32 = -1, root: snapshot_t = None, attr: snapshot_t = None) ‑> bool
save_database(outfile=None, flags=-1, root=None, attr=None) -> bool Save current database using a new file name.
set_database_flag(dbfl: uint32, cnd: bool = True) ‑> void
set_database_flag(dbfl, cnd=True) Set or clear database flag
set_import_name(modnode: uval_t, ea: ea_t, name: char const *) ‑> void
set_import_name(modnode, ea, name) Set information about the named import entry. This function performs 'modnode.supset_ea(ea, name);'
set_import_ordinal(modnode: uval_t, ea: ea_t, ord: uval_t) ‑> void
set_import_ordinal(modnode, ea, ord) Set information about the ordinal import entry. This function performs 'modnode.altset(ord, ea2node(ea));'
set_path(pt: path_type_t, path: char const *) ‑> void
set_path(pt, path) Set the file path
Classes
idp_desc_t()
: Proxy of C++ idp_desc_t class.
Instance variables
checked: bool
checked
family: qstring
family
is_script: bool
is_script
mtime: time_t
mtime
names: idp_names_t
names
path: qstring
path
idp_name_t()
: Proxy of C++ idp_name_t class.
Instance variables
hidden: bool
hidden
lname: qstring
lname
sname: qstring
sname
loader_t()
: Proxy of C++ loader_t class.
Instance variables
flags: uint32
flags
version: uint32
version
plugin_info_t()
: Proxy of C++ plugin_info_t class.
Instance variables
arg: size_t
arg
comment: char *
comment
dllmem: idadll_t
dllmem
entry: plugin_t *
entry
flags: int
flags
hotkey: ushort
hotkey
idaplg_name: qstring
idaplg_name
name: char *
name
next: plugin_info_t *
next
org_hotkey: ushort
org_hotkey
org_name: char *
org_name
path: char *
path
qvector_snapshotvec_t(*args)
: Proxy of C++ qvector< snapshot_t * > class.
Methods
add_unique(self, x: snapshot_t) ‑> bool add_unique(self, x) -> bool
x: snapshot_t *const &
at(self, _idx: size_t) ‑> snapshot_t *const & at(self, _idx) -> snapshot_t
_idx: size_t
back(self)
begin(self, *args) ‑> qvector< snapshot_t * >::const_iterator begin(self) -> qvector< snapshot_t * >::iterator begin(self) -> qvector< snapshot_t * >::const_iterator
capacity(self) ‑> size_t capacity(self) -> size_t
clear(self) ‑> void clear(self)
empty(self) ‑> bool empty(self) -> bool
end(self, *args) ‑> qvector< snapshot_t * >::const_iterator end(self) -> qvector< snapshot_t * >::iterator end(self) -> qvector< snapshot_t * >::const_iterator
erase(self, *args) ‑> qvector< snapshot_t * >::iterator erase(self, it) -> qvector< snapshot_t * >::iterator
it: qvector< snapshot_t * >::iterator
erase(self, first, last) -> qvector< snapshot_t * >::iterator
first: qvector< snapshot_t * >::iterator last: qvector< snapshot_t * >::iterator
extract(self) ‑> snapshot_t ** extract(self) -> snapshot_t **
find(self, *args) ‑> qvector< snapshot_t * >::const_iterator find(self, x) -> qvector< snapshot_t * >::iterator
x: snapshot_t *const &
find(self, x) -> qvector< snapshot_t * >::const_iterator
x: snapshot_t *const &
front(self)
has(self, x: snapshot_t) ‑> bool has(self, x) -> bool
x: snapshot_t *const &
inject(self, s: snapshot_t **, len: size_t) ‑> void inject(self, s, len)
s: snapshot_t ** len: size_t
insert(self, it: qvector< snapshot_t * >::iterator, x: snapshot_t) ‑> qvector< snapshot_t * >::iterator insert(self, it, x) -> qvector< snapshot_t * >::iterator
it: qvector< snapshot_t * >::iterator x: snapshot_t *const &
pop_back(self) ‑> void pop_back(self)
push_back(self, *args) ‑> snapshot_t *& push_back(self, x)
x: snapshot_t *const &
push_back(self) -> snapshot_t *&
qclear(self) ‑> void qclear(self)
reserve(self, cnt: size_t) ‑> void reserve(self, cnt)
cnt: size_t
resize(self, *args) ‑> void resize(self, _newsize, x)
_newsize: size_t x: snapshot_t *const &
resize(self, _newsize)
_newsize: size_t
size(self) ‑> size_t size(self) -> size_t
swap(self, r: qvector_snapshotvec_t) ‑> void swap(self, r)
r: qvector< snapshot_t * > &
truncate(self) ‑> void truncate(self)
snapshot_t()
: Proxy of C++ snapshot_t class.
Instance variables
children: snapshots_t
children
desc: char [128]
desc
filename: char [QMAXPATH]
filename
flags: uint16
flags
id: qtime64_t
id
Methods
clear(self) ‑> void clear(self)
Last updated