IDAPython 9.0
|
Merge functionality. 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. * base_idb: the common base ancestor of 'local_db' and 'remote_db'. in the UI this database is located in the middle. * local_idb: local database that will contain the result of the merging. in the UI this database is located on the left. * remote_idb: remote database that will merge into local_idb. It may reside locally on the current computer, despite its name. in the UI this database is located on the right. base_idb and remote_idb are opened for reading only. base_idb may be absent, in this case a 2-way merging is performed. 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: * merge global database settings (inf and other global vars) * merge segmentation and changes to the database bytes * merge various lists: exports, imports, loaded tils, etc * merge names, functions, function frames * merge debugger settings, breakpoints * merge struct/enum views * merge local type libraries * merge the disassembly items (i.e. the segment contents) this includes operand types, code/data separation, etc * merge plugin specific info like decompiler types, dwarf mappings, etc To unify UI elements of each merge phase, we use merger views: * A view that consists of 2 or 3 panes: left (local_idb) and right (remote_idb). The common base is in the middle, if present. * Rendering of the panes depends on the phase, different phases show different contents. * The conflicts are highlighted by a colored background. Also, the detail pane can be consulted for additional info. * The user can select a conflict (or a bunch of conflicts) and say "use this block". * The user can browse the panes as he wishes. He will not be forced to handle conflicts in any particular order. However, once he finishes working with a merge handler and proceeds to the next one, he cannot go back. * Scrolling the left pane will synchronously scroll the right pane and vice versa. * There are the navigation commands like "go to the prev/next conflict" * The number of remaining conflicts to resolve is printed in the "Progress" chooser. * The user may manually modify local database inside the merger view. For that he may use the regular hotkeys. However, editing the database may lead to new conflicts, so we better restrict the available actions to some reasonable minimum. Currently, this is not implemented. 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 |
class | merge_data_t |
class | merge_handler_params_t |
class | merge_node_helper_t |
class | merge_node_info_t |
class | moddata_diff_helper_t |
Functions | |
bool | is_diff_merge_mode () |
'merge_handler_t *' | create_nodeval_merge_handler ('merge_handler_params_t' mhp, str label, str nodename, 'uchar' tag, int nds_flags, 'merge_node_helper_t' node_helper=None, bool skip_empty_nodes=True) |
None | create_nodeval_merge_handlers ('merge_handlers_t *' out, 'merge_handler_params_t' mhp, str nodename, 'merge_node_info_t' valdesc, bool skip_empty_nodes=True) |
None | destroy_moddata_merge_handlers (int data_id) |
str | get_ea_diffpos_name (ida_idaapi.ea_t ea) |
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, |
str | label, | ||
str | nodename, | ||
'uchar' | tag, | ||
int | nds_flags, | ||
'merge_node_helper_t' | node_helper = None, | ||
bool | skip_empty_nodes = True ) |
Create a merge handler for netnode scalar/string values @param mhp: merging parameters @param label: handler short name (to be be appended to mhp.label) @param nodename: netnode name @param tag: a tag used to access values in the netnode @param nds_flags: netnode value attributes (a combination of nds_flags_t) @param skip_empty_nodes: do not create handler in case of empty netnode @returns diff source object (normally should be attahced to a merge handler)
None create_nodeval_merge_handlers | ( | 'merge_handlers_t *' | out, |
'merge_handler_params_t' | mhp, | ||
str | nodename, | ||
'merge_node_info_t' | valdesc, | ||
bool | 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) @param out: [out] created handlers will be placed here @param mhp: merging parameters @param nodename: netnode name @param valdesc: array of handler descriptions @param skip_empty_nodes: do not create handlers for empty netnodes @returns diff source object (normally should be attahced to a merge handler)
None destroy_moddata_merge_handlers | ( | int | data_id | ) |
str get_ea_diffpos_name | ( | ida_idaapi.ea_t | ea | ) |
Get nice name for EA diffpos @param ea: diffpos
bool is_diff_merge_mode | ( | ) |
Return TRUE if IDA is running in diff mode (MERGE_POLICY_MDIFF/MERGE_POLICY_VDIFF)
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 |