IDAPython 9.0
|
NOTE: this functionality is available in IDA Teams (not IDA Pro)
There are 3 databases involved in merging: base_idb, local_db, and remote_idb.
Conflicts can be resolved automatically or interactively. The automatic resolving scores the conflicting blocks and takes the better one. The interactive resolving displays the full rendered contents side by side, and expects the user to select the better side for each conflict.
Since IDB files contain various kinds of information, there are many merging phases. The entire list can be found in merge.cpp. Below are just some selected examples:
To unify UI elements of each merge phase, we use merger views:
IDA works in a new "merge" mode during merging. In this mode most events are not generated. We forbid them to reduce the risk that a rogue third-party plugin that is not aware of the "merge" mode would spoil something.
For example, normally renaming a function causes a cascade of events and may lead to other database modifications. Some of them may be desired, some - not. Since there are some undesired events, it is better to stop generating them. However, some events are required to render the disassembly listing. For example, ev_ana_insn, av_out_insn. This is why some events are still generated in the "merge" mode.
To let processor modules and plugins merge their data, we introduce a new event: ev_create_merge_handlers. It is generated immediately after opening all three idbs. The interested modules should react to this event by creating new merge handlers, if they need them.
While the kernel can create arbitrary merge handlers, modules can create only the standard ones returned by:
create_nodeval_merge_handler()
create_nodeval_merge_handlers()
create_std_modmerge_handlers()
We do not document merge_handler_t because once a merge handler is created, it is used exclusively by the kernel.
See mergemod.hpp for more information about the merge mode for modules.
Classes | |
class | item_block_locator_t |
Proxy of C++ merge_data_t::item_block_locator_t class. More... | |
class | merge_data_t |
Proxy of C++ merge_data_t class. More... | |
class | merge_handler_params_t |
Proxy of C++ merge_handler_params_t class. More... | |
class | merge_node_helper_t |
Proxy of C++ merge_node_helper_t class. More... | |
class | merge_node_info_t |
Proxy of C++ merge_node_info2_t class. More... | |
class | moddata_diff_helper_t |
Proxy of C++ moddata_diff_helper_t class. More... | |
Functions | |
"bool" | is_diff_merge_mode () |
is_diff_merge_mode() -> bool Return TRUE if IDA is running in diff mode (MERGE_POLICY_MDIFF/MERGE_POLICY_VDIFF) | |
"merge_handler_t *" | create_nodeval_merge_handler ("merge_handler_params_t" mhp, "char const *" label, "char const *" nodename, "uchar" tag, "uint32" nds_flags, "merge_node_helper_t" node_helper=None, "bool" skip_empty_nodes=True) |
create_nodeval_merge_handler(mhp, label, nodename, tag, nds_flags, node_helper=None, skip_empty_nodes=True) -> merge_handler_t Create a merge handler for netnode scalar/string values | |
"void" | create_nodeval_merge_handlers ("merge_handlers_t *" out, "merge_handler_params_t" mhp, "char const *" nodename, "merge_node_info_t" valdesc, "bool" skip_empty_nodes=True) |
create_nodeval_merge_handlers(out, mhp, nodename, valdesc, skip_empty_nodes=True) Create a serie of merge handlers for netnode scalar/string values (call create_nodeval_merge_handler() for each member of VALDESC) | |
"void" | destroy_moddata_merge_handlers ("int" data_id) |
destroy_moddata_merge_handlers(data_id) | |
"qstring *" | get_ea_diffpos_name ("ea_t" ea) |
get_ea_diffpos_name(ea) -> str Get nice name for EA diffpos | |
Variables | |
MERGE_KIND_NETNODE = _ida_merge.MERGE_KIND_NETNODE | |
MERGE_KIND_AUTOQ = _ida_merge.MERGE_KIND_AUTOQ | |
MERGE_KIND_INF = _ida_merge.MERGE_KIND_INF | |
MERGE_KIND_ENCODINGS = _ida_merge.MERGE_KIND_ENCODINGS | |
MERGE_KIND_ENCODINGS2 = _ida_merge.MERGE_KIND_ENCODINGS2 | |
MERGE_KIND_SCRIPTS2 = _ida_merge.MERGE_KIND_SCRIPTS2 | |
MERGE_KIND_SCRIPTS = _ida_merge.MERGE_KIND_SCRIPTS | |
MERGE_KIND_CUSTDATA = _ida_merge.MERGE_KIND_CUSTDATA | |
MERGE_KIND_ENUMS = _ida_merge.MERGE_KIND_ENUMS | |
MERGE_KIND_STRUCTS = _ida_merge.MERGE_KIND_STRUCTS | |
MERGE_KIND_TILS = _ida_merge.MERGE_KIND_TILS | |
MERGE_KIND_TINFO = _ida_merge.MERGE_KIND_TINFO | |
MERGE_KIND_STRMEM = _ida_merge.MERGE_KIND_STRMEM | |
MERGE_KIND_UDTMEM = _ida_merge.MERGE_KIND_UDTMEM | |
MERGE_KIND_GHSTRCMT = _ida_merge.MERGE_KIND_GHSTRCMT | |
MERGE_KIND_STRMEMCMT = _ida_merge.MERGE_KIND_STRMEMCMT | |
MERGE_KIND_SELECTORS = _ida_merge.MERGE_KIND_SELECTORS | |
MERGE_KIND_STT = _ida_merge.MERGE_KIND_STT | |
MERGE_KIND_SEGMENTS = _ida_merge.MERGE_KIND_SEGMENTS | |
MERGE_KIND_SEGGRPS = _ida_merge.MERGE_KIND_SEGGRPS | |
MERGE_KIND_SEGREGS = _ida_merge.MERGE_KIND_SEGREGS | |
MERGE_KIND_ORPHANS = _ida_merge.MERGE_KIND_ORPHANS | |
MERGE_KIND_BYTEVAL = _ida_merge.MERGE_KIND_BYTEVAL | |
MERGE_KIND_FIXUPS = _ida_merge.MERGE_KIND_FIXUPS | |
MERGE_KIND_MAPPING = _ida_merge.MERGE_KIND_MAPPING | |
MERGE_KIND_EXPORTS = _ida_merge.MERGE_KIND_EXPORTS | |
MERGE_KIND_IMPORTS = _ida_merge.MERGE_KIND_IMPORTS | |
MERGE_KIND_PATCHES = _ida_merge.MERGE_KIND_PATCHES | |
MERGE_KIND_FLAGS = _ida_merge.MERGE_KIND_FLAGS | |
MERGE_KIND_EXTRACMT = _ida_merge.MERGE_KIND_EXTRACMT | |
MERGE_KIND_AFLAGS_EA = _ida_merge.MERGE_KIND_AFLAGS_EA | |
MERGE_KIND_IGNOREMICRO = _ida_merge.MERGE_KIND_IGNOREMICRO | |
MERGE_KIND_FILEREGIONS = _ida_merge.MERGE_KIND_FILEREGIONS | |
MERGE_KIND_HIDDENRANGES = _ida_merge.MERGE_KIND_HIDDENRANGES | |
MERGE_KIND_SOURCEFILES = _ida_merge.MERGE_KIND_SOURCEFILES | |
MERGE_KIND_FUNC = _ida_merge.MERGE_KIND_FUNC | |
MERGE_KIND_FRAMEMGR = _ida_merge.MERGE_KIND_FRAMEMGR | |
MERGE_KIND_FRAME = _ida_merge.MERGE_KIND_FRAME | |
MERGE_KIND_STKPNTS = _ida_merge.MERGE_KIND_STKPNTS | |
MERGE_KIND_FLOWS = _ida_merge.MERGE_KIND_FLOWS | |
MERGE_KIND_CREFS = _ida_merge.MERGE_KIND_CREFS | |
MERGE_KIND_DREFS = _ida_merge.MERGE_KIND_DREFS | |
MERGE_KIND_BPTS = _ida_merge.MERGE_KIND_BPTS | |
MERGE_KIND_WATCHPOINTS = _ida_merge.MERGE_KIND_WATCHPOINTS | |
MERGE_KIND_BOOKMARKS = _ida_merge.MERGE_KIND_BOOKMARKS | |
MERGE_KIND_TRYBLKS = _ida_merge.MERGE_KIND_TRYBLKS | |
MERGE_KIND_DIRTREE = _ida_merge.MERGE_KIND_DIRTREE | |
MERGE_KIND_VFTABLES = _ida_merge.MERGE_KIND_VFTABLES | |
MERGE_KIND_SIGNATURES = _ida_merge.MERGE_KIND_SIGNATURES | |
MERGE_KIND_PROBLEMS = _ida_merge.MERGE_KIND_PROBLEMS | |
MERGE_KIND_UI = _ida_merge.MERGE_KIND_UI | |
MERGE_KIND_DEKSTOPS = _ida_merge.MERGE_KIND_DEKSTOPS | |
MERGE_KIND_NOTEPAD = _ida_merge.MERGE_KIND_NOTEPAD | |
MERGE_KIND_LOADER = _ida_merge.MERGE_KIND_LOADER | |
MERGE_KIND_DEBUGGER = _ida_merge.MERGE_KIND_DEBUGGER | |
MERGE_KIND_DBG_MEMREGS = _ida_merge.MERGE_KIND_DBG_MEMREGS | |
MERGE_KIND_LUMINA = _ida_merge.MERGE_KIND_LUMINA | |
MERGE_KIND_LAST = _ida_merge.MERGE_KIND_LAST | |
MERGE_KIND_END = _ida_merge.MERGE_KIND_END | |
MERGE_KIND_NONE = _ida_merge.MERGE_KIND_NONE | |
MH_LISTEN = _ida_merge.MH_LISTEN | |
MH_TERSE = _ida_merge.MH_TERSE | |
MH_UI_NODETAILS = _ida_merge.MH_UI_NODETAILS | |
MH_UI_COMPLEX = _ida_merge.MH_UI_COMPLEX | |
MH_UI_DP_NOLINEDIFF = _ida_merge.MH_UI_DP_NOLINEDIFF | |
MH_UI_DP_SHORTNAME = _ida_merge.MH_UI_DP_SHORTNAME | |
MH_UI_INDENT = _ida_merge.MH_UI_INDENT | |
MH_UI_SPLITNAME = _ida_merge.MH_UI_SPLITNAME | |
MH_UI_CHAR_MASK = _ida_merge.MH_UI_CHAR_MASK | |
MH_UI_COMMANAME = _ida_merge.MH_UI_COMMANAME | |
MH_UI_COLONNAME = _ida_merge.MH_UI_COLONNAME | |
NDS_IS_BOOL = _ida_merge.NDS_IS_BOOL | |
NDS_IS_EA = _ida_merge.NDS_IS_EA | |
NDS_IS_RELATIVE = _ida_merge.NDS_IS_RELATIVE | |
NDS_IS_STR = _ida_merge.NDS_IS_STR | |
NDS_SUPVAL = _ida_merge.NDS_SUPVAL | |
NDS_BLOB = _ida_merge.NDS_BLOB | |
NDS_EV_RANGE = _ida_merge.NDS_EV_RANGE | |
NDS_EV_FUNC = _ida_merge.NDS_EV_FUNC | |
NDS_MAP_IDX = _ida_merge.NDS_MAP_IDX | |
NDS_MAP_VAL = _ida_merge.NDS_MAP_VAL | |
NDS_VAL8 = _ida_merge.NDS_VAL8 | |
NDS_INC = _ida_merge.NDS_INC | |
NDS_UI_ND = _ida_merge.NDS_UI_ND | |
"merge_handler_t *" create_nodeval_merge_handler | ( | "merge_handler_params_t" | mhp, |
"char const *" | label, | ||
"char const *" | nodename, | ||
"uchar" | tag, | ||
"uint32" | nds_flags, | ||
"merge_node_helper_t" | node_helper = None, | ||
"bool" | skip_empty_nodes = True ) |
mhp | (C++: const merge_handler_params_t &) merging parameters |
label | (C++: const char *) handler short name (to be be appended to mhp.label) |
nodename | (C++: const char *) netnode name |
tag | (C++: uchar) a tag used to access values in the netnode |
nds_flags | (C++: uint32) netnode value attributes (a combination of nds_flags_t) |
node_helper | merge_node_helper_t * |
skip_empty_nodes | (C++: bool) do not create handler in case of empty netnode |
"void" create_nodeval_merge_handlers | ( | "merge_handlers_t *" | out, |
"merge_handler_params_t" | mhp, | ||
"char const *" | nodename, | ||
"merge_node_info_t" | valdesc, | ||
"bool" | skip_empty_nodes = True ) |
out | (C++: merge_handlers_t *) [out] created handlers will be placed here |
mhp | (C++: const merge_handler_params_t &) merging parameters |
nodename | (C++: const char *) netnode name |
valdesc | (C++: const merge_node_info_t *) array of handler descriptions |
skip_empty_nodes | (C++: bool) do not create handlers for empty netnodes |
"void" destroy_moddata_merge_handlers | ( | "int" | data_id | ) |
data_id | int |
"qstring *" get_ea_diffpos_name | ( | "ea_t" | ea | ) |
ea | (C++: ea_t) diffpos |
"bool" is_diff_merge_mode | ( | ) |
MERGE_KIND_AFLAGS_EA = _ida_merge.MERGE_KIND_AFLAGS_EA |
MERGE_KIND_AUTOQ = _ida_merge.MERGE_KIND_AUTOQ |
MERGE_KIND_BOOKMARKS = _ida_merge.MERGE_KIND_BOOKMARKS |
MERGE_KIND_BPTS = _ida_merge.MERGE_KIND_BPTS |
MERGE_KIND_BYTEVAL = _ida_merge.MERGE_KIND_BYTEVAL |
MERGE_KIND_CREFS = _ida_merge.MERGE_KIND_CREFS |
MERGE_KIND_CUSTDATA = _ida_merge.MERGE_KIND_CUSTDATA |
MERGE_KIND_DBG_MEMREGS = _ida_merge.MERGE_KIND_DBG_MEMREGS |
MERGE_KIND_DEBUGGER = _ida_merge.MERGE_KIND_DEBUGGER |
MERGE_KIND_DEKSTOPS = _ida_merge.MERGE_KIND_DEKSTOPS |
MERGE_KIND_DIRTREE = _ida_merge.MERGE_KIND_DIRTREE |
MERGE_KIND_DREFS = _ida_merge.MERGE_KIND_DREFS |
MERGE_KIND_ENCODINGS = _ida_merge.MERGE_KIND_ENCODINGS |
MERGE_KIND_ENCODINGS2 = _ida_merge.MERGE_KIND_ENCODINGS2 |
MERGE_KIND_END = _ida_merge.MERGE_KIND_END |
MERGE_KIND_ENUMS = _ida_merge.MERGE_KIND_ENUMS |
MERGE_KIND_EXPORTS = _ida_merge.MERGE_KIND_EXPORTS |
MERGE_KIND_EXTRACMT = _ida_merge.MERGE_KIND_EXTRACMT |
MERGE_KIND_FILEREGIONS = _ida_merge.MERGE_KIND_FILEREGIONS |
MERGE_KIND_FIXUPS = _ida_merge.MERGE_KIND_FIXUPS |
MERGE_KIND_FLAGS = _ida_merge.MERGE_KIND_FLAGS |
MERGE_KIND_FLOWS = _ida_merge.MERGE_KIND_FLOWS |
MERGE_KIND_FRAME = _ida_merge.MERGE_KIND_FRAME |
MERGE_KIND_FRAMEMGR = _ida_merge.MERGE_KIND_FRAMEMGR |
MERGE_KIND_FUNC = _ida_merge.MERGE_KIND_FUNC |
MERGE_KIND_GHSTRCMT = _ida_merge.MERGE_KIND_GHSTRCMT |
MERGE_KIND_HIDDENRANGES = _ida_merge.MERGE_KIND_HIDDENRANGES |
MERGE_KIND_IGNOREMICRO = _ida_merge.MERGE_KIND_IGNOREMICRO |
MERGE_KIND_IMPORTS = _ida_merge.MERGE_KIND_IMPORTS |
MERGE_KIND_INF = _ida_merge.MERGE_KIND_INF |
MERGE_KIND_LAST = _ida_merge.MERGE_KIND_LAST |
MERGE_KIND_LOADER = _ida_merge.MERGE_KIND_LOADER |
MERGE_KIND_LUMINA = _ida_merge.MERGE_KIND_LUMINA |
MERGE_KIND_MAPPING = _ida_merge.MERGE_KIND_MAPPING |
MERGE_KIND_NETNODE = _ida_merge.MERGE_KIND_NETNODE |
MERGE_KIND_NONE = _ida_merge.MERGE_KIND_NONE |
MERGE_KIND_NOTEPAD = _ida_merge.MERGE_KIND_NOTEPAD |
MERGE_KIND_ORPHANS = _ida_merge.MERGE_KIND_ORPHANS |
MERGE_KIND_PATCHES = _ida_merge.MERGE_KIND_PATCHES |
MERGE_KIND_PROBLEMS = _ida_merge.MERGE_KIND_PROBLEMS |
MERGE_KIND_SCRIPTS = _ida_merge.MERGE_KIND_SCRIPTS |
MERGE_KIND_SCRIPTS2 = _ida_merge.MERGE_KIND_SCRIPTS2 |
MERGE_KIND_SEGGRPS = _ida_merge.MERGE_KIND_SEGGRPS |
MERGE_KIND_SEGMENTS = _ida_merge.MERGE_KIND_SEGMENTS |
MERGE_KIND_SEGREGS = _ida_merge.MERGE_KIND_SEGREGS |
MERGE_KIND_SELECTORS = _ida_merge.MERGE_KIND_SELECTORS |
MERGE_KIND_SIGNATURES = _ida_merge.MERGE_KIND_SIGNATURES |
MERGE_KIND_SOURCEFILES = _ida_merge.MERGE_KIND_SOURCEFILES |
MERGE_KIND_STKPNTS = _ida_merge.MERGE_KIND_STKPNTS |
MERGE_KIND_STRMEM = _ida_merge.MERGE_KIND_STRMEM |
MERGE_KIND_STRMEMCMT = _ida_merge.MERGE_KIND_STRMEMCMT |
MERGE_KIND_STRUCTS = _ida_merge.MERGE_KIND_STRUCTS |
MERGE_KIND_STT = _ida_merge.MERGE_KIND_STT |
MERGE_KIND_TILS = _ida_merge.MERGE_KIND_TILS |
MERGE_KIND_TINFO = _ida_merge.MERGE_KIND_TINFO |
MERGE_KIND_TRYBLKS = _ida_merge.MERGE_KIND_TRYBLKS |
MERGE_KIND_UDTMEM = _ida_merge.MERGE_KIND_UDTMEM |
MERGE_KIND_UI = _ida_merge.MERGE_KIND_UI |
MERGE_KIND_VFTABLES = _ida_merge.MERGE_KIND_VFTABLES |
MERGE_KIND_WATCHPOINTS = _ida_merge.MERGE_KIND_WATCHPOINTS |
MH_LISTEN = _ida_merge.MH_LISTEN |
MH_TERSE = _ida_merge.MH_TERSE |
MH_UI_CHAR_MASK = _ida_merge.MH_UI_CHAR_MASK |
MH_UI_COLONNAME = _ida_merge.MH_UI_COLONNAME |
MH_UI_COMMANAME = _ida_merge.MH_UI_COMMANAME |
MH_UI_COMPLEX = _ida_merge.MH_UI_COMPLEX |
MH_UI_DP_NOLINEDIFF = _ida_merge.MH_UI_DP_NOLINEDIFF |
MH_UI_DP_SHORTNAME = _ida_merge.MH_UI_DP_SHORTNAME |
MH_UI_INDENT = _ida_merge.MH_UI_INDENT |
MH_UI_NODETAILS = _ida_merge.MH_UI_NODETAILS |
MH_UI_SPLITNAME = _ida_merge.MH_UI_SPLITNAME |
NDS_BLOB = _ida_merge.NDS_BLOB |
NDS_EV_FUNC = _ida_merge.NDS_EV_FUNC |
NDS_EV_RANGE = _ida_merge.NDS_EV_RANGE |
NDS_INC = _ida_merge.NDS_INC |
NDS_IS_BOOL = _ida_merge.NDS_IS_BOOL |
NDS_IS_EA = _ida_merge.NDS_IS_EA |
NDS_IS_RELATIVE = _ida_merge.NDS_IS_RELATIVE |
NDS_IS_STR = _ida_merge.NDS_IS_STR |
NDS_MAP_IDX = _ida_merge.NDS_MAP_IDX |
NDS_MAP_VAL = _ida_merge.NDS_MAP_VAL |
NDS_SUPVAL = _ida_merge.NDS_SUPVAL |
NDS_UI_ND = _ida_merge.NDS_UI_ND |
NDS_VAL8 = _ida_merge.NDS_VAL8 |