IDA C++ SDK 9.2
Loading...
Searching...
No Matches
segment_t Class Reference

Describes a program segment. More...

#include <segment.hpp>

Inheritance diagram for segment_t:
range_t

Public Member Functions

bool is_16bit (void) const
 Is a 16-bit segment?
bool is_32bit (void) const
 Is a 32-bit segment?
bool is_64bit (void) const
 Is a 64-bit segment?
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).
bool update (void)
 Update segment information.
 segment_t (void)
 Constructor.
 DECLARE_COMPARISONS (segment_t)
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)
Segment flag: header segment

See #SFL_HEADER

bool is_header_segm (void) const
void set_header_segm (bool on)
Public Member Functions inherited from range_t
 range_t (ea_t ea1=0, ea_t ea2=0)
 DECLARE_COMPARISONS (range_t)
 Compare two range_t instances, based on the start_ea.
bool contains (ea_t ea) const
 Is 'ea' in the address range?
bool contains (const range_t &r) const
 Is every ea in 'r' also in this range_t?
bool overlaps (const range_t &r) const
 Is there an ea in 'r' that is also in this range_t?
void clear ()
 Set start_ea, end_ea to 0.
bool empty () const
 Is the size of the range_t <= 0?
asize_t size () const
 Get end_ea - start_ea.
void intersect (const range_t &r)
 Assign the range_t to the intersection between the range_t and 'r'.
void extend (ea_t ea)
 Ensure that the range_t includes 'ea'.
size_t print (char *buf, size_t bufsize) const
 Print the range_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.
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.
ushort flags
 Segment flags
sel_t sel
 segment selector - should be unique.
sel_t defsr [SREG_NUM]
 default segment register values.
uchar type
 segment type (see Segment types).
bgcolor_t color
 the segment color
Public Attributes inherited from range_t
ea_t start_ea
 start_ea included
ea_t end_ea
 end_ea excluded

Detailed Description

Describes a program segment.

Constructor & Destructor Documentation

◆ segment_t()

segment_t::segment_t ( void )
inline

Constructor.

Member Function Documentation

◆ is_16bit()

bool segment_t::is_16bit ( void ) const
inline

Is a 16-bit segment?

◆ is_32bit()

bool segment_t::is_32bit ( void ) const
inline

Is a 32-bit segment?

◆ is_64bit()

bool segment_t::is_64bit ( void ) const
inline

Is a 64-bit segment?

◆ abits()

int segment_t::abits ( void ) const
inline

Get number of address bits.

◆ abytes()

int segment_t::abytes ( void ) const
inline

Get number of address bytes.

◆ comorg()

bool segment_t::comorg ( void ) const
inline

◆ set_comorg()

void segment_t::set_comorg ( void )
inline

◆ clr_comorg()

void segment_t::clr_comorg ( void )
inline

◆ ob_ok()

bool segment_t::ob_ok ( void ) const
inline

◆ set_ob_ok()

void segment_t::set_ob_ok ( void )
inline

◆ clr_ob_ok()

void segment_t::clr_ob_ok ( void )
inline

◆ is_visible_segm()

bool segment_t::is_visible_segm ( void ) const
inline

◆ set_visible_segm()

void segment_t::set_visible_segm ( bool visible)
inline

◆ is_debugger_segm()

bool segment_t::is_debugger_segm ( void ) const
inline

◆ set_debugger_segm()

void segment_t::set_debugger_segm ( bool debseg)
inline

◆ is_loader_segm()

bool segment_t::is_loader_segm ( void ) const
inline

◆ set_loader_segm()

void segment_t::set_loader_segm ( bool ldrseg)
inline

◆ is_hidden_segtype()

bool segment_t::is_hidden_segtype ( void ) const
inline

◆ set_hidden_segtype()

void segment_t::set_hidden_segtype ( bool hide)
inline

◆ is_header_segm()

bool segment_t::is_header_segm ( void ) const
inline

◆ set_header_segm()

void segment_t::set_header_segm ( bool on)
inline

◆ is_ephemeral_segm()

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.

◆ update()

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

◆ DECLARE_COMPARISONS()

segment_t::DECLARE_COMPARISONS ( segment_t )

Member Data Documentation

◆ name

uval_t segment_t::name

use get/set_segm_name() functions

◆ sclass

uval_t segment_t::sclass

use get/set_segm_class() functions

◆ orgbase

uval_t segment_t::orgbase

this field is IDP dependent.

you may keep your information about the segment here

◆ align

uchar segment_t::align

◆ comb

◆ perm

uchar segment_t::perm

Segment permissions (0 means no information)

◆ bitness

uchar segment_t::bitness

Number of bits in the segment addressing.

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

◆ flags

ushort segment_t::flags

◆ sel

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.

◆ defsr

sel_t segment_t::defsr[SREG_NUM]

default segment register values.

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

◆ type

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.

◆ color

bgcolor_t segment_t::color

the segment color


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