105 #define ui_switch_dbctx_guard switch_dbctx
116 MERGE_KIND_ENCODINGS,
117 MERGE_KIND_ENCODINGS2,
129 MERGE_KIND_STRMEMCMT,
130 MERGE_KIND_SELECTORS,
144 MERGE_KIND_AFLAGS_EA,
145 MERGE_KIND_IGNOREMICRO,
146 MERGE_KIND_FILEREGIONS,
147 MERGE_KIND_HIDDENRANGES,
148 MERGE_KIND_SOURCEFILES,
157 MERGE_KIND_WATCHPOINTS,
158 MERGE_KIND_BOOKMARKS,
162 MERGE_KIND_SIGNATURES,
169 MERGE_KIND_DBG_MEMREGS,
174 MERGE_KIND_END = merge_kind_t(-2),
177 MERGE_KIND_NONE = merge_kind_t(-1)
181class merge_handler_t;
234 nbases = base != -1 ? 3 : 2;
323#define MH_LISTEN 0x00000001
324#define MH_TERSE 0x00000002
325#define MH_UI_NODETAILS 0x00000100
326#define MH_UI_COMPLEX 0x00000200
327#define MH_UI_DP_NOLINEDIFF 0x00000400
328#define MH_UI_DP_SHORTNAME 0x00000800
329#define MH_UI_INDENT 0x00001000
330#define MH_UI_SPLITNAME 0x00800000
332#define MH_UI_CHAR_MASK 0x007F0000
333#define MH_UI_DEF_CHAR(v) ((((v) & 0x7F) << 16) | MH_UI_SPLITNAME)
336#define MH_UI_COMMANAME MH_UI_DEF_CHAR(',')
338#define MH_UI_COMMANAME 0x00AC0000
342#define MH_UI_COLONNAME MH_UI_DEF_CHAR(':')
344#define MH_UI_COLONNAME 0x00BA0000
347#define MH_DUMMY 0x80000000
353 merge_kind_t _insert_after,
423 const char *_module_name,
424 const char *_netnode_name,
530 for (
const auto ea : eas )
531 s->cat_sprnt(
"%a,", ea);
575 const char *nodename,
579 bool skip_empty_nodes =
true);
584 const char *nodename,
588 bool skip_empty_nodes =
true);
604 const char *nodename,
607 bool skip_empty_nodes =
true);
612 const char *nodename,
615 bool skip_empty_nodes =
true);
621#define IDI_FLDENTRY(struc, field, mask, valmap, name) \
623 qoffsetof(struc, field), \
624 sizeof(struc::field), \
629 IDI_STRUCFLD|IDI_SCALAR }
632#define IDI_FLDQSTR(struc, field, name) \
633 { name, qoffsetof(struc, field), 0, 0, 0, nullptr, nullptr, IDI_STRUCFLD|IDI_QSTRING }
636#define IDI_ALTENTRY(altidx, tag, width, mask, valmap, name) \
644 IDI_ALTVAL|IDI_SCALAR }
647#define IDI_HASHENTRY(hashname, tag, width, mask, flag, valmap, name) \
649 uintptr_t(hashname), \
658#define IDI_SUPSTR(altidx, tag, name) \
659 { name, uintptr_t(altidx), 0, 0, tag, nullptr, nullptr, IDI_SUPVAL|IDI_CSTR }
662#define IDI_DEVICE_ENTRY IDI_SUPSTR(-1, stag, "device")
665#define MNI_ENTRY(tag, flags, name, helper) \
666 { name, tag, NDS_MAP_IDX|NDS_EV_RANGE|(flags), helper }
669#define MNI_FUNCENTRY(tag, flags, name) \
670 MNI_ENTRY(tag, NDS_EV_FUNC|(flags), name, nullptr)
673#define MNI_STDENTRY(tag, flags, name) MNI_ENTRY(tag, flags, name, nullptr)
677#ifdef ui_switch_dbctx_guard
678 #define switch_dbctx ui_switch_dbctx_guard
void remove_last(int cnt=1)
Definition pro.h:3152
_qstring & append(qchar c)
Append c to the end of the qstring.
Definition pro.h:3493
Vector of bytes (use for dynamic memory)
Definition pro.h:3773
class to contain public info about the merge process
Definition merge.hpp:191
int remote_id() const
Definition merge.hpp:238
void set_dbctx_ids(int local, int remote, int base)
Definition merge.hpp:229
void remove_event_handler(merge_handler_t *handler)
Definition merge.hpp:242
virtual bool map_privrange_id(tid_t *tid, ea_t ea, diff_source_idx_t from, diff_source_idx_t to, bool strict=true)
map IDs of structures, enumerations and their members
merge_handlers_t ev_handlers
event handlers
Definition merge.hpp:220
void operator=(const merge_data_t &)=delete
virtual bool has_existing_node(const char *nodename) const
check that node exists in any of databases
bool setup_blocks(diff_source_idx_t dst_idx, diff_source_idx_t src_idx, const diff_range_t ®ion)
Definition merge.hpp:250
virtual int compare_merging_tifs(const tinfo_t &tif1, diff_source_idx_t diffidx1, const tinfo_t &tif2, diff_source_idx_t diffidx2) const
compare types from two databases
int base_id() const
Definition merge.hpp:239
merge_data_t(const merge_data_t &)=delete
void add_event_handler(merge_handler_t *handler)
Definition merge.hpp:241
ea_t get_block_head(diff_source_idx_t idx, ea_t item_head)
Definition merge.hpp:244
item_block_locator_t * item_block_locator
Definition merge.hpp:221
int dbctx_ids[3]
local, remote, base ids
Definition merge.hpp:217
class merge_mappers_t & mappers
Definition merge.hpp:215
int nbases
number of database participating in merge process, maybe 2 or 3
Definition merge.hpp:218
int local_id() const
Definition merge.hpp:237
virtual bool map_tinfo(tinfo_t *tif, diff_source_idx_t from, diff_source_idx_t to, bool strict=true)
migrate type, replaces type references into FROM database to references into TO database
merge_handler_t * last_udt_related_merger
Definition merge.hpp:222
Definition of the IDA database node.
Definition netnode.hpp:241
Reimplementation of vector class from STL.
Definition pro.h:2250
bool empty(void) const
Does the qvector have 0 elements?
Definition pro.h:2424
Primary mechanism for managing type information.
Definition typeinf.hpp:3046
3-way diff for anchored info
diff_source_idx_t
standard indexes into dbctx_ids[] and similar arrays
Definition diff3.hpp:125
@ BASE_IDX
Definition diff3.hpp:129
@ LOCAL_IDX
Definition diff3.hpp:127
@ REMOTE_IDX
Definition diff3.hpp:128
unsigned __int64 uint64
Definition llong.hpp:13
std::function< merge_node_helper_creator_t > merge_node_hlpfunc_creator_t
Definition merge.hpp:538
idaman bool ida_export is_diff_merge_mode()
Return TRUE if IDA is running in diff mode (MERGE_POLICY_MDIFF/MERGE_POLICY_VDIFF)
idaman void ida_export destroy_moddata_merge_handlers(int data_id)
nds_flags_t
netnode value modificators (to be used in nodeval_diff_source, see below)
Definition merge.hpp:444
@ NDS_MAP_IDX
apply ea2node() to index (==NETMAP_IDX)
Definition merge.hpp:453
@ NDS_EV_RANGE
enable default handling of mev_modified_ranges, mev_deleting_segm
Definition merge.hpp:451
@ NDS_IS_EA
EA value.
Definition merge.hpp:446
@ NDS_IS_STR
string value
Definition merge.hpp:448
@ NDS_IS_BOOL
boolean value
Definition merge.hpp:445
@ NDS_IS_RELATIVE
value is relative to index (stored as delta)
Definition merge.hpp:447
@ NDS_SUPVAL
stored as netnode supvals (not scalar)
Definition merge.hpp:449
@ NDS_BLOB
stored as netnode blobs
Definition merge.hpp:450
@ NDS_EV_FUNC
enable default handling of mev_added_func/mev_deleting_func
Definition merge.hpp:452
@ NDS_MAP_VAL
apply ea2node() to value.
Definition merge.hpp:454
@ NDS_VAL8
use 8-bit values (==NETMAP_V8)
Definition merge.hpp:460
@ NDS_UI_ND
UI: no need to show diffpos detail pane, MH_UI_NODETAILS, make sense if merge_node_helper_t is used.
Definition merge.hpp:462
@ NDS_INC
stored value is incremented (scalars only)
Definition merge.hpp:461
qvector< merge_handler_t * > merge_handlers_t
Definition merge.hpp:183
idaman void ida_export create_nodeval_merge_handlers2(merge_handlers_t *out, const merge_handler_params_t &mhp, int moddata_id, const char *nodename, const merge_node_info2_t *valdesc, size_t nvals, bool skip_empty_nodes=true)
idaman ssize_t ida_export get_ea_diffpos_name(qstring *out, ea_t ea)
Get nice name for EA diffpos.
DECLARE_TYPE_AS_MOVABLE(merge_node_info_t)
idaman void ida_export create_nodeval_merge_handlers(merge_handlers_t *out, const merge_handler_params_t &mhp, int moddata_id, const char *nodename, const merge_node_info_t *valdesc, size_t nvals, bool skip_empty_nodes=true)
Create a serie of merge handlers for netnode scalar/string values (call create_nodeval_merge_handler(...
idaman merge_handler_t *ida_export create_nodeval_merge_handler2(const merge_handler_params_t &mhp, const char *label, int moddata_id, const char *nodename, uchar tag, uint32 nds_flags, merge_node_helper_t *node_helper=nullptr, bool skip_empty_nodes=true)
enum merge_kind_t ENUM_SIZE(uint32)
Kinds of merge handlers.
Definition merge.hpp:111
idaman merge_handler_t *ida_export create_nodeval_merge_handler(const merge_handler_params_t &mhp, const char *label, int moddata_id, const char *nodename, uchar tag, uint32 nds_flags, merge_node_hlpfunc_creator_t nhc=nullptr, bool skip_empty_nodes=true)
Create a merge handler for netnode scalar/string values.
merge_node_helper_t * merge_node_helper_creator_t(merge_data_t &md, int dbctx_id)
Definition merge.hpp:537
Definitions of various information kept in netnodes.
nodeidx64_t nodeidx_t
Definition netnode.hpp:114
unsigned int uint32
unsigned 32 bit value
Definition pro.h:348
uint64 ea_t
Definition pro.h:421
unsigned char uchar
unsigned 8 bit value
Definition pro.h:337
qvector< ea_t > eavec_t
vector of addresses
Definition pro.h:2764
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:381
ea_t tid_t
type id (for enums, structs, etc)
Definition pro.h:5010
_qstring< char > qstring
regular string
Definition pro.h:3694
qvector< qstring > qstrvec_t
vector of strings
Definition pro.h:3697
A range of the difference source.
Definition diff3.hpp:30
access to attribute by structure/offset/width or netnode/index/width
Definition ida.hpp:1461
several items can be grouped into a block.
Definition merge.hpp:199
virtual ea_t get_block_head(merge_data_t &md, diff_source_idx_t idx, ea_t item_head)=0
get block address (address of first item in the block) by address of item this function returns item ...
virtual ~item_block_locator_t()
Definition merge.hpp:212
virtual bool setup_blocks(merge_data_t &md, diff_source_idx_t from, diff_source_idx_t to, const diff_range_t ®ion)=0
setup block-specific info before region updating, return FALSE if nothing was changed
Merge handler parameters.
Definition merge.hpp:317
merge_kind_t insert_after
desired position inside 'handlers' merge_kind_t
Definition merge.hpp:321
merge_handler_params_t(merge_data_t &_md, const qstring &_label, merge_kind_t _kind, merge_kind_t _insert_after, uint32 _mh_flags)
Definition merge.hpp:349
static bool ui_complex_details(uint32 _mh_flags)
Do not display the diffpos details in the chooser.
Definition merge.hpp:369
static bool ui_dp_shortname(uint32 _mh_flags)
The detail pane shows the diffpos details for the current diffpos range as a tree-like view.
Definition merge.hpp:394
bool ui_indent() const
Definition merge.hpp:407
qstring ui_split_str() const
Definition merge.hpp:384
bool ui_complex_name() const
Definition merge.hpp:380
bool ui_has_details() const
Definition merge.hpp:364
bool ui_linediff() const
Definition merge.hpp:402
bool ui_complex_details() const
Definition merge.hpp:370
static qstring ui_split_str(uint32 _mh_flags)
Definition merge.hpp:383
static bool ui_indent(uint32 _mh_flags)
In the ordinary situation the spaces from the both sides of diffpos name are trimmed.
Definition merge.hpp:406
merge_kind_t kind
merge handler kind merge_kind_t
Definition merge.hpp:320
bool ui_dp_shortname() const
Definition merge.hpp:395
merge_data_t & md
Definition merge.hpp:318
qstring label
Definition merge.hpp:319
static bool ui_linediff(uint32 _mh_flags)
In detail pane IDA shows difference between diffpos details.
Definition merge.hpp:401
uint32 mh_flags
Definition merge.hpp:322
char ui_split_char() const
Definition merge.hpp:382
static bool ui_complex_name(uint32 _mh_flags)
It customary to create long diffpos names having many components that are separated by any 7-bit ASCI...
Definition merge.hpp:379
static char ui_split_char(uint32 _mh_flags)
Definition merge.hpp:381
static bool ui_has_details(uint32 _mh_flags)
Should IDA display the diffpos detail pane?
Definition merge.hpp:363
abstract adapter to provide access to non-standard netnode array entries
Definition merge.hpp:469
virtual void map_string(qstring *, void *, diff_source_idx_t, diff_source_idx_t) const
Definition merge.hpp:500
virtual qstring print_entry_name(uchar, nodeidx_t, void *) const
print the name of the specified entry (to be used in print_diffpos_name)
Definition merge.hpp:474
virtual ~merge_node_helper_t()
Definition merge.hpp:470
virtual void map_scalar(nodeidx_t *, void *, diff_source_idx_t, diff_source_idx_t) const
map scalar/string/buffered value
Definition merge.hpp:493
virtual void get_column_headers(qstrvec_t *, uchar, void *) const
get column headers for chooser (to be used in linear_diff_source_t::get_column_headers)
Definition merge.hpp:483
virtual void map_value(bytevec_t *, void *, diff_source_idx_t, diff_source_idx_t) const
Definition merge.hpp:507
virtual netnode get_netnode() const
return netnode to be used as source.
Definition merge.hpp:490
static void append_eavec(qstring *s, const char *prefix, const eavec_t &eas)
can be used by derived classes
Definition merge.hpp:524
virtual const char * get_logname() const
return name of netnode to be used in logging.
Definition merge.hpp:521
virtual void print_entry_details(qstrvec_t *, uchar, nodeidx_t, void *) const
print the details of the specified entry usually contains multiple lines, one for each attribute or d...
Definition merge.hpp:479
virtual bool is_mergeable(uchar, nodeidx_t) const
filter: check if we should perform merging for given record
Definition merge.hpp:486
virtual void refresh(uchar, void *)
notify helper that some data was changed in the database and internal structures (e....
Definition merge.hpp:517
const char * name
name of the array (label)
Definition merge.hpp:553
uchar tag
a tag used to access values in the netnode
Definition merge.hpp:554
uint32 nds_flags
node value attributes (a combination of nds_flags_t)
Definition merge.hpp:555
merge_node_helper_t * node_helper
merge handler creation helper, foreign owner
Definition merge.hpp:556
field descriptor used to organize merging of a netnode array
Definition merge.hpp:543
merge_node_helper_creator_t * nhc
a factory to create instances of merge_node_helper_t
Definition merge.hpp:547
uchar tag
a tag used to access values in the netnode
Definition merge.hpp:545
uint32 nds_flags
node value attributes (a combination of nds_flags_t)
Definition merge.hpp:546
const char * name
name of the array (label)
Definition merge.hpp:544
virtual void * get_struc_ptr(merge_data_t &, diff_source_idx_t, const idbattr_info_t &)
Definition merge.hpp:437
const char * module_name
will be used as a prefix for field desc
Definition merge.hpp:415
const char * netnode_name
name of netnode with module data attributes
Definition merge.hpp:416
const idbattr_info_t * fields
module data attribute descriptions
Definition merge.hpp:417
virtual void merge_starting(diff_source_idx_t, void *)
Definition merge.hpp:435
virtual bool val2str(qstring *, const idbattr_info_t &, uint64)
Definition merge.hpp:439
uint32 additional_mh_flags
additional merge handler flags
Definition merge.hpp:419
moddata_diff_helper_t(const char *_module_name, const char *_netnode_name, const idbattr_info_t *_fields, size_t _nfields)
Definition merge.hpp:422
virtual bool str2val(uint64 *, const idbattr_info_t &, const char *)
Definition merge.hpp:440
virtual void print_diffpos_details(qstrvec_t *, const idbattr_info_t &)
Definition merge.hpp:438
virtual ~moddata_diff_helper_t()
Definition merge.hpp:433
size_t nfields
number of descriptions
Definition merge.hpp:418
virtual void merge_ending(diff_source_idx_t, void *)
Definition merge.hpp:436