IDA SDK

- Main Page
- Header Files
- Classes
- Modules

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Attributes | Public Member Functions | List of all members
segment_t Class Reference
Segments » Segment structure

## Detailed Description

Describes a program segment.

Inherits area_t.

## Public Attributes
uval_t | name
| use get/set_segm_name() functions
uval_t | sclass
| use get/set_segm_class() functions
uval_t | orgbase
| this field is IDP dependent. More...
uchar | align
| Segment alignment codes
uchar | comb
| Segment combination codes
uchar | perm
| Segment permissions (0 means no information)
uchar | bitness
| Number of bits in the segment addressing. More...
ushort | flags
| Segment flags
sel_t | sel
| segment selector - should be unique. More...
sel_t | defsr [SREG_NUM]
| default segment register values. More...
uchar | type
| segment type (see Segment types). More...
bgcolor_t | color
| the segment color
Public Attributes inherited from area_t
ea_t | startEA
| startEA included
ea_t | endEA
| endEA excluded

## Public Member Functions
| segment_t (void)
| Constructor.
bool | use32 (void) const
| Use 32 bit segment addressing?
bool | use64 (void) const
| Use 64 bit segment addressing?
int | abits (void) const
| Get number of address bits.
int | abytes (void) const
| Get number of address bytes.
bool | is_ephemeral_segm (void) const
| Ephemeral segments are not analyzed automatically (no flirt, no functions unless required, etc). More...
bool | update (void)
| Update segment information. More...
Segment flag: ORG directive
See SFL_COMORG
bool | comorg (void) const
void | set_comorg (void)
void | clr_comorg (void)
Segment flag: orgbase
See SFL_OBOK
bool | ob_ok (void) const
void | set_ob_ok (void)
void | clr_ob_ok (void)
Segment flag: hidden
See SFL_HIDDEN
bool | is_visible_segm (void) const
void | set_visible_segm (bool visible)
Segment flag: debugger segment
See SFL_DEBUG
bool | is_debugger_segm (void) const
void | set_debugger_segm (bool debseg)
Segment flag: loader segment
See SFL_LOADER
bool | is_loader_segm (void) const
void | set_loader_segm (bool ldrseg)
Segment flag: hide segment type
See SFL_HIDETYPE
bool | is_hidden_segtype (void) const
void | set_hidden_segtype (bool hide)
Public Member Functions inherited from area_t
| area_t (void)
| Constructor.
| area_t (ea_t ea1, ea_t ea2)
| Constructor.
int | compare (const area_t &r) const
| Compare two area_t instances, based on the startEA.
bool | operator== (const area_t &r) const
| Compare two area_t's with '=='.
bool | operator!= (const area_t &r) const
| Compare two area_t's with '!='.
bool | operator> (const area_t &r) const
| Compare two area_t's with '<'.
bool | operator< (const area_t &r) const
| Compare two area_t's with '>'.
bool | contains (ea_t ea) const
| Is 'ea' in the address range?
bool | contains (const area_t &r) const
| Is every ea in 'r' also in this area_t?
bool | overlaps (const area_t &r) const
| Is there an ea in 'r' that is also in this area_t?
void | clear (void)
| Set startEA, endEA to 0.
bool | empty (void) const
| Is the size of the area_t <= 0?
asize_t | size (void) const
| Get endEA - startEA.
void | intersect (const area_t &r)
| Assign the area_t to the intersection between the area_t and 'r'.
void | extend (ea_t ea)
| Ensure that the area_t includes 'ea'.
size_t | print (char *buf, size_t bufsize) const
| Print the area_t. More...

## Member Function Documentation

bool segment_t::is_ephemeral_segm | ( | void |  | ) | const
| inline

Ephemeral segments are not analyzed automatically (no flirt, no functions unless required, etc).

Most likely these segments will be destroyed at the end of the debugging session unless the user changes their status.

bool segment_t::update | ( | void |  | ) |
| inline

Update segment information.

You must call this function after modification of segment characteristics. Note that not all fields of segment structure may be modified directly, there are special functions to modify some fields.

Returns
  success

## Member Data Documentation

uval_t segment_t::orgbase

this field is IDP dependent.

you may keep your information about the segment here

uchar segment_t::bitness

Number of bits in the segment addressing.

- 0: 16 bits
- 1: 32 bits
- 2: 64 bits

sel_t segment_t::sel

segment selector - should be unique.

You can't change this field after creating the segment. Exception: 16bit OMF files may have several segments with the same selector, but this is not good (no way to denote a segment exactly) so it should be fixed in the future.

sel_t segment_t::defsr[SREG_NUM]

default segment register values.

first element of this array keeps information about value of processor_t::regFirstSreg

uchar segment_t::type

segment type (see Segment types).

The kernel treats different segment types differently. Segments marked with '*' contain no instructions or data and are not declared as 'segments' in the disassembly.

The documentation for this class was generated from the following file:

- segment.hpp