IDA C++ SDK 9.2
Loading...
Searching...
No Matches
segment.hpp
Go to the documentation of this file.
1/*
2 * Interactive disassembler (IDA).
3 * Copyright (c) 1990-2025 Hex-Rays
4 * ALL RIGHTS RESERVED.
5 *
6 */
7
8#ifndef _SEGMENT_HPP
9#define _SEGMENT_HPP
10
11#include <ida.hpp>
12#include <range.hpp> // segments are range of addresses
13 // with characteristics
14
50
53
54
56#define SREG_NUM 16
57
58
59//-------------------------------------------------------------------------
60// D E F I N I T O N O F S E G M E N T S T R U C T U R E
61//-------------------------------------------------------------------------
66
68class segment_t : public range_t
69{
70public:
71/* 8 */ uval_t name;
72/* 12 */ uval_t sclass;
73/* 16 */ uval_t orgbase;
76
77/* 20 */ uchar align;
82#define saAbs 0
83#define saRelByte 1
84#define saRelWord 2
85#define saRelPara 3
86#define saRelPage 4
87#define saRelDble 5
89#define saRel4K 6
91#define saGroup 7
92#define saRel32Bytes 8
93#define saRel64Bytes 9
94#define saRelQword 10
95#define saRel128Bytes 11
96#define saRel512Bytes 12
97#define saRel1024Bytes 13
98#define saRel2048Bytes 14
99#define saRel_MAX_ALIGN_CODE saRel2048Bytes
101
102/* 21 */ uchar comb;
107#define scPriv 0
109#define scGroup 1
110#define scPub 2
112#define scPub2 4
113#define scStack 5
115#define scCommon 6
116#define scPub3 7
117#define sc_MAX_COMB_CODE scPub3
119
120/* 22 */ uchar perm;
125#define SEGPERM_EXEC 1
126#define SEGPERM_WRITE 2
127#define SEGPERM_READ 4
128#define SEGPERM_MAXVAL (SEGPERM_EXEC + SEGPERM_WRITE + SEGPERM_READ)
130
131/* 23 */ uchar bitness;
135#define SEG_MAX_BITNESS_CODE 2
136
138 bool is_16bit(void) const { return bitness == 0; }
140 bool is_32bit(void) const { return bitness == 1; }
142 bool is_64bit(void) const { return bitness == 2; }
144 int abits(void) const { return 1<<(bitness+4); }
146 int abytes(void) const { return abits() / 8; }
147
151
152/* 24 */ ushort flags;
153
156#define SFL_COMORG 0x01
157
161 bool comorg(void) const { return (flags & SFL_COMORG) != 0; }
162 void set_comorg(void) { flags |= SFL_COMORG; }
163 void clr_comorg(void) { flags &= ~SFL_COMORG; }
165
168#define SFL_OBOK 0x02
169
173 bool ob_ok(void) const { return (flags & SFL_OBOK) != 0; }
174 void set_ob_ok(void) { flags |= SFL_OBOK; }
175 void clr_ob_ok(void) { flags &= ~SFL_OBOK; }
177
180#define SFL_HIDDEN 0x04
181
185 bool is_visible_segm(void) const { return (flags & SFL_HIDDEN) == 0; }
186 void set_visible_segm(bool visible) { setflag(flags, SFL_HIDDEN, !visible); }
188
192#define SFL_DEBUG 0x08
193
197 bool is_debugger_segm(void) const { return (flags & SFL_DEBUG) != 0; }
198 // use ::change_segment_status() to change the segment state during debugging
199 void set_debugger_segm(bool debseg) { setflag(flags, SFL_DEBUG, debseg); }
201
204#define SFL_LOADER 0x10
205
209 bool is_loader_segm(void) const { return (flags & SFL_LOADER) != 0; }
210 void set_loader_segm(bool ldrseg) { setflag(flags, SFL_LOADER, ldrseg); }
212
215#define SFL_HIDETYPE 0x20
216
220 bool is_hidden_segtype(void) const { return (flags & SFL_HIDETYPE) != 0; }
221 void set_hidden_segtype(bool hide) { setflag(flags, SFL_HIDETYPE, hide); }
223
226#define SFL_HEADER 0x40
227
231 bool is_header_segm(void) const { return (flags & SFL_HEADER) != 0; }
232 void set_header_segm(bool on) { setflag(flags, SFL_HEADER, on); }
234
239 bool is_ephemeral_segm(void) const
240 { return (flags & (SFL_DEBUG|SFL_LOADER)) == SFL_DEBUG; }
241
242/* 28 */ sel_t sel;
248
249/* 32 */ sel_t defsr[SREG_NUM];
252
253/* 96 */ uchar type;
258
263#define SEG_NORM 0
264#define SEG_XTRN 1
266#define SEG_CODE 2
267#define SEG_DATA 3
268#define SEG_IMP 4
269#define SEG_GRP 6
270#define SEG_NULL 7
271#define SEG_UNDF 8
272#define SEG_BSS 9
273#define SEG_ABSSYM 10
274#define SEG_COMM 11
275#define SEG_IMEM 12
276#define SEG_MAX_SEGTYPE_CODE SEG_IMEM
278
279/* 100 */ bgcolor_t color;
280
285 inline bool update(void);
286
289 : name(0),
290 sclass(0),
291 orgbase(0),
292 align(0),
293 comb(0),
294 perm(0),
295 bitness(0),
296 flags(0),
297 sel(0),
298 type(SEG_NORM),
299 color(DEFCOLOR)
300 {
301 memset(defsr, 0, sizeof(defsr));
302 }
303
304#ifndef SWIG
306#endif
307}; // total 104/192 bytes
308
309#ifdef __EA64__
310CASSERT(sizeof(segment_t) == 192);
311#else
312CASSERT(sizeof(segment_t) == 104);
313#endif
314
316inline bool is_visible_segm(segment_t *s) { return s != nullptr && s->is_visible_segm(); }
319{
320 return (inf_get_cmtflg() & SCF_SHHID_SEGM) != 0 || is_visible_segm(s);
321}
322
323idaman void ida_export set_visible_segm(segment_t *s, bool visible);
324
325
328
329idaman bool ida_export is_spec_segm(uchar seg_type);
330
331
335
336idaman bool ida_export is_spec_ea(ea_t ea);
337
338
342
343idaman void ida_export lock_segm(const segment_t *segm, bool lock);
344
347{
348 const segment_t *segm;
349public:
350 lock_segment(const segment_t *_segm) : segm(_segm)
351 {
352 lock_segm(segm, true);
353 }
355 {
356 lock_segm(segm, false);
357 }
358};
359
361idaman bool ida_export is_segm_locked(const segment_t *segm);
362
364
365//-------------------------------------------------------------------------
366// S E G M E N T S E L E C T O R S
367//
380//-------------------------------------------------------------------------
381
383
384idaman bool ida_export getn_selector(sel_t *sel, ea_t *base, int n);
385
386
388
389idaman size_t ida_export get_selector_qty(void);
390
391
401
402idaman sel_t ida_export setup_selector(ea_t segbase);
403
404
413
414idaman sel_t ida_export allocate_selector(ea_t segbase);
415
416
419
420idaman sel_t ida_export find_free_selector(void);
421
422
434
435idaman int ida_export set_selector(sel_t selector, ea_t paragraph);
436
437
442
443idaman void ida_export del_selector(sel_t selector);
444
445
450
451idaman ea_t ida_export sel2para(sel_t selector);
452
453
458
459inline ea_t idaapi sel2ea(sel_t selector)
460{
461 if ( selector == BADSEL )
462 return BADADDR;
463 return to_ea(sel2para(selector), 0);
464}
465
466
470
471idaman sel_t ida_export find_selector(ea_t base);
472
473
482
483idaman int ida_export enumerate_selectors(int (idaapi *func)(sel_t sel,ea_t para));
484
485
499
501 sel_t selector,
502 ea_t (idaapi *func)(segment_t *s, void *ud),
503 void *ud=nullptr);
504
505
511
512idaman segment_t *ida_export get_segm_by_sel(sel_t selector);
513
515
516//-------------------------------------------------------------------------
517// S E G M E N T M A N I P U L A T I O N F U N C T I O N S
518//-------------------------------------------------------------------------
523
545
546idaman bool ida_export add_segm_ex(
547 segment_t *NONNULL s,
548 const char *name,
549 const char *sclass,
550 int flags);
554#define ADDSEG_NOSREG 0x0001
556#define ADDSEG_OR_DIE 0x0002
557#define ADDSEG_NOTRUNC 0x0004
559#define ADDSEG_QUIET 0x0008
560#define ADDSEG_FILLGAP 0x0010
567#define ADDSEG_SPARSE 0x0020
572#define ADDSEG_NOAA 0x0040
573#define ADDSEG_IDBENC 0x0080
576
577
615
616idaman bool ida_export add_segm(
617 ea_t para,
618 ea_t start,
619 ea_t end,
620 const char *name,
621 const char *sclass,
622 int flags=0);
623
624
630
631idaman bool ida_export del_segm(ea_t ea, int flags);
632
636#define SEGMOD_KILL 0x0001
637#define SEGMOD_KEEP 0x0002
638#define SEGMOD_SILENT 0x0004
639#define SEGMOD_KEEP0 0x0008
640#define SEGMOD_KEEPSEL 0x0010
641#define SEGMOD_NOMOVE 0x0020
643#define SEGMOD_SPARSE 0x0040
646
647
649
650idaman int ida_export get_segm_qty(void);
651
652
656
657idaman segment_t *ida_export getseg(ea_t ea);
658
659
665
666idaman segment_t *ida_export getnseg(int n);
667
668
673idaman int ida_export get_segm_num(ea_t ea);
674
675
677idaman segment_t *ida_export get_next_seg(ea_t ea);
679idaman segment_t *ida_export get_prev_seg(ea_t ea);
680
682idaman segment_t *ida_export get_first_seg(void);
684idaman segment_t *ida_export get_last_seg(void);
685
686
691
692idaman segment_t *ida_export get_segm_by_name(const char *name);
693
694
705
706idaman bool ida_export set_segm_end(ea_t ea, ea_t newend, int flags);
707
708
721
722idaman bool ida_export set_segm_start(ea_t ea, ea_t newstart, int flags);
723
724
749
750idaman bool ida_export move_segm_start(ea_t ea, ea_t newstart, int mode);
751
752
771
772
773
775idaman const char *ida_export move_segm_strerror(move_segm_code_t code);
776
777
787
788idaman move_segm_code_t ida_export move_segm(segment_t *s, ea_t to, int flags=0);
789
793#define MSF_SILENT 0x0001
794#define MSF_NOFIX 0x0002
795#define MSF_LDKEEP 0x0004
796#define MSF_FIXONCE 0x0008
798#define MSF_PRIORITY 0x0020
800#define MSF_NETNODES 0x0080
803
810
811idaman move_segm_code_t ida_export rebase_program(adiff_t delta, int flags);
812
813
820
821idaman int ida_export change_segment_status(segment_t *s, bool is_deb_segm);
822
826#define CSS_OK 0
827#define CSS_NODBG -1
828#define CSS_NORANGE -2
829#define CSS_NOMEM -3
831#define CSS_BREAK -4
833
834
839#define SNAP_ALL_SEG 0
840#define SNAP_LOAD_SEG 1
841#define SNAP_CUR_SEG 2
843
847
848idaman bool ida_export take_memory_snapshot(int type);
849
853
854idaman bool ida_export is_miniidb(void);
855
856
858
859idaman bool ida_export set_segm_base(segment_t *s, ea_t newbase);
860
862
863//-------------------------------------------------------------------------
864// S E G M E N T G R O U P S
865//-------------------------------------------------------------------------
869
870
882
883idaman int ida_export set_group_selector(sel_t grp, sel_t sel);
884
885#define MAX_GROUPS 8
886
887
891
892idaman sel_t ida_export get_group_selector(sel_t grpsel);
893
895
896//-------------------------------------------------------------------------
897// S E G M E N T T R A N S L A T I O N S
937//-------------------------------------------------------------------------
938
944
945idaman bool ida_export add_segment_translation(ea_t segstart, ea_t mappedseg);
946
947#define MAX_SEGM_TRANSLATIONS 64
948
949
956
957idaman bool ida_export set_segment_translations(ea_t segstart, const eavec_t &transmap);
958
959
962
963idaman void ida_export del_segment_translations(ea_t segstart);
964
965
971
972idaman ssize_t ida_export get_segment_translations(eavec_t *transmap, ea_t segstart);
974
975//-------------------------------------------------------------------------
976// S E G M E N T C O M M E N T S
977//
996//-------------------------------------------------------------------------
997
1004
1005idaman ssize_t ida_export get_segment_cmt(qstring *buf, const segment_t *s, bool repeatable);
1006
1007
1016
1017idaman void ida_export set_segment_cmt(const segment_t *s, const char *cmt, bool repeatable);
1018
1019
1023
1024idaman void ida_export std_out_segm_footer(struct outctx_t &ctx, segment_t *seg);
1025
1027
1028//-------------------------------------------------------------------------
1029// S E G M E N T N A M E S
1030//-------------------------------------------------------------------------
1035
1045
1046idaman int ida_export set_segm_name(
1047 segment_t *s,
1048 const char *name,
1049 int flags=0);
1050
1051
1058
1059idaman ssize_t ida_export get_segm_name(qstring *buf, const segment_t *s, int flags=0);
1060
1061
1066
1067inline ssize_t idaapi get_visible_segm_name(qstring *buf, const segment_t *s)
1068{
1069 return get_segm_name(buf, s, 1);
1070}
1071
1072
1081
1083
1085
1086//-------------------------------------------------------------------------
1087// S E G M E N T C L A S S E S A N D T Y P E S
1088//-------------------------------------------------------------------------
1093
1099
1100idaman ssize_t ida_export get_segm_class(qstring *buf, const segment_t *s);
1101
1102
1116
1117idaman int ida_export set_segm_class(segment_t *s, const char *sclass, int flags=0);
1118
1119
1123
1124idaman uchar ida_export segtype(ea_t ea);
1125
1127
1128//-------------------------------------------------------------------------
1129// S E G M E N T A L I G N M E N T A N D C O M B I N A T I O N
1130//-------------------------------------------------------------------------
1134
1137
1138idaman const char *ida_export get_segment_alignment(uchar align);
1139
1140
1143
1144idaman const char *ida_export get_segment_combination(uchar comb);
1145
1147
1148//-------------------------------------------------------------------------
1149// S E G M E N T A D D R E S S I N G
1150//-------------------------------------------------------------------------
1154
1162
1163idaman ea_t ida_export get_segm_para(const segment_t *s);
1164
1165
1173
1174idaman ea_t ida_export get_segm_base(const segment_t *s);
1175
1176
1187
1188idaman bool ida_export set_segm_addressing(segment_t *s, size_t bitness);
1189
1191
1192//-----------------------------------------------------------------------
1193
1195
1196inline bool is_debugger_segm(ea_t ea)
1197{
1198 segment_t *s = getseg(ea);
1199 return s != nullptr && s->is_debugger_segm();
1200}
1201
1203
1205{
1206 segment_t *s = getseg(ea);
1207 return s != nullptr && s->is_ephemeral_segm();
1208}
1209
1210//-------------------------------------------------------------------------
1211idaman ea_t ida_export correct_address(ea_t ea, ea_t from, ea_t to, ea_t size, bool skip_check=false);
1212
1213//-------------------------------------------------------------------------
1214idaman bool ida_export update_segm(segment_t *s);
1215
1216inline bool segment_t::update(void)
1217{
1218 return update_segm(this);
1219}
1220
1222idaman adiff_t ida_export segm_adjust_diff(const segment_t *s, adiff_t delta);
1223
1225idaman ea_t ida_export segm_adjust_ea(const segment_t *s, ea_t ea);
1226
1227#endif // _SEGMENT_HPP
~lock_segment(void)
Definition segment.hpp:354
lock_segment(const segment_t *_segm)
Definition segment.hpp:350
Describes a program segment.
Definition segment.hpp:69
uchar comb
Segment combination codes
Definition segment.hpp:102
bool update(void)
Update segment information.
Definition segment.hpp:1216
uchar align
Segment alignment codes
Definition segment.hpp:77
void set_header_segm(bool on)
Definition segment.hpp:232
uchar type
segment type (see Segment types).
Definition segment.hpp:253
int abits(void) const
Get number of address bits.
Definition segment.hpp:144
sel_t defsr[SREG_NUM]
default segment register values.
Definition segment.hpp:249
DECLARE_COMPARISONS(segment_t)
uval_t name
use get/set_segm_name() functions
Definition segment.hpp:71
uchar bitness
Number of bits in the segment addressing.
Definition segment.hpp:131
bool is_visible_segm(void) const
Definition segment.hpp:185
void set_loader_segm(bool ldrseg)
Definition segment.hpp:210
bool is_16bit(void) const
Is a 16-bit segment?
Definition segment.hpp:138
void set_debugger_segm(bool debseg)
Definition segment.hpp:199
bool is_hidden_segtype(void) const
Definition segment.hpp:220
void clr_ob_ok(void)
Definition segment.hpp:175
uchar perm
Segment permissions (0 means no information)
Definition segment.hpp:120
bool is_header_segm(void) const
Definition segment.hpp:231
uval_t orgbase
this field is IDP dependent.
Definition segment.hpp:73
void set_ob_ok(void)
Definition segment.hpp:174
void clr_comorg(void)
Definition segment.hpp:163
bool comorg(void) const
Definition segment.hpp:161
bool is_ephemeral_segm(void) const
Ephemeral segments are not analyzed automatically (no flirt, no functions unless required,...
Definition segment.hpp:239
void set_visible_segm(bool visible)
Definition segment.hpp:186
void set_comorg(void)
Definition segment.hpp:162
bool is_loader_segm(void) const
Definition segment.hpp:209
uval_t sclass
use get/set_segm_class() functions
Definition segment.hpp:72
int abytes(void) const
Get number of address bytes.
Definition segment.hpp:146
bool is_64bit(void) const
Is a 64-bit segment?
Definition segment.hpp:142
segment_t(void)
Constructor.
Definition segment.hpp:288
bgcolor_t color
the segment color
Definition segment.hpp:279
bool is_32bit(void) const
Is a 32-bit segment?
Definition segment.hpp:140
sel_t sel
segment selector - should be unique.
Definition segment.hpp:242
ushort flags
Segment flags
Definition segment.hpp:152
bool ob_ok(void) const
Definition segment.hpp:173
void set_hidden_segtype(bool hide)
Definition segment.hpp:221
bool is_debugger_segm(void) const
Definition segment.hpp:197
move_segm_code_t
Definition segment.hpp:757
@ MOVE_SEGM_MAPPING
Memory mapping ranges of addresses hinder segment movement.
Definition segment.hpp:768
@ MOVE_SEGM_LOADER
The segment has been moved but the loader complained.
Definition segment.hpp:763
@ MOVE_SEGM_ROOM
Not enough free room at the target address.
Definition segment.hpp:760
@ MOVE_SEGM_PARAM
The specified segment does not exist.
Definition segment.hpp:759
@ MOVE_SEGM_OK
all ok
Definition segment.hpp:758
@ MOVE_SEGM_ORPHAN
Orphan bytes hinder segment movement.
Definition segment.hpp:765
@ MOVE_SEGM_IDP
IDP module forbids moving the segment.
Definition segment.hpp:761
@ MOVE_SEGM_INVAL
Invalid argument (delta/target does not fit the address space)
Definition segment.hpp:769
@ MOVE_SEGM_CHUNK
Too many chunks are defined, can't move.
Definition segment.hpp:762
@ MOVE_SEGM_ODD
Cannot move segments by an odd number of bytes.
Definition segment.hpp:764
@ MOVE_SEGM_SOURCEFILES
Source files ranges of addresses hinder segment movement.
Definition segment.hpp:767
@ MOVE_SEGM_DEBUG
Debugger segments cannot be moved.
Definition segment.hpp:766
idaman const char * end
Definition pro.h:1001
int code
Definition fpro.h:88
idaman size_t n
Definition pro.h:997
idaman bool ida_export set_segm_addressing(segment_t *s, size_t bitness)
Change segment addressing mode (16, 32, 64 bits).
idaman ea_t ida_export get_segm_base(const segment_t *s)
Get segment base linear address.
idaman ea_t ida_export get_segm_para(const segment_t *s)
Get segment base paragraph.
idaman const char *ida_export get_segment_combination(uchar comb)
Get text representation of segment combination code.
idaman const char *ida_export get_segment_alignment(uchar align)
Get text representation of segment alignment code.
idaman void ida_export set_segment_cmt(const segment_t *s, const char *cmt, bool repeatable)
Set segment comment.
idaman ssize_t ida_export get_segment_cmt(qstring *buf, const segment_t *s, bool repeatable)
Get segment comment.
idaman void ida_export std_out_segm_footer(struct outctx_t &ctx, segment_t *seg)
Generate segment footer line as a comment line.
idaman sel_t ida_export get_group_selector(sel_t grpsel)
Get common selector for a group of segments.
idaman int ida_export set_group_selector(sel_t grp, sel_t sel)
Create a new group of segments (used OMF files).
idaman segment_t *ida_export get_prev_seg(ea_t ea)
Get pointer to the previous segment.
idaman segment_t *ida_export get_first_seg(void)
Get pointer to the first segment.
idaman segment_t *ida_export get_next_seg(ea_t ea)
Get pointer to the next segment.
idaman segment_t *ida_export get_last_seg(void)
Get pointer to the last segment.
idaman int ida_export change_segment_status(segment_t *s, bool is_deb_segm)
Convert a debugger segment to a regular segment and vice versa.
idaman const char *ida_export move_segm_strerror(move_segm_code_t code)
Return string describing error MOVE_SEGM_... code.
idaman bool ida_export add_segm(ea_t para, ea_t start, ea_t end, const char *name, const char *sclass, int flags=0)
Add a new segment, second form.
idaman segment_t *ida_export get_segm_by_name(const char *name)
Get pointer to segment by its name.
idaman int ida_export get_segm_qty(void)
Get number of segments.
idaman bool ida_export add_segm_ex(segment_t *NONNULL s, const char *name, const char *sclass, int flags)
Add a new segment.
idaman bool ida_export move_segm_start(ea_t ea, ea_t newstart, int mode)
Move segment start.
idaman bool ida_export take_memory_snapshot(int type)
Take a memory snapshot of the running process.
idaman bool ida_export set_segm_end(ea_t ea, ea_t newend, int flags)
Set segment end address.
idaman segment_t *ida_export getnseg(int n)
Get pointer to segment by its number.
idaman segment_t *ida_export getseg(ea_t ea)
Get pointer to segment by linear address.
idaman int ida_export get_segm_num(ea_t ea)
Get number of segment by address.
idaman bool ida_export del_segm(ea_t ea, int flags)
Delete a segment.
idaman bool ida_export is_miniidb(void)
Is the database a miniidb created by the debugger?
idaman bool ida_export set_segm_base(segment_t *s, ea_t newbase)
Internal function.
idaman move_segm_code_t ida_export rebase_program(adiff_t delta, int flags)
Rebase the whole program by 'delta' bytes.
idaman move_segm_code_t ida_export move_segm(segment_t *s, ea_t to, int flags=0)
This function moves all information to the new address.
idaman bool ida_export set_segm_start(ea_t ea, ea_t newstart, int flags)
Set segment start address.
idaman ssize_t ida_export get_segm_name(qstring *buf, const segment_t *s, int flags=0)
Get true segment name by pointer to segment.
idaman int ida_export set_segm_name(segment_t *s, const char *name, int flags=0)
Rename segment.
ssize_t idaapi get_visible_segm_name(qstring *buf, const segment_t *s)
Get segment name by pointer to segment.
Definition segment.hpp:1067
ssize_t get_segm_expr(qstring *buf, ea_t from, sel_t sel)
Get colored segment name expression in the form (segname + displacement).
idaman sel_t ida_export allocate_selector(ea_t segbase)
Allocate a selector for a segment unconditionally.
ea_t idaapi sel2ea(sel_t selector)
Get mapping of a selector as a linear address.
Definition segment.hpp:459
idaman segment_t *ida_export get_segm_by_sel(sel_t selector)
Get pointer to segment structure.
idaman void ida_export del_selector(sel_t selector)
Delete mapping of a selector.
idaman ea_t ida_export enumerate_segments_with_selector(sel_t selector, ea_t(idaapi *func)(segment_t *s, void *ud), void *ud=nullptr)
Enumerate all segments with the specified selector.
idaman size_t ida_export get_selector_qty(void)
Get number of defined selectors.
idaman int ida_export enumerate_selectors(int(idaapi *func)(sel_t sel, ea_t para))
Enumerate all selectors from the translation table.
idaman ea_t ida_export sel2para(sel_t selector)
Get mapping of a selector.
idaman sel_t ida_export setup_selector(ea_t segbase)
Allocate a selector for a segment if necessary.
idaman bool ida_export getn_selector(sel_t *sel, ea_t *base, int n)
Get description of selector (0..get_selector_qty()-1)
idaman sel_t ida_export find_free_selector(void)
Find first unused selector.
idaman int ida_export set_selector(sel_t selector, ea_t paragraph)
Set mapping of selector to a paragraph.
idaman sel_t ida_export find_selector(ea_t base)
Find a selector that has mapping to the specified paragraph.
idaman void ida_export set_visible_segm(segment_t *s, bool visible)
See SFL_HIDDEN.
idaman bool ida_export is_segm_locked(const segment_t *segm)
Is a segment pointer locked?
idaman void ida_export lock_segm(const segment_t *segm, bool lock)
Lock segment pointer Locked pointers are guaranteed to remain valid until they are unlocked.
bool is_finally_visible_segm(segment_t *s)
See SFL_HIDDEN, SCF_SHHID_SEGM.
Definition segment.hpp:318
idaman bool ida_export is_spec_ea(ea_t ea)
Does the address belong to a segment with a special type?
idaman bool ida_export is_spec_segm(uchar seg_type)
Has segment a special type?
bool is_visible_segm(segment_t *s)
See SFL_HIDDEN.
Definition segment.hpp:316
CASSERT(sizeof(segment_t)==192)
idaman bool ida_export add_segment_translation(ea_t segstart, ea_t mappedseg)
Add segment translation.
idaman void ida_export del_segment_translations(ea_t segstart)
Delete the translation list.
idaman ssize_t ida_export get_segment_translations(eavec_t *transmap, ea_t segstart)
Get segment translation list.
idaman bool ida_export set_segment_translations(ea_t segstart, const eavec_t &transmap)
Set new translation list.
idaman int ida_export set_segm_class(segment_t *s, const char *sclass, int flags=0)
Set segment class.
idaman uchar ida_export segtype(ea_t ea)
Get segment type.
idaman ssize_t ida_export get_segm_class(qstring *buf, const segment_t *s)
Get segment class.
const tinfo_t & type
Definition hexrays.hpp:7301
Contains the inf structure definition and some functions common to the whole IDA project.
ea_t idaapi to_ea(sel_t reg_cs, uval_t reg_ip)
Convert (sel,off) value to a linear address.
Definition ida.hpp:1136
uchar inf_get_cmtflg()
Definition ida.hpp:889
uval_t uval_t
Definition kernwin.hpp:1878
asize_t size
Definition kernwin.hpp:6339
uint32 bgcolor_t
background color in RGB
Definition pro.h:5012
int64 adiff_t
Definition pro.h:424
uint64 ea_t
Definition pro.h:421
unsigned char uchar
unsigned 8 bit value
Definition pro.h:337
uint64 sel_t
Definition pro.h:422
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
unsigned short ushort
unsigned 16 bit value
Definition pro.h:338
void idaapi setflag(T &where, U bit, bool cnd)
Set a 'bit' in 'where' if 'value' if not zero.
Definition pro.h:1527
_qstring< char > qstring
regular string
Definition pro.h:3694
Contains the definition of range_t.
idaman ea_t ida_export correct_address(ea_t ea, ea_t from, ea_t to, ea_t size, bool skip_check=false)
bool is_ephemeral_segm(ea_t ea)
Does the address belong to an ephemeral segment?
Definition segment.hpp:1204
idaman bool ida_export update_segm(segment_t *s)
bool is_debugger_segm(ea_t ea)
Does the address belong to a debug segment?
Definition segment.hpp:1196
idaman adiff_t ida_export segm_adjust_diff(const segment_t *s, adiff_t delta)
Truncate and sign extend a delta depending on the segment.
idaman ea_t ida_export segm_adjust_ea(const segment_t *s, ea_t ea)
Truncate an address depending on the segment.
Definition ua.hpp:1130
range_t(ea_t ea1=0, ea_t ea2=0)
Definition range.hpp:39