IDA C++ SDK 9.2
Loading...
Searching...
No Matches
bytes.hpp
Go to the documentation of this file.
1/*
2 * Interactive disassembler (IDA).
3 * Copyright (c) 1990-2026 Hex-Rays
4 * ALL RIGHTS RESERVED.
5 *
6 */
7
8#ifndef BYTES_HPP
9#define BYTES_HPP
10
11#include <nalt.hpp>
12#include <lines.hpp>
13#include <range.hpp>
14
15class insn_t;
16
31
32//--------------------------------------------------------------------------
40
41idaman error_t ida_export enable_flags(ea_t start_ea, ea_t end_ea, storage_type_t stt);
42
43
49
50idaman error_t ida_export disable_flags(ea_t start_ea, ea_t end_ea);
51
52
58
59idaman error_t ida_export change_storage_type(ea_t start_ea, ea_t end_ea, storage_type_t stt);
60
61
64
65idaman ea_t ida_export next_addr(ea_t ea);
66
67
70
71idaman ea_t ida_export prev_addr(ea_t ea);
72
73
76
77idaman ea_t ida_export next_chunk(ea_t ea);
78
79
82
83idaman ea_t ida_export prev_chunk(ea_t ea);
84
85
88
89idaman ea_t ida_export chunk_start(ea_t ea);
90
91
94
95idaman asize_t ida_export chunk_size(ea_t ea);
96
97
104
105idaman ea_t ida_export find_free_chunk(ea_t start, asize_t size, asize_t alignment);
106
107
109typedef bool idaapi testf_t(flags64_t flags, void *ud);
110
111
120
121idaman ea_t ida_export next_that(
122 ea_t ea,
123 ea_t maxea,
124 testf_t *testf,
125 void *ud=nullptr);
126
127
129
130inline ea_t idaapi next_unknown(ea_t ea, ea_t maxea)
131{
132 return next_that(ea, maxea, nullptr);
133}
134
135
144
145idaman ea_t ida_export prev_that(
146 ea_t ea,
147 ea_t minea,
148 testf_t *testf,
149 void *ud=nullptr);
150
151
153
154inline ea_t idaapi prev_unknown(ea_t ea, ea_t minea)
155{
156 return prev_that(ea, minea, nullptr);
157}
158
159
164
165idaman ea_t ida_export prev_head(ea_t ea, ea_t minea);
166
167
172
173idaman ea_t ida_export next_head(ea_t ea, ea_t maxea);
174
175
178
179idaman ea_t ida_export prev_not_tail(ea_t ea);
180
181
184
185idaman ea_t ida_export next_not_tail(ea_t ea);
186
187
190
191idaman ea_t ida_export prev_visea(ea_t ea);
192
193
196
197idaman ea_t ida_export next_visea(ea_t ea);
198
199
200
201
205
206inline ea_t idaapi get_item_head(ea_t ea);
207
208
212
213idaman ea_t ida_export get_item_end(ea_t ea);
214
215
223
224idaman ea_t ida_export calc_max_item_end(ea_t ea, int how=15);
228#define ITEM_END_FIXUP 0x0001
229#define ITEM_END_INITED 0x0002
233#define ITEM_END_NAME 0x0004
234#define ITEM_END_XREF 0x0008
235#define ITEM_END_CANCEL 0x0010
238
239
243
244inline asize_t get_item_size(ea_t ea) { return get_item_end(ea) - ea; }
245
246
247
248
250
251idaman bool ida_export is_mapped(ea_t ea);
252
253
255
256idaman flags64_t ida_export get_flags_ex(ea_t ea, int how);
257
258#define GFE_VALUE 0x0001
262#define GFE_IDB_VALUE 0x0002
264#define GFE_32BIT 0x0004
265
274inline flags64_t idaapi get_flags32(ea_t ea) { return get_flags_ex(ea, GFE_32BIT); }
275
282inline flags64_t idaapi get_flags(ea_t ea) { return get_flags_ex(ea, 0); }
283
289inline flags64_t idaapi get_full_flags(ea_t ea) { return get_flags_ex(ea, GFE_VALUE); }
290
291
302
303idaman flags64_t ida_export get_item_flag(ea_t from, int n, ea_t ea, bool appzero);
304
305
306//--------------------------------------------------------------------------
316idaman bool ida_export get_item_refinfo(refinfo_t *ri, ea_t ea, int n);
317
318//--------------------------------------------------------------------------
324#define MS_VAL 0x000000FF
325#define FF_IVL 0x00000100
327
329
330inline THREAD_SAFE constexpr bool idaapi has_value(flags64_t F) { return (F & FF_IVL) != 0; }
331
332
335
336idaman void ida_export del_value(ea_t ea);
337
338
340
341idaman bool ida_export is_loaded(ea_t ea);
342
343
348
349idaman int ida_export nbits(ea_t ea);
350
351
353
354inline int bytesize(ea_t ea)
355 { return (nbits(ea)+7)/8; }
356
357
360
361idaman uchar ida_export get_byte(ea_t ea);
362
363
368
369idaman uchar ida_export get_db_byte(ea_t ea);
370
371
375
376idaman ushort ida_export get_word(ea_t ea);
377
378
382
383idaman uint32 ida_export get_dword(ea_t ea);
384
385
389
390idaman uint64 ida_export get_qword(ea_t ea);
391
392
396
397idaman uint64 ida_export get_wide_byte(ea_t ea);
398
399
404
405idaman uint64 ida_export get_wide_word(ea_t ea);
406
407
413
414idaman uint64 ida_export get_wide_dword(ea_t ea);
415
416
430
432{
435 int avail_bits = 0;
437 octet_generator_t(ea_t _ea) : ea(_ea) {}
439#ifndef SWIG
441 {
442 COMPARE_FIELDS(ea);
443 if ( avail_bits < r.avail_bits )
444 return 1; // less bits available means that we have advanced more
445 if ( avail_bits > r.avail_bits )
446 return -1; // more bits available means that we have advanced less
447 return 0;
448 }
449#endif
450};
451
452idaman bool ida_export get_octet(uchar *out, octet_generator_t *ogen);
453
454
455
459
460idaman uint32 ida_export get_16bit(ea_t ea);
461
462
468
469idaman uint32 ida_export get_32bit(ea_t ea);
470
471
477
478idaman uint64 ida_export get_64bit(ea_t ea);
479
480
489
490idaman bool ida_export get_data_value(uval_t *v, ea_t ea, asize_t size);
491
492
502
503idaman int ida_export visit_patched_bytes(
504 ea_t ea1,
505 ea_t ea2,
506 int (idaapi *cb)(ea_t ea, qoff64_t fpos, uint64 o, uint64 v, void *ud),
507 void *ud = nullptr);
508
509
512
513idaman uint64 ida_export get_original_byte(ea_t ea);
514
515
519
520idaman uint64 ida_export get_original_word(ea_t ea);
521
522
526
527idaman uint64 ida_export get_original_dword(ea_t ea);
528
529
533
534idaman uint64 ida_export get_original_qword(ea_t ea);
535
536
548
549idaman bool ida_export put_byte(ea_t ea, uint64 x);
550
551
559
560idaman void ida_export put_word(ea_t ea, uint64 x);
561
562
570
571idaman void ida_export put_dword(ea_t ea, uint64 x);
572
573
579
580idaman void ida_export put_qword(ea_t ea, uint64 x);
581
582
591
592idaman bool ida_export patch_byte(ea_t ea, uint64 x);
593
594
604
605idaman bool ida_export patch_word(ea_t ea, uint64 x);
606
607
617
618idaman bool ida_export patch_dword(ea_t ea, uint64 x);
619
620
630
631idaman bool ida_export patch_qword(ea_t ea, uint64 x);
632
633
636
637idaman bool ida_export revert_byte(ea_t ea);
638
639
644
645idaman void ida_export add_byte(ea_t ea, uint32 value);
646
647
653
654idaman void ida_export add_word(ea_t ea, uint64 value);
655
656
663
664idaman void ida_export add_dword(ea_t ea, uint64 value);
665
666
672
673idaman void ida_export add_qword(ea_t ea, uint64 value);
674
675
683
684idaman bool ida_export get_zero_ranges(rangeset_t *zranges, const range_t *range);
685
686
697
698idaman ssize_t ida_export get_bytes(
699 void *buf,
701 ea_t ea,
702 int gmb_flags=0,
703 void *mask=nullptr);
704
707#define GMB_READALL 0x01
709#define GMB_WAITBOX 0x02
711
712
719
720idaman void ida_export put_bytes(ea_t ea, const void *buf, size_t size);
721
722
730
731idaman void ida_export patch_bytes(ea_t ea, const void *buf, size_t size);
732
733//-------------------------------------------------------------------------
748
751#define MS_CLS 0x00000600
752#define FF_CODE 0x00000600
753#define FF_DATA 0x00000400
754#define FF_TAIL 0x00000200
755#define FF_UNK 0x00000000
757
760
762
763inline THREAD_SAFE constexpr bool idaapi is_code(flags64_t F) { return (F & MS_CLS) == FF_CODE; }
764inline bool idaapi is_code_ea(ea_t ea) { return is_code(get_flags32(ea)); }
765inline THREAD_SAFE constexpr bool idaapi f_is_code(flags64_t F, void *) { return is_code(F); }
766
767
769
770inline THREAD_SAFE constexpr bool idaapi is_data(flags64_t F) { return (F & MS_CLS) == FF_DATA; }
771inline bool idaapi is_data_ea(ea_t ea) { return is_data(get_flags32(ea)); }
772inline THREAD_SAFE constexpr bool idaapi f_is_data(flags64_t F, void *) { return is_data(F); }
773
774
776
777inline THREAD_SAFE constexpr bool idaapi is_tail(flags64_t F) { return (F & MS_CLS) == FF_TAIL; }
778inline bool idaapi is_tail_ea(ea_t ea) { return is_tail(get_flags32(ea)); }
779inline THREAD_SAFE constexpr bool idaapi f_is_tail(flags64_t F, void *) { return is_tail(F); }
780inline THREAD_SAFE constexpr bool idaapi is_not_tail(flags64_t F) { return !is_tail(F); }
781inline THREAD_SAFE constexpr bool idaapi f_is_not_tail(flags64_t F, void *) { return is_not_tail(F); }
782
783
785
786inline THREAD_SAFE constexpr bool idaapi is_unknown(flags64_t F) { return (F & MS_CLS) == FF_UNK; }
787inline bool idaapi is_unknown_ea(ea_t ea) { return is_unknown(get_flags32(ea)); }
788
789
791
792inline THREAD_SAFE constexpr bool idaapi is_head(flags64_t F) { return (F & FF_DATA) != 0; }
793inline bool idaapi is_head_ea(ea_t ea) { return is_head(get_flags32(ea)); }
794inline THREAD_SAFE constexpr bool idaapi f_is_head(flags64_t F, void *) { return is_head(F); }
795
798
800typedef bool idaapi may_destroy_cb_t(ea_t);
801
812
813idaman bool ida_export del_items(
814 ea_t ea,
815 int flags=0,
816 asize_t nbytes=1,
817 may_destroy_cb_t *may_destroy=nullptr);
818
822#define DELIT_SIMPLE 0x0000
823#define DELIT_EXPAND 0x0001
828#define DELIT_DELNAMES 0x0002
831#define DELIT_NOTRUNC 0x0004
833#define DELIT_NOUNAME 0x0008
836#define DELIT_NOCMT 0x0010
839#define DELIT_KEEPFUNC 0x0020
842
843
844//-------------------------------------------------------------------------
845// Manual instructions (they are used to completely override an automatically
846// generated instruction by a user specified string).
847
850
851idaman bool ida_export is_manual_insn(ea_t ea); // Is the instruction overridden?
852
853
858
859idaman ssize_t ida_export get_manual_insn(qstring *buf, ea_t ea);
860
861
866
867idaman void ida_export set_manual_insn(ea_t ea, const char *manual_insn); // Set user-specified string
868
869
870//-------------------------------------------------------------------------
878#define MS_COMM 0x000FF800
879#define FF_COMM 0x00000800
880#define FF_REF 0x00001000
881#define FF_LINE 0x00002000
882#define FF_NAME 0x00004000
883#define FF_LABL 0x00008000
884#define FF_FLOW 0x00010000
885#define FF_SIGN 0x00020000
886#define FF_BNOT 0x00040000
887#define FF_UNUSED 0x00080000
889
893
895
896inline THREAD_SAFE constexpr bool idaapi is_flow(flags64_t F) { return (F & FF_FLOW) != 0; }
897inline bool idaapi is_flow_ea(ea_t ea) { return is_flow(get_flags32(ea)); }
898
899
901
902inline THREAD_SAFE constexpr bool idaapi has_extra_cmts(flags64_t F) { return (F & FF_LINE) != 0; }
903inline THREAD_SAFE constexpr bool idaapi f_has_extra_cmts(flags64_t f, void *) { return has_extra_cmts(f); }
904
906
907inline THREAD_SAFE constexpr bool idaapi has_cmt(flags64_t F) { return (F & FF_COMM) != 0; }
908inline THREAD_SAFE constexpr bool idaapi f_has_cmt(flags64_t f, void *) { return has_cmt(f); }
909
911
912inline THREAD_SAFE constexpr bool idaapi has_xref(flags64_t F) { return (F & FF_REF) != 0; }
913inline THREAD_SAFE constexpr bool idaapi f_has_xref(flags64_t f, void *) { return has_xref(f); }
914
915
917
918inline THREAD_SAFE constexpr bool idaapi has_name(flags64_t F) { return (F & FF_NAME) != 0; }
919inline THREAD_SAFE constexpr bool idaapi f_has_name(flags64_t f, void *) { return has_name(f); }
920
921
922
923#define FF_ANYNAME (FF_LABL|FF_NAME)
924
926
927inline THREAD_SAFE constexpr bool idaapi has_dummy_name(flags64_t F) { return (F & FF_ANYNAME) == FF_LABL; }
928inline THREAD_SAFE constexpr bool idaapi f_has_dummy_name(flags64_t f, void *) { return has_dummy_name(f); }
929
930
932
933inline THREAD_SAFE constexpr bool idaapi has_auto_name(flags64_t F) { return (F & FF_ANYNAME) == FF_ANYNAME; }
934
935
937
938inline THREAD_SAFE constexpr bool idaapi has_any_name(flags64_t F) { return (F & FF_ANYNAME) != 0; }
939
940
942
943inline THREAD_SAFE constexpr bool idaapi has_user_name(flags64_t F) { return (F & FF_ANYNAME) == FF_NAME; }
944inline THREAD_SAFE constexpr bool idaapi f_has_user_name(flags64_t F, void *) { return has_user_name(F); }
945
946// signness deals with the form of operands of the current instruction/data.
947// inverted sign means the following:
948// if the bit is clear |then when the bit is set
949// and the output is |the output should be:
950// ------------ |----------
951// unsigned |signed
952// signed |unsigned
953//
954
957
958idaman bool ida_export is_invsign(ea_t ea, flags64_t F, int n);
959
960
963
964idaman bool ida_export toggle_sign(ea_t ea, int n);
965
966
970
971idaman bool ida_export is_bnot(ea_t ea, flags64_t F, int n);
972idaman bool ida_export toggle_bnot(ea_t ea, int n);
973
974
983
984idaman bool ida_export is_lzero(ea_t ea, int n);
985
993
994idaman bool ida_export set_lzero(ea_t ea, int n);
995
1003
1004idaman bool ida_export clr_lzero(ea_t ea, int n);
1005
1010
1011inline bool idaapi toggle_lzero(ea_t ea, int n)
1012{
1013 return (is_lzero(ea, n) ? clr_lzero : set_lzero)(ea, n);
1014}
1015
1016
1018
1019
1021
1022idaman bool ida_export leading_zero_important(ea_t ea, int n);
1023
1024//-------------------------------------------------------------------------
1034
1035#define MS_N_TYPE 0xFLLU
1036#define FF_N_VOID 0x0
1037#define FF_N_NUMH 0x1
1038#define FF_N_NUMD 0x2
1039#define FF_N_CHAR 0x3
1040#define FF_N_SEG 0x4
1041#define FF_N_OFF 0x5
1042#define FF_N_NUMB 0x6
1043#define FF_N_NUMO 0x7
1044#define FF_N_ENUM 0x8
1045#define FF_N_FOP 0x9
1046#define FF_N_STRO 0xA
1047#define FF_N_STK 0xB
1048#define FF_N_FLT 0xC
1049#define FF_N_CUST 0xD
1050
1058
1059inline constexpr int get_operand_type_shift(uint32 n)
1060{
1061 return 20 + (4 * (n + (n > 1)));
1062}
1063
1070
1071inline constexpr flags64_t get_operand_flag(uint8 typebits, int n)
1072{
1073 return n >= 0 && n < UA_MAXOP ? flags64_t(typebits) << get_operand_type_shift(n) : 0;
1074}
1075
1083
1084inline constexpr uint8 get_optype_flags(flags64_t F, int n)
1085{
1086 return n >= 0 && n < UA_MAXOP
1087 ? uint8((F >> get_operand_type_shift(n)) & MS_N_TYPE)
1088 : 0;
1089}
1090
1096
1097inline constexpr void set_operand_flag(flags64_t &F, uint8 typebits, int n)
1098{
1099 if ( n >= 0 && n < UA_MAXOP )
1100 {
1101 F &= ~get_operand_flag(MS_N_TYPE, n);
1102 F |= get_operand_flag(typebits, n);
1103 }
1104}
1105
1113
1114inline constexpr bool is_flag_for_operand(flags64_t F, uint8 typebits, int n)
1115{
1116 return n < UA_MAXOP && (F & get_operand_flag(MS_N_TYPE, n)) == get_operand_flag(typebits, n);
1117}
1118
1121
1123
1124inline THREAD_SAFE constexpr bool idaapi is_defarg0(flags64_t F) { return !is_flag_for_operand(F, FF_N_VOID, 0); }
1125
1126
1128
1129inline THREAD_SAFE constexpr bool idaapi is_defarg1(flags64_t F) { return !is_flag_for_operand(F, FF_N_VOID, 1); }
1130
1131
1133
1134inline THREAD_SAFE constexpr bool idaapi is_off0(flags64_t F) { return is_flag_for_operand(F, FF_N_OFF, 0); }
1135
1136
1138
1139inline THREAD_SAFE constexpr bool idaapi is_off1(flags64_t F) { return is_flag_for_operand(F, FF_N_OFF, 1); }
1140
1141
1143
1144inline THREAD_SAFE constexpr bool idaapi is_char0(flags64_t F) { return is_flag_for_operand(F, FF_N_CHAR, 0); }
1145
1146
1148
1149inline THREAD_SAFE constexpr bool idaapi is_char1(flags64_t F) { return is_flag_for_operand(F, FF_N_CHAR, 1); }
1150
1151
1153
1154inline THREAD_SAFE constexpr bool idaapi is_seg0(flags64_t F) { return is_flag_for_operand(F, FF_N_SEG, 0); }
1155
1156
1158
1159inline THREAD_SAFE constexpr bool idaapi is_seg1(flags64_t F) { return is_flag_for_operand(F, FF_N_SEG, 1); }
1160
1161
1163
1164inline THREAD_SAFE constexpr bool idaapi is_enum0(flags64_t F) { return is_flag_for_operand(F, FF_N_ENUM, 0); }
1165
1166
1168
1169inline THREAD_SAFE constexpr bool idaapi is_enum1(flags64_t F) { return is_flag_for_operand(F, FF_N_ENUM, 1); }
1170
1171
1173
1174inline THREAD_SAFE constexpr bool idaapi is_stroff0(flags64_t F) { return is_flag_for_operand(F, FF_N_STRO, 0); }
1175
1176
1178
1179inline THREAD_SAFE constexpr bool idaapi is_stroff1(flags64_t F) { return is_flag_for_operand(F, FF_N_STRO, 1); }
1180
1181
1183
1184inline THREAD_SAFE constexpr bool idaapi is_stkvar0(flags64_t F) { return is_flag_for_operand(F, FF_N_STK, 0); }
1185
1186
1188
1189inline THREAD_SAFE constexpr bool idaapi is_stkvar1(flags64_t F) { return is_flag_for_operand(F, FF_N_STK, 1); }
1190
1191
1193
1194inline THREAD_SAFE constexpr bool idaapi is_float0(flags64_t F) { return is_flag_for_operand(F, FF_N_FLT, 0); }
1195
1196
1198
1199inline THREAD_SAFE constexpr bool idaapi is_float1(flags64_t F) { return is_flag_for_operand(F, FF_N_FLT, 1); }
1200
1201
1203
1204inline THREAD_SAFE constexpr bool idaapi is_custfmt0(flags64_t F) { return is_flag_for_operand(F, FF_N_CUST, 0); }
1205
1206
1208
1209inline THREAD_SAFE constexpr bool idaapi is_custfmt1(flags64_t F) { return is_flag_for_operand(F, FF_N_CUST, 1); }
1210
1211
1213
1214idaman bool ida_export is_numop0(flags64_t F);
1215
1216
1218
1219idaman bool ida_export is_numop1(flags64_t F);
1220
1221
1223
1224inline THREAD_SAFE constexpr flags64_t get_optype_flags0(flags64_t F) { return F & (MS_N_TYPE << get_operand_type_shift(0)); }
1225
1226
1228
1229inline THREAD_SAFE constexpr flags64_t get_optype_flags1(flags64_t F) { return F & (MS_N_TYPE << get_operand_type_shift(1)); }
1230
1232
1233//-------------------------------------------------------------------------
1234//
1235// The following 2 masks are used with operand numbers
1236//
1237#define OPND_OUTER 0x80
1239#define OPND_MASK 0x0F
1240#define OPND_ALL OPND_MASK
1241
1249idaman bool ida_export is_defarg(flags64_t F, int n);
1250idaman bool ida_export is_off(flags64_t F, int n);
1251idaman bool ida_export is_char(flags64_t F, int n);
1252idaman bool ida_export is_seg(flags64_t F, int n);
1253idaman bool ida_export is_enum(flags64_t F, int n);
1254idaman bool ida_export is_manual(flags64_t F, int n);
1255idaman bool ida_export is_stroff(flags64_t F, int n);
1256idaman bool ida_export is_stkvar(flags64_t F, int n);
1257idaman bool ida_export is_fltnum(flags64_t F, int n);
1258idaman bool ida_export is_custfmt(flags64_t F, int n);
1259idaman bool ida_export is_numop(flags64_t F, int n);
1260idaman bool ida_export is_suspop(ea_t ea, flags64_t F, int n);
1262
1263
1266
1267idaman bool ida_export op_adds_xrefs(flags64_t F, int n);
1268
1269
1277
1278idaman bool ida_export set_op_type(ea_t ea, flags64_t type, int n);
1279
1280
1286
1287idaman bool ida_export op_seg(ea_t ea, int n);
1288
1289
1299
1300idaman bool ida_export op_enum(ea_t ea, int n, tid_t id, uchar serial=0);
1301
1302
1309
1310idaman tid_t ida_export get_enum_id(uchar *serial, ea_t ea, int n);
1311
1312
1332
1333idaman bool ida_export op_stroff(
1334 const insn_t &insn,
1335 int n,
1336 const tid_t *path,
1337 int path_len,
1338 adiff_t delta);
1339
1340
1354
1355idaman bool ida_export op_based_stroff(
1356 const insn_t &insn,
1357 int n,
1358 adiff_t opval,
1359 ea_t base);
1360
1361
1368
1369idaman int ida_export get_stroff_path(tid_t *path, adiff_t *delta, ea_t ea, int n);
1370
1378
1379idaman bool ida_export op_stkvar(ea_t ea, int n);
1380
1381
1389
1390idaman bool ida_export set_forced_operand(ea_t ea, int n, const char *op);
1391
1392
1398
1399idaman ssize_t ida_export get_forced_operand(qstring *buf, ea_t ea, int n);
1400
1401
1405
1406idaman bool ida_export is_forced_operand(ea_t ea, int n);
1407
1408
1409//-------------------------------------------------------------------------
1410inline constexpr flags64_t idaapi combine_flags(flags64_t F)
1411{
1412 return (F << get_operand_type_shift(0))
1413 | (F << get_operand_type_shift(1))
1414 | (F << get_operand_type_shift(2))
1415 | (F << get_operand_type_shift(3))
1416 | (F << get_operand_type_shift(4))
1417 | (F << get_operand_type_shift(5))
1418 | (F << get_operand_type_shift(6))
1419 | (F << get_operand_type_shift(7));
1420}
1421
1422//-------------------------------------------------------------------------
1427inline constexpr flags64_t idaapi char_flag(void) { return combine_flags(FF_N_CHAR); }
1428inline constexpr flags64_t idaapi off_flag(void) { return combine_flags(FF_N_OFF); }
1429inline constexpr flags64_t idaapi enum_flag(void) { return combine_flags(FF_N_ENUM); }
1430inline constexpr flags64_t idaapi stroff_flag(void) { return combine_flags(FF_N_STRO); }
1431inline constexpr flags64_t idaapi stkvar_flag(void) { return combine_flags(FF_N_STK); }
1432inline constexpr flags64_t idaapi flt_flag(void) { return combine_flags(FF_N_FLT); }
1433inline constexpr flags64_t idaapi custfmt_flag(void) { return combine_flags(FF_N_CUST); }
1434inline constexpr flags64_t idaapi seg_flag(void) { return combine_flags(FF_N_SEG); }
1435
1436idaman flags64_t ida_export num_flag(void);
1438inline constexpr flags64_t idaapi hex_flag(void) { return combine_flags(FF_N_NUMH); }
1439inline constexpr flags64_t idaapi dec_flag(void) { return combine_flags(FF_N_NUMD); }
1440inline constexpr flags64_t idaapi oct_flag(void) { return combine_flags(FF_N_NUMO); }
1441inline constexpr flags64_t idaapi bin_flag(void) { return combine_flags(FF_N_NUMB); }
1443
1455inline bool idaapi op_chr(ea_t ea, int n) { return set_op_type(ea, char_flag(), n); }
1456inline bool idaapi op_num(ea_t ea, int n) { return set_op_type(ea, num_flag(), n); }
1457inline bool idaapi op_hex(ea_t ea, int n) { return set_op_type(ea, hex_flag(), n); }
1458inline bool idaapi op_dec(ea_t ea, int n) { return set_op_type(ea, dec_flag(), n); }
1459inline bool idaapi op_oct(ea_t ea, int n) { return set_op_type(ea, oct_flag(), n); }
1460inline bool idaapi op_bin(ea_t ea, int n) { return set_op_type(ea, bin_flag(), n); }
1461inline bool idaapi op_flt(ea_t ea, int n) { return set_op_type(ea, flt_flag(), n); }
1463
1465
1466idaman bool ida_export op_custfmt(ea_t ea, int n, int fid);
1467
1468
1474
1475idaman bool ida_export clr_op_type(ea_t ea, int n);
1476
1477
1480
1481idaman int ida_export get_default_radix(void);
1482
1483
1489
1490idaman int ida_export get_radix(flags64_t F, int n);
1491
1492
1493//-------------------------------------------------------------------------
1496#define DT_TYPE 0xF0000000
1497
1498#define FF_BYTE 0x00000000
1499#define FF_WORD 0x10000000
1500#define FF_DWORD 0x20000000
1501#define FF_QWORD 0x30000000
1502#define FF_TBYTE 0x40000000
1503#define FF_STRLIT 0x50000000
1504#define FF_STRUCT 0x60000000
1505#define FF_OWORD 0x70000000
1506#define FF_FLOAT 0x80000000
1507#define FF_DOUBLE 0x90000000
1508#define FF_PACKREAL 0xA0000000
1509#define FF_ALIGN 0xB0000000
1510// 0xC0000000 ///< reserved
1511#define FF_CUSTOM 0xD0000000
1512#define FF_YWORD 0xE0000000
1513#define FF_ZWORD 0xF0000000
1515
1518inline constexpr flags64_t idaapi code_flag(void) { return FF_CODE; }
1519inline constexpr flags64_t idaapi byte_flag(void) { return FF_DATA|FF_BYTE; }
1520inline constexpr flags64_t idaapi word_flag(void) { return FF_DATA|FF_WORD; }
1521inline constexpr flags64_t idaapi dword_flag(void) { return FF_DATA|FF_DWORD; }
1522inline constexpr flags64_t idaapi qword_flag(void) { return FF_DATA|FF_QWORD; }
1523inline constexpr flags64_t idaapi oword_flag(void) { return FF_DATA|FF_OWORD; }
1524inline constexpr flags64_t idaapi yword_flag(void) { return FF_DATA|FF_YWORD; }
1525inline constexpr flags64_t idaapi zword_flag(void) { return FF_DATA|FF_ZWORD; }
1526inline constexpr flags64_t idaapi tbyte_flag(void) { return FF_DATA|FF_TBYTE; }
1527inline constexpr flags64_t idaapi strlit_flag(void) { return FF_DATA|FF_STRLIT; }
1528inline constexpr flags64_t idaapi stru_flag(void) { return FF_DATA|FF_STRUCT; }
1529inline constexpr flags64_t idaapi cust_flag(void) { return FF_DATA|FF_CUSTOM; }
1530inline constexpr flags64_t idaapi align_flag(void) { return FF_DATA|FF_ALIGN; }
1531inline constexpr flags64_t idaapi float_flag(void) { return FF_DATA|FF_FLOAT; }
1532inline constexpr flags64_t idaapi double_flag(void) { return FF_DATA|FF_DOUBLE; }
1533inline constexpr flags64_t idaapi packreal_flag(void) { return FF_DATA|FF_PACKREAL; }
1534
1535inline THREAD_SAFE constexpr bool idaapi is_byte(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_BYTE; }
1536inline THREAD_SAFE constexpr bool idaapi is_word(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_WORD; }
1537inline THREAD_SAFE constexpr bool idaapi is_dword(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_DWORD; }
1538inline THREAD_SAFE constexpr bool idaapi is_qword(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_QWORD; }
1539inline THREAD_SAFE constexpr bool idaapi is_oword(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_OWORD; }
1540inline THREAD_SAFE constexpr bool idaapi is_yword(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_YWORD; }
1541inline THREAD_SAFE constexpr bool idaapi is_zword(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_ZWORD; }
1542inline THREAD_SAFE constexpr bool idaapi is_tbyte(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_TBYTE; }
1543inline THREAD_SAFE constexpr bool idaapi is_float(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_FLOAT; }
1544inline THREAD_SAFE constexpr bool idaapi is_double(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_DOUBLE; }
1545inline THREAD_SAFE constexpr bool idaapi is_pack_real(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_PACKREAL; }
1546inline THREAD_SAFE constexpr bool idaapi is_strlit(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_STRLIT; }
1547inline THREAD_SAFE constexpr bool idaapi is_struct(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_STRUCT; }
1548inline THREAD_SAFE constexpr bool idaapi is_align(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_ALIGN; }
1549inline THREAD_SAFE constexpr bool idaapi is_custom(flags64_t F) { return is_data(F) && (F & DT_TYPE) == FF_CUSTOM; }
1550
1551inline bool idaapi is_byte_ea(ea_t ea) { return is_byte(get_flags32(ea)); }
1552inline bool idaapi is_word_ea(ea_t ea) { return is_word(get_flags32(ea)); }
1553inline bool idaapi is_dword_ea(ea_t ea) { return is_dword(get_flags32(ea)); }
1554inline bool idaapi is_qword_ea(ea_t ea) { return is_qword(get_flags32(ea)); }
1555inline bool idaapi is_oword_ea(ea_t ea) { return is_oword(get_flags32(ea)); }
1556inline bool idaapi is_yword_ea(ea_t ea) { return is_yword(get_flags32(ea)); }
1557inline bool idaapi is_zword_ea(ea_t ea) { return is_zword(get_flags32(ea)); }
1558inline bool idaapi is_tbyte_ea(ea_t ea) { return is_tbyte(get_flags32(ea)); }
1559inline bool idaapi is_float_ea(ea_t ea) { return is_float(get_flags32(ea)); }
1560inline bool idaapi is_double_ea(ea_t ea) { return is_double(get_flags32(ea)); }
1561inline bool idaapi is_pack_real_ea(ea_t ea) { return is_pack_real(get_flags32(ea)); }
1562inline bool idaapi is_strlit_ea(ea_t ea) { return is_strlit(get_flags32(ea)); }
1563inline bool idaapi is_struct_ea(ea_t ea) { return is_struct(get_flags32(ea)); }
1564inline bool idaapi is_align_ea(ea_t ea) { return is_align(get_flags32(ea)); }
1565inline bool idaapi is_custom_ea(ea_t ea) { return is_custom(get_flags32(ea)); }
1566
1567inline THREAD_SAFE constexpr bool idaapi f_is_byte(flags64_t F, void *) { return is_byte(F); }
1568inline THREAD_SAFE constexpr bool idaapi f_is_word(flags64_t F, void *) { return is_word(F); }
1569inline THREAD_SAFE constexpr bool idaapi f_is_dword(flags64_t F, void *) { return is_dword(F); }
1570inline THREAD_SAFE constexpr bool idaapi f_is_qword(flags64_t F, void *) { return is_qword(F); }
1571inline THREAD_SAFE constexpr bool idaapi f_is_oword(flags64_t F, void *) { return is_oword(F); }
1572inline THREAD_SAFE constexpr bool idaapi f_is_yword(flags64_t F, void *) { return is_yword(F); }
1573inline THREAD_SAFE constexpr bool idaapi f_is_tbyte(flags64_t F, void *) { return is_tbyte(F); }
1574inline THREAD_SAFE constexpr bool idaapi f_is_float(flags64_t F, void *) { return is_float(F); }
1575inline THREAD_SAFE constexpr bool idaapi f_is_double(flags64_t F, void *) { return is_double(F); }
1576inline THREAD_SAFE constexpr bool idaapi f_is_pack_real(flags64_t F, void *) { return is_pack_real(F); }
1577inline THREAD_SAFE constexpr bool idaapi f_is_strlit(flags64_t F, void *) { return is_strlit(F); }
1578inline THREAD_SAFE constexpr bool idaapi f_is_struct(flags64_t F, void *) { return is_struct(F); }
1579inline THREAD_SAFE constexpr bool idaapi f_is_align(flags64_t F, void *) { return is_align(F); }
1580inline THREAD_SAFE constexpr bool idaapi f_is_custom(flags64_t F, void *) { return is_custom(F); }
1581
1582
1584
1585inline THREAD_SAFE constexpr bool idaapi is_same_data_type(flags64_t F1, flags64_t F2) { return ((F1 ^ F2) & DT_TYPE) == 0; }
1586
1587
1591
1592idaman flags64_t ida_export get_flags_by_size(size_t size);
1594
1595
1602
1613
1614idaman bool ida_export create_data(
1615 ea_t ea,
1616 flags64_t dataflag,
1617 asize_t size,
1618 tid_t tid);
1619
1620
1621inline THREAD_SAFE flags64_t idaapi calc_dflags(flags64_t f, bool force) { return f | (force ? FF_COMM : 0); }
1623inline bool idaapi create_byte(ea_t ea, asize_t length, bool force=false)
1624{
1625 return create_data(ea, calc_dflags(FF_BYTE, force), length, BADNODE);
1626}
1627
1628inline bool idaapi create_word(ea_t ea, asize_t length, bool force=false)
1629{
1630 return create_data(ea, calc_dflags(FF_WORD, force), length, BADNODE);
1631}
1632
1633inline bool idaapi create_dword(ea_t ea, asize_t length, bool force=false)
1634{
1635 return create_data(ea, calc_dflags(FF_DWORD, force), length, BADNODE);
1636}
1637
1638inline bool idaapi create_qword(ea_t ea, asize_t length, bool force=false)
1639{
1640 return create_data(ea, calc_dflags(FF_QWORD, force), length, BADNODE);
1641}
1642
1643inline bool idaapi create_oword(ea_t ea, asize_t length, bool force=false)
1644{
1645 return create_data(ea, calc_dflags(FF_OWORD, force), length, BADNODE);
1646}
1647
1648inline bool idaapi create_yword(ea_t ea, asize_t length, bool force=false)
1649{
1650 return create_data(ea, calc_dflags(FF_YWORD, force), length, BADNODE);
1651}
1652
1653inline bool idaapi create_zword(ea_t ea, asize_t length, bool force=false)
1654{
1655 return create_data(ea, calc_dflags(FF_ZWORD, force), length, BADNODE);
1656}
1657
1658inline bool idaapi create_tbyte(ea_t ea, asize_t length, bool force=false)
1659{
1660 return create_data(ea, calc_dflags(FF_TBYTE, force), length, BADNODE);
1661}
1662
1663inline bool idaapi create_float(ea_t ea, asize_t length, bool force=false)
1664{
1665 return create_data(ea, calc_dflags(FF_FLOAT, force), length, BADNODE);
1666}
1667
1668inline bool idaapi create_double(ea_t ea, asize_t length, bool force=false)
1669{
1670 return create_data(ea, calc_dflags(FF_DOUBLE, force), length, BADNODE);
1671}
1672
1673inline bool idaapi create_packed_real(ea_t ea, asize_t length, bool force=false)
1674{
1675 return create_data(ea, calc_dflags(FF_PACKREAL, force), length, BADNODE);
1676}
1677
1678inline bool idaapi create_struct(ea_t ea, asize_t length, tid_t tid, bool force=false)
1679{
1680 return create_data(ea, calc_dflags(FF_STRUCT, force), length, tid);
1681}
1682
1683inline bool idaapi create_custdata(ea_t ea, asize_t length, int dtid, int fid, bool force=false)
1684{
1685 return create_data(ea, calc_dflags(FF_CUSTOM, force), length, dtid|(fid<<16));
1686}
1687
1688
1696
1697idaman bool ida_export create_align(ea_t ea, asize_t length, int alignment);
1698
1702
1703idaman int ida_export calc_min_align(asize_t length);
1704
1705
1709
1710idaman int ida_export calc_max_align(ea_t endea);
1711
1716
1717idaman int ida_export calc_def_align(ea_t ea, int mina, int maxa);
1718
1719
1721
1722idaman bool ida_export create_16bit_data(ea_t ea, asize_t length);
1723
1724
1726
1727idaman bool ida_export create_32bit_data(ea_t ea, asize_t length);
1728
1729
1731
1733
1737#define ALOPT_IGNHEADS 0x01
1742#define ALOPT_IGNPRINT 0x02
1745#define ALOPT_IGNCLT 0x04
1750#define ALOPT_MAX4K 0x08
1752#define ALOPT_ONLYTERM 0x10
1755#define ALOPT_APPEND 0x20
1757
1759
1770
1771idaman size_t ida_export get_max_strlit_length(
1772 ea_t ea,
1773 int32 strtype,
1774 int options = 0);
1775
1779#define STRCONV_ESCAPE 0x00000001
1780#define STRCONV_REPLCHAR 0x00000002
1781#define STRCONV_INCLLEN 0x00000004
1783
1813
1815 qstring *utf8,
1816 ea_t ea,
1817 size_t len,
1818 int32 type,
1819 size_t *maxcps = nullptr,
1820 int flags = 0);
1821
1822
1831
1832idaman bool ida_export create_strlit(ea_t start, size_t len, int32 strtype);
1833
1834
1835
1836//-------------------------------------------------------------------------
1839#define PSTF_TNORM 0x00
1840#define PSTF_TBRIEF 0x01
1841#define PSTF_TINLIN 0x02
1842#define PSTF_TMASK 0x03
1843#define PSTF_HOTKEY 0x04
1844#define PSTF_ENC 0x08
1845#define PSTF_ONLY_ENC 0x0B
1846#define PSTF_ATTRIB 0x10
1848
1849
1858
1859idaman bool ida_export print_strlit_type(
1860 qstring *out,
1861 int32 strtype,
1862 qstring *out_tooltip = nullptr,
1863 int flags = 0);
1864
1865
1872
1873idaman opinfo_t *ida_export get_opinfo(
1874 opinfo_t *buf,
1875 ea_t ea,
1876 int n,
1877 flags64_t flags);
1878
1879
1892
1893idaman bool ida_export set_opinfo(
1894 ea_t ea,
1895 int n,
1896 flags64_t flag,
1897 const opinfo_t *ti,
1898 bool suppress_events=false);
1899
1900
1914
1915idaman asize_t ida_export get_data_elsize(ea_t ea, flags64_t F, const opinfo_t *ti=nullptr);
1916
1917
1921inline asize_t get_full_data_elsize(ea_t ea, flags64_t F, const opinfo_t *ti=nullptr)
1922{
1923 asize_t nbytes = get_data_elsize(ea, F, ti);
1924 return nbytes * bytesize(ea);
1925}
1926
1927
1940
1941idaman int ida_export is_varsize_item(
1942 ea_t ea,
1943 flags64_t F,
1944 const opinfo_t *ti=nullptr,
1945 asize_t *itemsize=nullptr);
1946
1947
1954
1956 ea_t ea,
1957 const tinfo_t &tif);
1958
1959
1982
1983idaman bool ida_export can_define_item(ea_t ea, asize_t length, flags64_t flags);
1984
1989
1990//-------------------------------------------------------------------------
1993#define MS_CODE 0xF0000000
1994#define FF_FUNC 0x10000000
1995// 0x20000000 // not used
1996#define FF_IMMD 0x40000000
1997#define FF_JUMP 0x80000000
1999
2002
2004
2005inline THREAD_SAFE bool idaapi has_immd(flags64_t F) { return is_code(F) && (F & FF_IMMD) != 0; }
2006
2007
2009
2010inline THREAD_SAFE bool idaapi is_func(flags64_t F) { return is_code(F) && (F & FF_FUNC) != 0; }
2011inline bool idaapi is_func_ea(ea_t ea) { return is_func(get_flags32(ea)); }
2012
2013
2016
2017idaman bool ida_export set_immd(ea_t ea);
2018
2019
2022
2023//-----------------------------------------------------------------------
2024// Custom data type and format definitions
2025//-----------------------------------------------------------------------
2026
2029{
2031 void *ud;
2032 int props;
2033#define DTP_NODUP 0x0001
2034 const char *name;
2035 const char *menu_name;
2037 const char *hotkey;
2039 const char *asm_keyword;
2043
2046 bool is_present_in_menus() const { return menu_name != nullptr && asm_keyword != nullptr; }
2047
2052 bool (idaapi *may_create_at)(
2053 void *ud,
2055 size_t nbytes);
2056
2063 asize_t (idaapi *calc_item_size)(
2064 void *ud,
2065 ea_t ea,
2067
2068#ifndef SWIG
2070#endif
2071};
2072
2075{
2077 void *ud;
2078 int props;
2079 const char *name;
2080 const char *menu_name;
2082 const char *hotkey;
2091
2094 bool is_present_in_menus() const { return menu_name != nullptr; }
2095
2105 bool (idaapi *print)(
2106 void *ud,
2108 const void *value,
2112 int dtid);
2113
2122 bool (idaapi *scan)(
2123 void *ud,
2125 const char *input,
2129
2136 void (idaapi *analyze)(
2137 void *ud,
2140
2141#ifndef SWIG
2143#endif
2144};
2145
2146
2153
2154idaman int ida_export register_custom_data_type(const data_type_t *dtinfo);
2155
2156
2167
2168idaman bool ida_export unregister_custom_data_type(int dtid);
2169
2170
2177
2178idaman int ida_export register_custom_data_format(const data_format_t *dtform);
2179
2180
2186
2187idaman bool ida_export unregister_custom_data_format(int dfid);
2188
2189
2193
2194idaman const data_type_t *ida_export get_custom_data_type(int dtid);
2195
2196
2200
2201idaman const data_format_t *ida_export get_custom_data_format(int dfid);
2202
2203
2214
2215idaman bool ida_export attach_custom_data_format(int dtid, int dfid);
2216
2217
2228
2229idaman bool ida_export detach_custom_data_format(int dtid, int dfid);
2230
2231
2236
2237idaman bool ida_export is_attached_custom_data_format(int dtid, int dfid);
2238
2244
2245idaman int ida_export get_custom_data_types(
2246 intvec_t *out,
2247 asize_t min_size=0,
2248 asize_t max_size=BADADDR);
2249
2250
2255
2256idaman int ida_export get_custom_data_formats(intvec_t *out, int dtid);
2257
2258
2262
2263idaman int ida_export find_custom_data_type(const char *name);
2264
2265
2269
2270idaman int ida_export find_custom_data_format(const char *name);
2271
2272
2273//--------------------------------------------------------------------------
2274// I N D E N T E D C O M M E N T S
2275//--------------------------------------------------------------------------
2276
2284
2285idaman bool ida_export set_cmt(ea_t ea, const char *comm, bool rptble);
2286
2287
2294
2295idaman ssize_t ida_export get_cmt(qstring *buf, ea_t ea, bool rptble);
2296
2297
2305
2306idaman bool ida_export append_cmt(ea_t ea, const char *str, bool rptble);
2307
2308
2309//--------------------------------------------------------------------
2310// P R E D E F I N E D C O M M E N T S
2311//--------------------------------------------------------------------
2312
2317
2319 qstring *buf,
2320 const insn_t &ins);
2321
2322
2323//--------------------------------------------------------------------------
2324// S E A R C H F U N C T I O N S
2325//--------------------------------------------------------------------------
2333
2334idaman ea_t ida_export find_byte(ea_t sEA, asize_t size, uchar value, int bin_search_flags);
2335
2336
2344
2345idaman ea_t ida_export find_byter(ea_t sEA, asize_t size, uchar value, int bin_search_flags);
2346
2347
2348//-------------------------------------------------------------------------
2349struct compiled_binpat_t // compiled binary pattern compiled_binpat_t
2350{
2353 rangevec_t strlits; // range of string literals, in _bytes_ ranges (not CPs)
2355
2357 bool all_bytes_defined() const { return mask.empty(); }
2358 void qclear() { bytes.qclear(); mask.qclear(); strlits.qclear(); encidx = -1; }
2359
2360 bool operator==(const compiled_binpat_t &r) const
2361 {
2362 return bytes == r.bytes
2363 && mask == r.mask
2364 && strlits == r.strlits
2365 && encidx == r.encidx;
2366 }
2367 bool operator!=(const compiled_binpat_t &r) const { return !(*this == r); }
2368};
2371
2372#define PBSENC_DEF1BPU 0
2373#define PBSENC_ALL -1
2374
2415// true otherwise
2416idaman bool ida_export parse_binpat_str(
2418 ea_t ea,
2419 const char *in,
2420 int radix,
2421 int strlits_encoding=PBSENC_DEF1BPU,
2422 qstring *errbuf=nullptr);
2423
2424
2432
2433idaman ea_t ida_export bin_search(
2434 ea_t start_ea,
2435 ea_t end_ea,
2436 const compiled_binpat_vec_t &data,
2437 int flags,
2438 size_t *out_matched_idx=nullptr);
2439
2441 ea_t start_ea,
2442 ea_t end_ea,
2443 const uchar *image,
2444 const uchar *mask,
2445 size_t len,
2446 int flags)
2447{
2449 compiled_binpat_t &bv = bbv.push_back();
2450 bv.bytes.append(image, len);
2451 if ( mask != nullptr )
2452 bv.mask.append(mask, len);
2453 return bin_search(start_ea, end_ea, bbv, flags);
2454}
2455
2460#define BIN_SEARCH_CASE 0x01
2461#define BIN_SEARCH_NOCASE 0x00
2462#define BIN_SEARCH_NOBREAK 0x02
2463#define BIN_SEARCH_INITED 0x04
2464#define BIN_SEARCH_NOSHOW 0x08
2465#define BIN_SEARCH_FORWARD 0x00
2466#define BIN_SEARCH_BACKWARD 0x10
2467#define BIN_SEARCH_BITMASK 0x20
2469
2470
2472
2473inline ea_t idaapi next_inited(ea_t ea, ea_t maxea)
2474{
2475 if ( ea >= maxea )
2476 return BADADDR;
2477 ++ea;
2478 return find_byte(ea, maxea-ea, 0, BIN_SEARCH_INITED);
2479}
2480
2482
2483inline ea_t idaapi prev_inited(ea_t ea, ea_t minea)
2484{
2485 if ( ea <= minea )
2486 return BADADDR;
2487 --ea;
2488 return find_byter(minea, ea-minea, 0, BIN_SEARCH_INITED);
2489}
2490
2505
2506idaman bool ida_export equal_bytes(
2507 ea_t ea,
2508 const uchar *image,
2509 const uchar *mask,
2510 size_t len,
2511 int bin_search_flags);
2512
2514#define SKIP_FF_MASK ((const uchar *)0xFF)
2515
2516// Compare two bytes. This helper function is used for binary search.
2518 uchar c1,
2519 uchar c2,
2520 const uchar *mask,
2521 int i,
2522 int bin_search_flags)
2523{
2524 if ( (bin_search_flags & BIN_SEARCH_CASE) == 0 )
2525 {
2526 c1 = qtoupper(c1);
2527 c2 = qtoupper(c2);
2528 }
2529 if ( mask != nullptr )
2530 {
2531 if ( (bin_search_flags & BIN_SEARCH_BITMASK) != 0 )
2532 return ((c1 ^ c2) & mask[i]) == 0; // are bytes equal with mask applied?
2533 if ( mask == SKIP_FF_MASK )
2534 {
2535 if ( c2 == 0xFF )
2536 return true;
2537 }
2538 else if ( mask[i] == 0 )
2539 {
2540 return true;
2541 }
2542 }
2543 return c1 == c2;
2544}
2545
2546idaman ea_t ida_export find_binary(
2547 ea_t startea,
2548 ea_t endea,
2549 const char *ubinstr,
2550 int radix,
2551 int sflag,
2552 int strlits_encoding=0);
2553
2554//------------------------------------------------------------------------
2555// H I D D E N R A N G E S
2556//------------------------------------------------------------------------
2557
2563
2569
2573{
2574public:
2576 const char *get_description() const { return description_.empty() ? nullptr : description_.c_str(); }
2577 void set_description(const char *v) { description_ = v; updated_ |= HRI_DESCRIPTION; }
2578
2580 const char *get_header() const { return header_.empty() ? nullptr : header_.c_str(); }
2581 void set_header(const char *v) { header_ = v; updated_ |= HRI_HEADER; }
2582
2584 const char *get_footer() const { return footer_.empty() ? nullptr : footer_.c_str(); }
2585 void set_footer(const char *v) { footer_ = v; updated_ |= HRI_FOOTER; }
2586
2588 bool get_visible() const { return visible_; }
2589 void set_visible(bool v) { visible_ = v; updated_ |= HRI_VISIBLE; }
2590
2592 bgcolor_t get_color() const { return color_; }
2593 void set_color(bgcolor_t v) { color_ = v; updated_ |= HRI_COLOR; }
2594
2596 bool is_valid() const { return !empty(); }
2597
2598private:
2599 uint32 updated_ = 0;
2600 qstring description_;
2601 qstring header_;
2602 qstring footer_;
2603 bool visible_ = false;
2604 bgcolor_t color_ = DEFCOLOR;
2605
2606 friend struct kdata_t;
2607
2611 enum
2612 {
2613 HRI_DESCRIPTION = 0x01,
2614 HRI_HEADER = 0x02,
2615 HRI_FOOTER = 0x04,
2616 HRI_VISIBLE = 0x08,
2617 HRI_COLOR = 0x10,
2618 HRI_ALL = 0x1F,
2619 };
2621};
2622
2624
2625
2630
2631idaman bool ida_export get_hidden_range_info(hidden_range_info_t *hri, ea_t ea);
2632
2633
2638
2639idaman bool ida_export get_hidden_range_info_by_num(hidden_range_info_t *hri, int n);
2640
2641
2647
2648idaman bool ida_export update_hidden_range_info(const hidden_range_info_t *hri);
2649
2650
2653
2654idaman ea_t ida_export get_first_hidden_range_ea(void);
2655
2656
2659
2660idaman ea_t ida_export get_last_hidden_range_ea(void);
2661
2662
2666
2667idaman ea_t ida_export get_next_hidden_range_ea(ea_t ea);
2668
2669
2673
2674idaman ea_t ida_export get_prev_hidden_range_ea(ea_t ea);
2675
2676
2684
2685idaman bool ida_export add_hidden_range(
2686 ea_t ea1,
2687 ea_t ea2,
2688 const char *description,
2689 const char *header,
2690 const char *footer,
2691 bgcolor_t color=DEFCOLOR);
2692
2693
2695
2696idaman int ida_export get_hidden_range_qty(void);
2697
2698
2702
2703idaman int ida_export get_hidden_range_num(ea_t ea);
2704
2705
2709
2710idaman bool ida_export del_hidden_range(ea_t ea);
2711
2712
2713
2717
2719{
2721 char *header;
2722 char *footer;
2723 bool visible;
2725};
2726
2728idaman DEPRECATED bool ida_export update_hidden_range(const hidden_range_t *ha);
2729
2731idaman DEPRECATED hidden_range_t *ida_export get_hidden_range(ea_t ea);
2732
2734idaman DEPRECATED hidden_range_t *ida_export getn_hidden_range(int n);
2735
2737idaman DEPRECATED hidden_range_t *ida_export get_prev_hidden_range(ea_t ea);
2738
2740idaman DEPRECATED hidden_range_t *ida_export get_next_hidden_range(ea_t ea);
2741
2743idaman DEPRECATED hidden_range_t *ida_export get_first_hidden_range(void);
2744
2746idaman DEPRECATED hidden_range_t *ida_export get_last_hidden_range(void);
2747
2748
2750
2751
2752//--------------------------------------------------------------------------
2753#define GET_ITEM_HEAD_BODY \
2754 if ( is_tail(get_flags32(ea)) ) \
2755 ea = prev_not_tail(ea); \
2756 return ea;
2757inline ea_t idaapi get_item_head(ea_t ea) { GET_ITEM_HEAD_BODY }
2758
2759//------------------------------------------------------------------------
2760// M E M O R Y M A P P I N G
2761//------------------------------------------------------------------------
2762
2766
2767
2773
2774idaman bool ida_export add_mapping(ea_t from, ea_t to, asize_t size);
2775
2776
2779
2780idaman void ida_export del_mapping(ea_t ea);
2781
2782
2786
2787idaman ea_t ida_export use_mapping(ea_t ea);
2788
2790
2791idaman size_t ida_export get_mappings_qty(void);
2792
2800idaman bool ida_export get_mapping(
2801 ea_t *from,
2802 ea_t *to,
2803 asize_t *size,
2804 size_t n);
2805
2806
2807// byte array to hex string
2808inline THREAD_SAFE ssize_t get_hex_string(char *buf, size_t bufsize, const uchar *bytes, size_t len)
2809{
2810 const char *const start = buf;
2811 const char *const end = buf + bufsize;
2812 for ( size_t i = 0; i < len; i++ )
2813 buf += ::qsnprintf(buf, end - buf, "%02X", *bytes++);
2814 return buf - start;
2815}
2816
2817
2818#ifndef IDA_KERNEL_PRIVATE_BYTES_ACCESS // undefined bit masks so no one can use them directly
2819#undef MS_VAL
2820#undef FF_IVL
2821#undef MS_CLS
2822#undef FF_CODE
2823#undef FF_DATA
2824#undef FF_TAIL
2825#undef FF_UNK
2826#undef MS_COMM
2827#undef FF_COMM
2828#undef FF_REF
2829#undef FF_LINE
2830#undef FF_NAME
2831#undef FF_LABL
2832#undef FF_ANYNAME
2833#undef FF_FLOW
2834#undef FF_SIGN
2835#undef FF_BNOT
2836#undef DT_TYPE
2837#undef FF_BYTE
2838#undef FF_WORD
2839#undef FF_DWORD
2840#undef FF_QWORD
2841#undef FF_OWORD
2842#undef FF_YWORD
2843#undef FF_ZWORD
2844#undef FF_FLOAT
2845#undef FF_DOUBLE
2846#undef FF_TBYTE
2847#undef FF_PACKREAL
2848#undef FF_STRLIT
2849#undef FF_STRUCT
2850#undef FF_ALIGN
2851#undef FF_CUSTOM
2852#undef MS_CODE
2853#undef FF_FUNC
2854#undef FF_IMMD
2855//#undef FF_JUMP
2856#undef MS_TAIL
2857#undef TL_TSFT
2858#undef TL_TOFF
2859#undef MAX_TOFF
2860#endif // !IDA_KERNEL_PRIVATE_BYTES_ACCESS
2861#endif // BYTES_HPP
idaman bool ida_export is_attached_custom_data_format(int dtid, int dfid)
Is the custom data format attached to the custom data type?
idaman ea_t ida_export prev_head(ea_t ea, ea_t minea)
Get start of previous defined item.
ea_t idaapi get_item_head(ea_t ea)
Get the start address of the item at 'ea'.
Definition bytes.hpp:2757
THREAD_SAFE constexpr bool idaapi has_value(flags64_t F)
Do flags contain byte value?
Definition bytes.hpp:330
idaman uint32 ida_export get_16bit(ea_t ea)
Get 16bits of the program at 'ea'.
idaman asize_t ida_export get_data_elsize(ea_t ea, flags64_t F, const opinfo_t *ti=nullptr)
Get size of data type specified in flags 'F'.
idaman uchar ida_export get_byte(ea_t ea)
Get one byte (8-bit) of the program at 'ea'.
qvector< compiled_binpat_t > compiled_binpat_vec_t
Definition bytes.hpp:2370
idaman uint32 ida_export get_32bit(ea_t ea)
Get not more than 32bits of the program at 'ea'.
idaman bool ida_export is_mapped(ea_t ea)
Is the specified address 'ea' present in the program?
int bytesize(ea_t ea)
Get number of bytes required to store a byte at the given address.
Definition bytes.hpp:354
idaman bool ida_export parse_binpat_str(compiled_binpat_vec_t *out, ea_t ea, const char *in, int radix, int strlits_encoding=PBSENC_DEF1BPU, qstring *errbuf=nullptr)
Convert user-specified binary string to internal representation.
idaman size_t ida_export get_max_strlit_length(ea_t ea, int32 strtype, int options=0)
Determine maximum length of string literal.
idaman uint64 ida_export get_64bit(ea_t ea)
Get not more than 64bits of the program at 'ea'.
idaman void ida_export add_dword(ea_t ea, uint64 value)
Add a value to one dword of the program.
idaman bool ida_export get_octet(uchar *out, octet_generator_t *ogen)
idaman bool ida_export patch_qword(ea_t ea, uint64 x)
Patch a qword of the program.
bool bytes_match_for_bin_search(uchar c1, uchar c2, const uchar *mask, int i, int bin_search_flags)
Definition bytes.hpp:2517
idaman ea_t ida_export next_addr(ea_t ea)
Get next address in the program (i.e.
idaman void ida_export put_qword(ea_t ea, uint64 x)
Set value of one qword (8 bytes) of the program.
flags64_t idaapi get_flags32(ea_t ea)
Get only 32 low bits of flags.
Definition bytes.hpp:274
idaman ushort ida_export get_word(ea_t ea)
Get one word (16-bit) of the program at 'ea'.
idaman ea_t ida_export use_mapping(ea_t ea)
Translate address according to current mappings.
ea_t idaapi prev_unknown(ea_t ea, ea_t minea)
Similar to prev_that(), but will find the previous address that is unexplored.
Definition bytes.hpp:154
idaman ssize_t ida_export get_bytes(void *buf, ssize_t size, ea_t ea, int gmb_flags=0, void *mask=nullptr)
Get the specified number of bytes of the program into the buffer.
idaman bool ida_export detach_custom_data_format(int dtid, int dfid)
Attach the data format to the data type.
idaman ssize_t ida_export get_manual_insn(qstring *buf, ea_t ea)
Retrieve the user-specified string for the manual instruction.
idaman int ida_export find_custom_data_type(const char *name)
Get id of a custom data type.
idaman void ida_export put_word(ea_t ea, uint64 x)
Set value of one word of the program.
idaman uchar ida_export get_db_byte(ea_t ea)
Get one byte (8-bit) of the program at 'ea' from the database.
idaman size_t ida_export get_mappings_qty(void)
Get number of mappings.
idaman bool ida_export get_mapping(ea_t *from, ea_t *to, asize_t *size, size_t n)
Get memory mapping range by its number.
asize_t get_item_size(ea_t ea)
Get size of item (instruction/data) in bytes.
Definition bytes.hpp:244
idaman void ida_export patch_bytes(ea_t ea, const void *buf, size_t size)
Patch the specified number of bytes of the program.
idaman bool ida_export unregister_custom_data_type(int dtid)
Unregister a data type.
idaman opinfo_t *ida_export get_opinfo(opinfo_t *buf, ea_t ea, int n, flags64_t flags)
Get additional information about an operand representation.
idaman bool ida_export get_item_refinfo(refinfo_t *ri, ea_t ea, int n)
Get refinfo of the item at 'ea'.
idaman asize_t ida_export get_possible_item_varsize(ea_t ea, const tinfo_t &tif)
Return the possible size of the item at EA of type TIF if TIF is the variable structure.
idaman bool ida_export patch_dword(ea_t ea, uint64 x)
Patch a dword of the program.
flags64_t idaapi get_full_flags(ea_t ea)
Get full flags value for address 'ea'.
Definition bytes.hpp:289
idaman ea_t ida_export prev_that(ea_t ea, ea_t minea, testf_t *testf, void *ud=nullptr)
Find previous address with a flag satisfying the function 'testf'.
idaman bool ida_export patch_byte(ea_t ea, uint64 x)
Patch a byte of the program.
idaman flags64_t ida_export get_item_flag(ea_t from, int n, ea_t ea, bool appzero)
Get flag of the item at 'ea' even if it is a tail byte of some array or structure.
idaman int ida_export get_custom_data_formats(intvec_t *out, int dtid)
Get list of attached custom data formats for the specified data type.
ea_t idaapi next_unknown(ea_t ea, ea_t maxea)
Similar to next_that(), but will find the next address that is unexplored.
Definition bytes.hpp:130
idaman ea_t ida_export prev_visea(ea_t ea)
Get previous visible address.
idaman ssize_t ida_export get_strlit_contents(qstring *utf8, ea_t ea, size_t len, int32 type, size_t *maxcps=nullptr, int flags=0)
Get contents of string literal, as UTF-8-encoded codepoints.
idaman bool ida_export can_define_item(ea_t ea, asize_t length, flags64_t flags)
Can define item (instruction/data) of the specified 'length', starting at 'ea'?
idaman ea_t ida_export find_byte(ea_t sEA, asize_t size, uchar value, int bin_search_flags)
Find forward a byte with the specified value (only 8-bit value from the database).
idaman ea_t ida_export prev_addr(ea_t ea)
Get previous address in the program.
idaman ea_t ida_export prev_not_tail(ea_t ea)
Get address of previous non-tail byte.
THREAD_SAFE ssize_t get_hex_string(char *buf, size_t bufsize, const uchar *bytes, size_t len)
Definition bytes.hpp:2808
idaman error_t ida_export enable_flags(ea_t start_ea, ea_t end_ea, storage_type_t stt)
Allocate flags for address range.
ea_t idaapi prev_inited(ea_t ea, ea_t minea)
Find the previous initialized address.
Definition bytes.hpp:2483
idaman bool ida_export patch_word(ea_t ea, uint64 x)
Patch a word of the program.
idaman uint64 ida_export get_original_qword(ea_t ea)
Get original qword value (that was before patching) This function DOESN'T work for wide byte processo...
idaman asize_t ida_export chunk_size(ea_t ea)
Get size of the contiguous address block containing 'ea'.
idaman bool ida_export add_mapping(ea_t from, ea_t to, asize_t size)
IDA supports memory mapping.
idaman int ida_export is_varsize_item(ea_t ea, flags64_t F, const opinfo_t *ti=nullptr, asize_t *itemsize=nullptr)
Is the item at 'ea' variable size?
DECLARE_TYPE_AS_MOVABLE(compiled_binpat_t)
idaman bool ida_export equal_bytes(ea_t ea, const uchar *image, const uchar *mask, size_t len, int bin_search_flags)
Compare 'len' bytes of the program starting from 'ea' with 'image'.
idaman bool ida_export del_items(ea_t ea, int flags=0, asize_t nbytes=1, may_destroy_cb_t *may_destroy=nullptr)
Convert item (instruction/data) to unexplored bytes.
idaman uint64 ida_export get_original_byte(ea_t ea)
Get original byte value (that was before patching).
idaman ea_t ida_export bin_search(ea_t start_ea, ea_t end_ea, const compiled_binpat_vec_t &data, int flags, size_t *out_matched_idx=nullptr)
Search for a pattern in the program.
idaman const data_format_t *ida_export get_custom_data_format(int dfid)
Get definition of a registered custom data format.
idaman error_t ida_export disable_flags(ea_t start_ea, ea_t end_ea)
Deallocate flags for address range.
idaman uint64 ida_export get_wide_dword(ea_t ea)
Get two wide words (4 'bytes') of the program at 'ea'.
idaman int ida_export register_custom_data_format(const data_format_t *dtform)
Register a new data format.
idaman bool ida_export get_data_value(uval_t *v, ea_t ea, asize_t size)
Get the value at of the item at 'ea'.
idaman bool ida_export print_strlit_type(qstring *out, int32 strtype, qstring *out_tooltip=nullptr, int flags=0)
Get string type information: the string type name (possibly decorated with hotkey markers),...
idaman bool ida_export is_manual_insn(ea_t ea)
Is the instruction overridden?
idaman uint64 ida_export get_qword(ea_t ea)
Get one qword (64-bit) of the program at 'ea'.
idaman void ida_export add_qword(ea_t ea, uint64 value)
Add a value to one qword of the program.
idaman void ida_export add_word(ea_t ea, uint64 value)
Add a value to one word of the program.
idaman ssize_t ida_export get_cmt(qstring *buf, ea_t ea, bool rptble)
Get an indented comment.
idaman void ida_export put_bytes(ea_t ea, const void *buf, size_t size)
Modify the specified number of bytes of the program.
idaman void ida_export put_dword(ea_t ea, uint64 x)
Set value of one dword of the program.
idaman bool ida_export put_byte(ea_t ea, uint64 x)
Set value of one byte of the program.
idaman ea_t ida_export next_visea(ea_t ea)
Get next visible address.
idaman ea_t ida_export find_binary(ea_t startea, ea_t endea, const char *ubinstr, int radix, int sflag, int strlits_encoding=0)
idaman const data_type_t *ida_export get_custom_data_type(int dtid)
Get definition of a registered custom data type.
idaman int ida_export register_custom_data_type(const data_type_t *dtinfo)
Register a new data type.
idaman ea_t ida_export calc_max_item_end(ea_t ea, int how=15)
Calculate maximal reasonable end address of a new item.
idaman bool ida_export leading_zero_important(ea_t ea, int n)
Check if leading zeros are important.
idaman bool ida_export set_cmt(ea_t ea, const char *comm, bool rptble)
Set an indented comment.
idaman ea_t ida_export chunk_start(ea_t ea)
Get start of the contiguous address block containing 'ea'.
flags64_t idaapi get_flags(ea_t ea)
Get flags value for address 'ea'.
Definition bytes.hpp:282
idaman bool ida_export create_strlit(ea_t start, size_t len, int32 strtype)
Convert to string literal and give a meaningful name.
idaman bool ida_export append_cmt(ea_t ea, const char *str, bool rptble)
Append to an indented comment.
idaman ea_t ida_export get_item_end(ea_t ea)
Get the end address of the item at 'ea'.
idaman bool ida_export get_zero_ranges(rangeset_t *zranges, const range_t *range)
Return set of ranges with zero initialized bytes.
idaman void ida_export add_byte(ea_t ea, uint32 value)
Add a value to one byte of the program.
idaman int ida_export get_custom_data_types(intvec_t *out, asize_t min_size=0, asize_t max_size=BADADDR)
Get list of registered custom data type ids.
ea_t idaapi next_inited(ea_t ea, ea_t maxea)
Find the next initialized address.
Definition bytes.hpp:2473
idaman ea_t ida_export next_chunk(ea_t ea)
Get the first address of next contiguous chunk in the program.
idaman ea_t ida_export next_that(ea_t ea, ea_t maxea, testf_t *testf, void *ud=nullptr)
Find next address with a flag satisfying the function 'testf'.
idaman int ida_export nbits(ea_t ea)
Get number of bits in a byte at the given address.
idaman uint32 ida_export get_dword(ea_t ea)
Get one dword (32-bit) of the program at 'ea'.
idaman bool ida_export unregister_custom_data_format(int dfid)
Unregister a data format.
idaman bool ida_export set_opinfo(ea_t ea, int n, flags64_t flag, const opinfo_t *ti, bool suppress_events=false)
Set additional information about an operand representation.
bool idaapi may_destroy_cb_t(ea_t)
del_items' callback function
Definition bytes.hpp:800
idaman uint64 ida_export get_wide_byte(ea_t ea)
Get one wide byte of the program at 'ea'.
idaman ea_t ida_export next_head(ea_t ea, ea_t maxea)
Get start of next defined item.
bool idaapi testf_t(flags64_t flags, void *ud)
Flag tester - see next_that(), prev_that()
Definition bytes.hpp:109
idaman ea_t ida_export find_free_chunk(ea_t start, asize_t size, asize_t alignment)
Search for a hole in the addressing space of the program.
idaman void ida_export set_manual_insn(ea_t ea, const char *manual_insn)
Set manual instruction string.
idaman void ida_export del_value(ea_t ea)
Delete byte value from flags.
idaman bool ida_export is_loaded(ea_t ea)
Does the specified address have a byte value (is initialized?)
idaman uint64 ida_export get_original_dword(ea_t ea)
Get original dword (that was before patching) This function works for wide byte processors too.
idaman int ida_export find_custom_data_format(const char *name)
Get id of a custom data format.
idaman ea_t ida_export find_byter(ea_t sEA, asize_t size, uchar value, int bin_search_flags)
Find reverse a byte with the specified value (only 8-bit value from the database).
idaman flags64_t ida_export get_flags_ex(ea_t ea, int how)
Get flags for the specified address, extended form.
idaman ea_t ida_export next_not_tail(ea_t ea)
Get address of next non-tail byte.
idaman int ida_export visit_patched_bytes(ea_t ea1, ea_t ea2, int(idaapi *cb)(ea_t ea, qoff64_t fpos, uint64 o, uint64 v, void *ud), void *ud=nullptr)
Visit all the patched bytes one byte at a time.
idaman ssize_t ida_export get_predef_insn_cmt(qstring *buf, const insn_t &ins)
Get predefined comment.
idaman bool ida_export revert_byte(ea_t ea)
Revert patched byte.
asize_t get_full_data_elsize(ea_t ea, flags64_t F, const opinfo_t *ti=nullptr)
Get full size of data type specified in flags 'F'.
Definition bytes.hpp:1921
idaman error_t ida_export change_storage_type(ea_t start_ea, ea_t end_ea, storage_type_t stt)
Change flag storage type for address range.
idaman void ida_export del_mapping(ea_t ea)
Delete memory mapping range.
idaman ea_t ida_export prev_chunk(ea_t ea)
Get the last address of previous contiguous chunk in the program.
idaman uint64 ida_export get_wide_word(ea_t ea)
Get one wide word (2 'byte') of the program at 'ea'.
idaman uint64 ida_export get_original_word(ea_t ea)
Get original word value (that was before patching).
Vector of bytes (use for dynamic memory)
Definition pro.h:3850
bytevec_t & append(const void *buf, size_t sz)
Append bytes to the bytevec.
Definition pro.h:3859
Describes a hidden range.
Definition bytes.hpp:2573
bool get_visible() const
The range visibility state.
Definition bytes.hpp:2588
const char * get_header() const
Header lines to display if the range is expanded.
Definition bytes.hpp:2580
bgcolor_t get_color() const
The range color.
Definition bytes.hpp:2592
void set_visible(bool v)
Definition bytes.hpp:2589
const char * get_footer() const
Footer lines to display if the range is expanded.
Definition bytes.hpp:2584
void set_description(const char *v)
Definition bytes.hpp:2577
void set_header(const char *v)
Definition bytes.hpp:2581
const char * get_description() const
Description to display if the range is collapsed.
Definition bytes.hpp:2576
bool is_valid() const
Is the hidden range info valid?
Definition bytes.hpp:2596
friend struct kdata_t
Definition bytes.hpp:2606
void set_color(bgcolor_t v)
Definition bytes.hpp:2593
void set_footer(const char *v)
Definition bytes.hpp:2585
Reimplementation of vector class from STL.
Definition pro.h:2262
void push_back(T &&x)
Append a new element to the end the qvector with a move semantics.
Definition pro.h:2432
Primary mechanism for managing type information.
Definition typeinf.hpp:3077
THREAD_SAFE bool idaapi is_func(flags64_t F)
Is function start?
Definition bytes.hpp:2010
bool idaapi is_func_ea(ea_t ea)
Definition bytes.hpp:2011
THREAD_SAFE bool idaapi has_immd(flags64_t F)
Has immediate value?
Definition bytes.hpp:2005
idaman bool ida_export set_immd(ea_t ea)
Set 'has immediate operand' flag.
idaman flags64_t ida_export get_flags_by_size(size_t size)
Get flags from size (in bytes).
constexpr flags64_t idaapi align_flag(void)
Get a flags64_t representing an alignment directive.
Definition bytes.hpp:1530
THREAD_SAFE constexpr bool idaapi is_struct(flags64_t F)
FF_STRUCT
Definition bytes.hpp:1547
THREAD_SAFE constexpr bool idaapi is_float(flags64_t F)
FF_FLOAT
Definition bytes.hpp:1543
constexpr flags64_t idaapi word_flag(void)
Get a flags64_t representing a word.
Definition bytes.hpp:1520
THREAD_SAFE constexpr bool idaapi is_custom(flags64_t F)
FF_CUSTOM
Definition bytes.hpp:1549
THREAD_SAFE constexpr bool idaapi f_is_strlit(flags64_t F, void *)
See is_strlit()
Definition bytes.hpp:1577
constexpr flags64_t idaapi cust_flag(void)
Get a flags64_t representing custom type data.
Definition bytes.hpp:1529
THREAD_SAFE constexpr bool idaapi is_oword(flags64_t F)
FF_OWORD
Definition bytes.hpp:1539
bool idaapi is_strlit_ea(ea_t ea)
Definition bytes.hpp:1562
bool idaapi is_double_ea(ea_t ea)
Definition bytes.hpp:1560
bool idaapi is_tbyte_ea(ea_t ea)
Definition bytes.hpp:1558
THREAD_SAFE constexpr bool idaapi is_pack_real(flags64_t F)
FF_PACKREAL
Definition bytes.hpp:1545
THREAD_SAFE constexpr bool idaapi is_yword(flags64_t F)
FF_YWORD
Definition bytes.hpp:1540
THREAD_SAFE constexpr bool idaapi is_double(flags64_t F)
FF_DOUBLE
Definition bytes.hpp:1544
bool idaapi is_yword_ea(ea_t ea)
Definition bytes.hpp:1556
THREAD_SAFE constexpr bool idaapi f_is_qword(flags64_t F, void *)
See is_qword()
Definition bytes.hpp:1570
bool idaapi is_dword_ea(ea_t ea)
Definition bytes.hpp:1553
THREAD_SAFE constexpr bool idaapi is_word(flags64_t F)
FF_WORD
Definition bytes.hpp:1536
constexpr flags64_t idaapi dword_flag(void)
Get a flags64_t representing a double word.
Definition bytes.hpp:1521
THREAD_SAFE constexpr bool idaapi f_is_tbyte(flags64_t F, void *)
See is_tbyte()
Definition bytes.hpp:1573
bool idaapi is_float_ea(ea_t ea)
Definition bytes.hpp:1559
constexpr flags64_t idaapi tbyte_flag(void)
Get a flags64_t representing a tbyte.
Definition bytes.hpp:1526
bool idaapi is_struct_ea(ea_t ea)
Definition bytes.hpp:1563
THREAD_SAFE constexpr bool idaapi is_tbyte(flags64_t F)
FF_TBYTE
Definition bytes.hpp:1542
THREAD_SAFE constexpr bool idaapi f_is_oword(flags64_t F, void *)
See is_oword()
Definition bytes.hpp:1571
bool idaapi is_custom_ea(ea_t ea)
Definition bytes.hpp:1565
constexpr flags64_t idaapi byte_flag(void)
Get a flags64_t representing a byte.
Definition bytes.hpp:1519
THREAD_SAFE constexpr bool idaapi is_zword(flags64_t F)
FF_ZWORD
Definition bytes.hpp:1541
THREAD_SAFE constexpr bool idaapi f_is_double(flags64_t F, void *)
See is_double()
Definition bytes.hpp:1575
THREAD_SAFE constexpr bool idaapi f_is_word(flags64_t F, void *)
See is_word()
Definition bytes.hpp:1568
constexpr flags64_t idaapi qword_flag(void)
Get a flags64_t representing a quad word.
Definition bytes.hpp:1522
bool idaapi is_word_ea(ea_t ea)
Definition bytes.hpp:1552
THREAD_SAFE constexpr bool idaapi is_qword(flags64_t F)
FF_QWORD
Definition bytes.hpp:1538
constexpr flags64_t idaapi packreal_flag(void)
Get a flags64_t representing a packed decimal real.
Definition bytes.hpp:1533
constexpr flags64_t idaapi stru_flag(void)
Get a flags64_t representing a struct.
Definition bytes.hpp:1528
constexpr flags64_t idaapi float_flag(void)
Get a flags64_t representing a float.
Definition bytes.hpp:1531
THREAD_SAFE constexpr bool idaapi f_is_dword(flags64_t F, void *)
See is_dword()
Definition bytes.hpp:1569
THREAD_SAFE constexpr bool idaapi f_is_float(flags64_t F, void *)
See is_float()
Definition bytes.hpp:1574
constexpr flags64_t idaapi yword_flag(void)
Get a flags64_t representing a ymm word.
Definition bytes.hpp:1524
constexpr flags64_t idaapi zword_flag(void)
Get a flags64_t representing a zmm word.
Definition bytes.hpp:1525
bool idaapi is_byte_ea(ea_t ea)
Definition bytes.hpp:1551
THREAD_SAFE constexpr bool idaapi is_strlit(flags64_t F)
FF_STRLIT
Definition bytes.hpp:1546
THREAD_SAFE constexpr bool idaapi f_is_struct(flags64_t F, void *)
See is_struct()
Definition bytes.hpp:1578
THREAD_SAFE constexpr bool idaapi f_is_custom(flags64_t F, void *)
See is_custom()
Definition bytes.hpp:1580
constexpr flags64_t idaapi oword_flag(void)
Get a flags64_t representing a octaword.
Definition bytes.hpp:1523
constexpr flags64_t idaapi code_flag(void)
FF_CODE
Definition bytes.hpp:1518
THREAD_SAFE constexpr bool idaapi is_dword(flags64_t F)
FF_DWORD
Definition bytes.hpp:1537
bool idaapi is_oword_ea(ea_t ea)
Definition bytes.hpp:1555
THREAD_SAFE constexpr bool idaapi is_same_data_type(flags64_t F1, flags64_t F2)
Do the given flags specify the same data type?
Definition bytes.hpp:1585
bool idaapi is_qword_ea(ea_t ea)
Definition bytes.hpp:1554
constexpr flags64_t idaapi double_flag(void)
Get a flags64_t representing a double.
Definition bytes.hpp:1532
THREAD_SAFE constexpr bool idaapi is_align(flags64_t F)
FF_ALIGN
Definition bytes.hpp:1548
THREAD_SAFE constexpr bool idaapi f_is_align(flags64_t F, void *)
See is_align()
Definition bytes.hpp:1579
THREAD_SAFE constexpr bool idaapi f_is_byte(flags64_t F, void *)
See is_byte()
Definition bytes.hpp:1567
bool idaapi is_pack_real_ea(ea_t ea)
Definition bytes.hpp:1561
THREAD_SAFE constexpr bool idaapi f_is_pack_real(flags64_t F, void *)
See is_pack_real()
Definition bytes.hpp:1576
THREAD_SAFE constexpr bool idaapi f_is_yword(flags64_t F, void *)
See is_yword()
Definition bytes.hpp:1572
bool idaapi is_align_ea(ea_t ea)
Definition bytes.hpp:1564
THREAD_SAFE constexpr bool idaapi is_byte(flags64_t F)
FF_BYTE
Definition bytes.hpp:1535
constexpr flags64_t idaapi strlit_flag(void)
Get a flags64_t representing a string literal.
Definition bytes.hpp:1527
bool idaapi is_zword_ea(ea_t ea)
Definition bytes.hpp:1557
bool idaapi create_word(ea_t ea, asize_t length, bool force=false)
Convert to word.
Definition bytes.hpp:1628
idaman bool ida_export create_data(ea_t ea, flags64_t dataflag, asize_t size, tid_t tid)
Convert to data (byte, word, dword, etc).
bool idaapi create_struct(ea_t ea, asize_t length, tid_t tid, bool force=false)
Convert to struct.
Definition bytes.hpp:1678
bool idaapi create_yword(ea_t ea, asize_t length, bool force=false)
Convert to ymm word.
Definition bytes.hpp:1648
idaman int ida_export calc_def_align(ea_t ea, int mina, int maxa)
Calculate the default alignment exponent.
idaman int ida_export calc_min_align(asize_t length)
Calculate the minimal possible alignment exponent.
idaman bool ida_export create_align(ea_t ea, asize_t length, int alignment)
Create an alignment item.
bool idaapi create_qword(ea_t ea, asize_t length, bool force=false)
Convert to quadword.
Definition bytes.hpp:1638
bool idaapi create_double(ea_t ea, asize_t length, bool force=false)
Convert to double.
Definition bytes.hpp:1668
THREAD_SAFE flags64_t idaapi calc_dflags(flags64_t f, bool force)
Definition bytes.hpp:1621
bool idaapi create_byte(ea_t ea, asize_t length, bool force=false)
Convert to byte.
Definition bytes.hpp:1623
bool idaapi create_dword(ea_t ea, asize_t length, bool force=false)
Convert to dword.
Definition bytes.hpp:1633
bool idaapi create_oword(ea_t ea, asize_t length, bool force=false)
Convert to octaword/xmm word.
Definition bytes.hpp:1643
bool idaapi create_float(ea_t ea, asize_t length, bool force=false)
Convert to float.
Definition bytes.hpp:1663
idaman int ida_export calc_max_align(ea_t endea)
Calculate the maximal possible alignment exponent.
bool idaapi create_packed_real(ea_t ea, asize_t length, bool force=false)
Convert to packed decimal real.
Definition bytes.hpp:1673
bool idaapi create_custdata(ea_t ea, asize_t length, int dtid, int fid, bool force=false)
Convert to custom data type.
Definition bytes.hpp:1683
bool idaapi create_zword(ea_t ea, asize_t length, bool force=false)
Convert to zmm word.
Definition bytes.hpp:1653
idaman bool ida_export create_32bit_data(ea_t ea, asize_t length)
Convert to 32-bit quantity (take the byte size into account)
idaman bool ida_export create_16bit_data(ea_t ea, asize_t length)
Convert to 16-bit quantity (take the byte size into account)
bool idaapi create_tbyte(ea_t ea, asize_t length, bool force=false)
Convert to tbyte.
Definition bytes.hpp:1658
idaman bool ida_export op_stroff(const insn_t &insn, int n, const tid_t *path, int path_len, adiff_t delta)
Set operand representation to be 'struct offset'.
idaman int ida_export get_stroff_path(tid_t *path, adiff_t *delta, ea_t ea, int n)
Get struct path of operand.
idaman int ida_export get_radix(flags64_t F, int n)
Get radix of the operand, in: flags.
idaman ssize_t ida_export get_forced_operand(qstring *buf, ea_t ea, int n)
Get forced operand.
idaman bool ida_export op_based_stroff(const insn_t &insn, int n, adiff_t opval, ea_t base)
Set operand representation to be 'struct offset' if the operand likely points to a structure member.
constexpr flags64_t idaapi combine_flags(flags64_t F)
Definition bytes.hpp:1410
idaman bool ida_export set_forced_operand(ea_t ea, int n, const char *op)
Set forced operand.
idaman bool ida_export is_forced_operand(ea_t ea, int n)
Is operand manually defined?
constexpr flags64_t get_operand_flag(uint8 typebits, int n)
Place operand n's type flag in the right nibble of a 64-bit flags set.
Definition bytes.hpp:1071
idaman bool ida_export set_op_type(ea_t ea, flags64_t type, int n)
(internal function) change representation of operand(s).
constexpr uint8 get_optype_flags(flags64_t F, int n)
Extract operand n's type bits from a 64-bit flags set.
Definition bytes.hpp:1084
idaman bool ida_export op_adds_xrefs(flags64_t F, int n)
Should processor module create xrefs from the operand?
constexpr bool is_flag_for_operand(flags64_t F, uint8 typebits, int n)
Check that the 64-bit flags set has the expected type for operand n.
Definition bytes.hpp:1114
constexpr void set_operand_flag(flags64_t &F, uint8 typebits, int n)
Set operand n's type flag in the 64-bit flags set.
Definition bytes.hpp:1097
idaman bool ida_export op_stkvar(ea_t ea, int n)
Set operand representation to be 'stack variable'.
idaman bool ida_export clr_op_type(ea_t ea, int n)
Remove operand representation information.
idaman int ida_export get_default_radix(void)
Get default base of number for the current processor.
idaman bool ida_export op_enum(ea_t ea, int n, tid_t id, uchar serial=0)
Set operand representation to be enum type If applied to unexplored bytes, converts them to 16-/32-bi...
idaman bool ida_export op_seg(ea_t ea, int n)
Set operand representation to be 'segment'.
idaman bool ida_export op_custfmt(ea_t ea, int n, int fid)
Set custom data format for operand (fid-custom data format id)
idaman tid_t ida_export get_enum_id(uchar *serial, ea_t ea, int n)
Get enum id of 'enum' operand.
constexpr int get_operand_type_shift(uint32 n)
Get the shift in flags64_t for the nibble representing operand n's type.
Definition bytes.hpp:1059
THREAD_SAFE constexpr bool idaapi is_custfmt0(flags64_t F)
Does the first operand use a custom data representation?
Definition bytes.hpp:1204
THREAD_SAFE constexpr bool idaapi is_stkvar1(flags64_t F)
Is the second operand a stack variable?
Definition bytes.hpp:1189
THREAD_SAFE constexpr bool idaapi is_custfmt1(flags64_t F)
Does the second operand use a custom data representation?
Definition bytes.hpp:1209
THREAD_SAFE constexpr bool idaapi is_enum1(flags64_t F)
Is the second operand a symbolic constant (enum member)?
Definition bytes.hpp:1169
THREAD_SAFE constexpr bool idaapi is_defarg1(flags64_t F)
Is the second operand defined? Initially operand has no defined representation.
Definition bytes.hpp:1129
idaman bool ida_export is_numop0(flags64_t F)
Is the first operand a number (i.e. binary, octal, decimal or hex?)
THREAD_SAFE constexpr bool idaapi is_off0(flags64_t F)
Is the first operand offset? (example: push offset xxx)
Definition bytes.hpp:1134
THREAD_SAFE constexpr bool idaapi is_stroff1(flags64_t F)
Is the second operand an offset within a struct?
Definition bytes.hpp:1179
THREAD_SAFE constexpr bool idaapi is_float0(flags64_t F)
Is the first operand a floating point number?
Definition bytes.hpp:1194
THREAD_SAFE constexpr bool idaapi is_stroff0(flags64_t F)
Is the first operand an offset within a struct?
Definition bytes.hpp:1174
THREAD_SAFE constexpr flags64_t get_optype_flags1(flags64_t F)
Get flags for second operand.
Definition bytes.hpp:1229
THREAD_SAFE constexpr bool idaapi is_stkvar0(flags64_t F)
Is the first operand a stack variable?
Definition bytes.hpp:1184
idaman bool ida_export is_numop1(flags64_t F)
Is the second operand a number (i.e. binary, octal, decimal or hex?)
THREAD_SAFE constexpr bool idaapi is_defarg0(flags64_t F)
Is the first operand defined? Initially operand has no defined representation.
Definition bytes.hpp:1124
THREAD_SAFE constexpr flags64_t get_optype_flags0(flags64_t F)
Get flags for first operand.
Definition bytes.hpp:1224
THREAD_SAFE constexpr bool idaapi is_float1(flags64_t F)
Is the second operand a floating point number?
Definition bytes.hpp:1199
THREAD_SAFE constexpr bool idaapi is_char1(flags64_t F)
Is the second operand character constant? (example: mov al, 'a')
Definition bytes.hpp:1149
THREAD_SAFE constexpr bool idaapi is_seg1(flags64_t F)
Is the second operand segment selector? (example: mov dx, seg dseg)
Definition bytes.hpp:1159
THREAD_SAFE constexpr bool idaapi is_off1(flags64_t F)
Is the second operand offset? (example: mov ax, offset xxx)
Definition bytes.hpp:1139
THREAD_SAFE constexpr bool idaapi is_seg0(flags64_t F)
Is the first operand segment selector? (example: push seg seg001)
Definition bytes.hpp:1154
THREAD_SAFE constexpr bool idaapi is_enum0(flags64_t F)
Is the first operand a symbolic constant (enum member)?
Definition bytes.hpp:1164
THREAD_SAFE constexpr bool idaapi is_char0(flags64_t F)
Is the first operand character constant? (example: push 'a')
Definition bytes.hpp:1144
idaman bool ida_export is_enum(flags64_t F, int n)
is enum?
idaman bool ida_export is_defarg(flags64_t F, int n)
is defined?
idaman bool ida_export is_stroff(flags64_t F, int n)
is struct offset?
idaman bool ida_export is_seg(flags64_t F, int n)
is segment?
idaman bool ida_export is_manual(flags64_t F, int n)
is forced operand? (use is_forced_operand())
idaman bool ida_export is_off(flags64_t F, int n)
is offset?
idaman bool ida_export is_stkvar(flags64_t F, int n)
is stack variable?
idaman bool ida_export is_numop(flags64_t F, int n)
is number (bin, oct, dec, hex)?
idaman bool ida_export is_suspop(ea_t ea, flags64_t F, int n)
is suspicious operand?
idaman bool ida_export is_char(flags64_t F, int n)
is character constant?
idaman bool ida_export is_fltnum(flags64_t F, int n)
is floating point number?
idaman bool ida_export is_custfmt(flags64_t F, int n)
is custom data format?
constexpr flags64_t idaapi flt_flag(void)
see FF_opbits
Definition bytes.hpp:1432
constexpr flags64_t idaapi enum_flag(void)
see FF_opbits
Definition bytes.hpp:1429
constexpr flags64_t idaapi custfmt_flag(void)
see FF_opbits
Definition bytes.hpp:1433
constexpr flags64_t idaapi seg_flag(void)
see FF_opbits
Definition bytes.hpp:1434
constexpr flags64_t idaapi stroff_flag(void)
see FF_opbits
Definition bytes.hpp:1430
constexpr flags64_t idaapi off_flag(void)
see FF_opbits
Definition bytes.hpp:1428
constexpr flags64_t idaapi hex_flag(void)
Get number flag of the base, regardless of current processor - better to use num_flag()
Definition bytes.hpp:1438
constexpr flags64_t idaapi bin_flag(void)
Get number flag of the base, regardless of current processor - better to use num_flag()
Definition bytes.hpp:1441
idaman flags64_t ida_export num_flag(void)
Get number of default base (bin, oct, dec, hex)
constexpr flags64_t idaapi oct_flag(void)
Get number flag of the base, regardless of current processor - better to use num_flag()
Definition bytes.hpp:1440
constexpr flags64_t idaapi dec_flag(void)
Get number flag of the base, regardless of current processor - better to use num_flag()
Definition bytes.hpp:1439
constexpr flags64_t idaapi char_flag(void)
see FF_opbits
Definition bytes.hpp:1427
constexpr flags64_t idaapi stkvar_flag(void)
see FF_opbits
Definition bytes.hpp:1431
bool idaapi op_oct(ea_t ea, int n)
set op type to oct_flag()
Definition bytes.hpp:1459
bool idaapi op_hex(ea_t ea, int n)
set op type to hex_flag()
Definition bytes.hpp:1457
bool idaapi op_num(ea_t ea, int n)
set op type to num_flag()
Definition bytes.hpp:1456
bool idaapi op_dec(ea_t ea, int n)
set op type to dec_flag()
Definition bytes.hpp:1458
bool idaapi op_flt(ea_t ea, int n)
set op type to flt_flag()
Definition bytes.hpp:1461
bool idaapi op_chr(ea_t ea, int n)
set op type to char_flag()
Definition bytes.hpp:1455
bool idaapi op_bin(ea_t ea, int n)
set op type to bin_flag()
Definition bytes.hpp:1460
THREAD_SAFE constexpr bool idaapi is_tail(flags64_t F)
Does flag denote tail byte?
Definition bytes.hpp:777
THREAD_SAFE constexpr bool idaapi f_is_head(flags64_t F, void *)
Does flag denote start of instruction OR data?
Definition bytes.hpp:794
bool idaapi is_tail_ea(ea_t ea)
Definition bytes.hpp:778
THREAD_SAFE constexpr bool idaapi f_is_tail(flags64_t F, void *)
Does flag denote tail byte?
Definition bytes.hpp:779
THREAD_SAFE constexpr bool idaapi is_head(flags64_t F)
Does flag denote start of instruction OR data?
Definition bytes.hpp:792
THREAD_SAFE constexpr bool idaapi is_not_tail(flags64_t F)
Does flag denote tail byte?
Definition bytes.hpp:780
bool idaapi is_data_ea(ea_t ea)
Definition bytes.hpp:771
bool idaapi is_head_ea(ea_t ea)
Definition bytes.hpp:793
THREAD_SAFE constexpr bool idaapi is_data(flags64_t F)
Does flag denote start of data?
Definition bytes.hpp:770
THREAD_SAFE constexpr bool idaapi f_is_data(flags64_t F, void *)
Does flag denote start of data?
Definition bytes.hpp:772
THREAD_SAFE constexpr bool idaapi f_is_code(flags64_t F, void *)
Does flag denote start of an instruction?
Definition bytes.hpp:765
THREAD_SAFE constexpr bool idaapi is_unknown(flags64_t F)
Does flag denote unexplored byte?
Definition bytes.hpp:786
bool idaapi is_code_ea(ea_t ea)
Definition bytes.hpp:764
THREAD_SAFE constexpr bool idaapi is_code(flags64_t F)
Does flag denote start of an instruction?
Definition bytes.hpp:763
bool idaapi is_unknown_ea(ea_t ea)
Definition bytes.hpp:787
THREAD_SAFE constexpr bool idaapi f_is_not_tail(flags64_t F, void *)
Does flag denote tail byte?
Definition bytes.hpp:781
THREAD_SAFE constexpr bool idaapi has_auto_name(flags64_t F)
Does the current byte have auto-generated (no special prefix) name?
Definition bytes.hpp:933
idaman bool ida_export is_bnot(ea_t ea, flags64_t F, int n)
Should we negate the operand?
idaman bool ida_export is_lzero(ea_t ea, int n)
Display leading zeros?
THREAD_SAFE constexpr bool idaapi has_dummy_name(flags64_t F)
Does the current byte have dummy (auto-generated, with special prefix) name?
Definition bytes.hpp:927
THREAD_SAFE constexpr bool idaapi has_cmt(flags64_t F)
Does the current byte have an indented comment?
Definition bytes.hpp:907
THREAD_SAFE constexpr bool idaapi f_has_xref(flags64_t f, void *)
Does the current byte have cross-references to it?
Definition bytes.hpp:913
idaman bool ida_export toggle_bnot(ea_t ea, int n)
Toggle binary negation of operand. also see is_bnot()
THREAD_SAFE constexpr bool idaapi f_has_cmt(flags64_t f, void *)
Definition bytes.hpp:908
bool idaapi toggle_lzero(ea_t ea, int n)
Toggle lzero bit.
Definition bytes.hpp:1011
THREAD_SAFE constexpr bool idaapi f_has_name(flags64_t f, void *)
Does the current byte have non-trivial (non-dummy) name?
Definition bytes.hpp:919
bool idaapi is_flow_ea(ea_t ea)
Definition bytes.hpp:897
THREAD_SAFE constexpr bool idaapi is_flow(flags64_t F)
Does the previous instruction exist and pass execution flow to the current byte?
Definition bytes.hpp:896
THREAD_SAFE constexpr bool idaapi f_has_extra_cmts(flags64_t f, void *)
Definition bytes.hpp:903
THREAD_SAFE constexpr bool idaapi has_user_name(flags64_t F)
Does the current byte have user-specified name?
Definition bytes.hpp:943
THREAD_SAFE constexpr bool idaapi has_name(flags64_t F)
Does the current byte have non-trivial (non-dummy) name?
Definition bytes.hpp:918
THREAD_SAFE constexpr bool idaapi f_has_dummy_name(flags64_t f, void *)
Does the current byte have dummy (auto-generated, with special prefix) name?
Definition bytes.hpp:928
idaman bool ida_export set_lzero(ea_t ea, int n)
Set toggle lzero bit.
THREAD_SAFE constexpr bool idaapi has_any_name(flags64_t F)
Does the current byte have any name?
Definition bytes.hpp:938
idaman bool ida_export is_invsign(ea_t ea, flags64_t F, int n)
Should the sign of n-th operand be inverted during output?
THREAD_SAFE constexpr bool idaapi f_has_user_name(flags64_t F, void *)
Does the current byte have user-specified name?
Definition bytes.hpp:944
THREAD_SAFE constexpr bool idaapi has_xref(flags64_t F)
Does the current byte have cross-references to it?
Definition bytes.hpp:912
THREAD_SAFE constexpr bool idaapi has_extra_cmts(flags64_t F)
Does the current byte have additional anterior or posterior lines?
Definition bytes.hpp:902
idaman bool ida_export toggle_sign(ea_t ea, int n)
Toggle sign of n-th operand.
idaman bool ida_export clr_lzero(ea_t ea, int n)
Clear toggle lzero bit.
idaman bool ida_export del_hidden_range(ea_t ea)
Delete hidden range.
idaman DEPRECATED hidden_range_t *ida_export get_first_hidden_range(void)
idaman DEPRECATED bool ida_export update_hidden_range(const hidden_range_t *ha)
idaman DEPRECATED hidden_range_t *ida_export get_last_hidden_range(void)
idaman ea_t ida_export get_next_hidden_range_ea(ea_t ea)
Get start address of the next hidden range.
idaman DEPRECATED hidden_range_t *ida_export get_next_hidden_range(ea_t ea)
idaman bool ida_export update_hidden_range_info(const hidden_range_info_t *hri)
Update hidden range information in the database.
idaman ea_t ida_export get_last_hidden_range_ea(void)
Get start address of the last hidden range.
idaman int ida_export get_hidden_range_qty(void)
Get number of hidden ranges.
idaman ea_t ida_export get_first_hidden_range_ea(void)
Get start address of the first hidden range.
idaman int ida_export get_hidden_range_num(ea_t ea)
Get number of a hidden range.
idaman DEPRECATED hidden_range_t *ida_export get_prev_hidden_range(ea_t ea)
idaman DEPRECATED hidden_range_t *ida_export get_hidden_range(ea_t ea)
idaman bool ida_export add_hidden_range(ea_t ea1, ea_t ea2, const char *description, const char *header, const char *footer, bgcolor_t color=DEFCOLOR)
Mark a range of addresses as hidden.
idaman ea_t ida_export get_prev_hidden_range_ea(ea_t ea)
Get start address of the previous hidden range.
idaman DEPRECATED hidden_range_t *ida_export getn_hidden_range(int n)
idaman bool ida_export get_hidden_range_info(hidden_range_info_t *hri, ea_t ea)
Get hidden range information by address.
idaman bool ida_export get_hidden_range_info_by_num(hidden_range_info_t *hri, int n)
Get hidden range information by number.
idaman const char * end
Definition pro.h:1004
idaman size_t n
Definition pro.h:1000
const tinfo_t & type
Definition hexrays.hpp:7698
storage_type_t
Storage types for flag bits.
Definition ida.hpp:100
bool inf_is_wide_high_byte_first(void)
Definition ida.hpp:650
int nbytes
Definition kernwin.hpp:3037
uval_t uval_t
Definition kernwin.hpp:1926
idaman size_t len
Definition kernwin.hpp:1389
asize_t size
Definition kernwin.hpp:6701
size_t max_size
Definition kernwin.hpp:8400
High level functions that deal with the generation of the disassembled text lines.
unsigned __int64 uint64
Definition llong.hpp:13
Definitions of various information kept in netnodes.
unsigned int uint32
unsigned 32 bit value
Definition pro.h:352
qvector< int > intvec_t
vector of integers
Definition pro.h:2839
uint64 asize_t
Definition pro.h:427
uint32 bgcolor_t
background color in RGB
Definition pro.h:5109
int64 adiff_t
Definition pro.h:428
uint64 ea_t
Definition pro.h:425
int int32
signed 32 bit value
Definition pro.h:351
unsigned char uchar
unsigned 8 bit value
Definition pro.h:341
idaman size_t bufsize
Definition pro.h:604
int error_t
Error code (errno)
Definition pro.h:462
INLINE THREAD_SAFE int ida_local qtoupper(char c)
Get uppercase equivalent of given char.
Definition pro.h:956
uint64 flags64_t
64-bit flags for each address
Definition pro.h:5106
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:385
unsigned short ushort
unsigned 16 bit value
Definition pro.h:342
ea_t tid_t
type id (for enums, structs, etc)
Definition pro.h:5107
unsigned char uint8
unsigned 8 bit value
Definition pro.h:348
_qstring< char > qstring
regular string
Definition pro.h:3771
Contains the definition of range_t.
Definition bytes.hpp:2350
rangevec_t strlits
Definition bytes.hpp:2353
bytevec_t mask
Definition bytes.hpp:2352
bytevec_t bytes
Definition bytes.hpp:2351
bool operator==(const compiled_binpat_t &r) const
Definition bytes.hpp:2360
void qclear()
Definition bytes.hpp:2358
bool all_bytes_defined() const
Definition bytes.hpp:2357
compiled_binpat_t()
Definition bytes.hpp:2356
int encidx
Definition bytes.hpp:2354
bool operator!=(const compiled_binpat_t &r) const
Definition bytes.hpp:2367
Information about a data format.
Definition bytes.hpp:2075
int32 text_width
Usual width of the text representation This value is used to calculate the width of the control to di...
Definition bytes.hpp:2088
bool(idaapi *print)(void *ud
Convert to colored string.
DECLARE_COMPARISONS(data_format_t)
bytevec_t const char * input
Definition bytes.hpp:2125
int props
properties (currently 0)
Definition bytes.hpp:2078
asize_t value_size
size of the value in bytes 0 means any size is ok data formats that are registered for standard types...
Definition bytes.hpp:2084
qstring const void asize_t ea_t current_ea
Definition bytes.hpp:2110
int32 cbsize
size of this structure
Definition bytes.hpp:2076
bool is_present_in_menus() const
Should this format be shown in UI menus.
Definition bytes.hpp:2094
qstring const void * value
Definition bytes.hpp:2108
const char * name
Format name, must be unique.
Definition bytes.hpp:2079
qstring const void asize_t ea_t int int dtid
Definition bytes.hpp:2112
bytevec_t const char ea_t int qstring * errstr
Definition bytes.hpp:2128
qstring * out
Definition bytes.hpp:2107
const char * menu_name
Visible format name to use in menus if nullptr, no menu item will be created.
Definition bytes.hpp:2080
bool(idaapi *scan)(void *ud
Convert from uncolored string.
void * ud
user-defined data to be passed to callbacks
Definition bytes.hpp:2077
qstring const void asize_t size
Definition bytes.hpp:2109
void(idaapi *analyze)(void *ud
Analyze custom data format occurrence This callback can be used to create xrefs from the current item...
const char * hotkey
Hotkey for the corresponding menu item if nullptr, no hotkey will be associated with the menu item.
Definition bytes.hpp:2082
qstring const void asize_t ea_t int operand_num
Definition bytes.hpp:2111
Information about a data type.
Definition bytes.hpp:2029
asize_t(idaapi *calc_item_size)(void *ud
This function is used to determine size of the (possible) item at 'ea'.
const char * asm_keyword
keyword to use for this type in the assembly if nullptr, the data type cannot be used in the listing ...
Definition bytes.hpp:2039
ea_t asize_t maxsize
Definition bytes.hpp:2066
int cbsize
size of this structure
Definition bytes.hpp:2030
const char * menu_name
Visible data type name to use in menus if nullptr, no menu item will be created.
Definition bytes.hpp:2035
ea_t ea
Definition bytes.hpp:2054
bool is_present_in_menus() const
Should this type be shown in UI menus.
Definition bytes.hpp:2046
DECLARE_COMPARISONS(data_type_t)
bool(idaapi *may_create_at)(void *ud
May create data?
void * ud
user-defined data to be passed to callbacks
Definition bytes.hpp:2031
int props
properties
Definition bytes.hpp:2032
const char * hotkey
Hotkey for the corresponding menu item if nullptr, no hotkey will be associated with the menu item.
Definition bytes.hpp:2037
ea_t size_t nbytes
Definition bytes.hpp:2055
asize_t value_size
size of the value in bytes
Definition bytes.hpp:2042
const char * name
name of the data type. must be unique
Definition bytes.hpp:2034
Hidden ranges - address ranges which can be replaced by their descriptions.
Definition bytes.hpp:2719
char * footer
footer lines to display if the range is expanded
Definition bytes.hpp:2722
bool visible
the range state
Definition bytes.hpp:2723
bgcolor_t color
range color
Definition bytes.hpp:2724
char * header
header lines to display if the range is expanded
Definition bytes.hpp:2721
char * description
description to display if the range is collapsed
Definition bytes.hpp:2720
Get 8 bits of the program at 'ea'.
Definition bytes.hpp:432
bool high_byte_first
Definition bytes.hpp:436
octet_generator_t(ea_t _ea)
Definition bytes.hpp:437
void invert_byte_order()
Definition bytes.hpp:438
DECLARE_COMPARISONS(octet_generator_t)
Definition bytes.hpp:440
ea_t ea
Definition bytes.hpp:434
uint64 value
Definition bytes.hpp:433
int avail_bits
Definition bytes.hpp:435
Base class for an range.
Definition range.hpp:35
bool empty() const
Is the size of the range_t <= 0?
Definition range.hpp:60
range_t(ea_t ea1=0, ea_t ea2=0)
Definition range.hpp:39
Vector of range_t instances.
Definition range.hpp:93
Information about a reference.
Definition nalt.hpp:1001
Additional information about an operand type.
Definition nalt.hpp:1239