IDA SDK
Functions
Segment addressing

Detailed Description

Functions

idaman ea_t ida_export get_segm_para (const segment_t *s)
 Get segment base paragraph. More...
 
idaman ea_t ida_export get_segm_base (const segment_t *s)
 Get segment base linear address. More...
 
idaman bool ida_export set_segm_addressing (segment_t *s, size_t bitness)
 Change segment addressing mode (16, 32, 64 bits). More...
 

Function Documentation

idaman ea_t ida_export get_segm_para ( const segment_t s)

Get segment base paragraph.

Segment base paragraph may be converted to segment base linear address using to_ea() function. In fact, to_ea(get_segm_para(s), 0) == get_segm_base(s).

Parameters
spointer to segment
Returns
0 if s == NULL, the segment base paragraph
idaman ea_t ida_export get_segm_base ( const segment_t s)

Get segment base linear address.

Segment base linear address is used to calculate virtual addresses. The virtual address of the first byte of the segment will be (start address of segment - segment base linear address)

Parameters
spointer to segment
Returns
0 if s == NULL, otherwise segment base linear address
idaman bool ida_export set_segm_addressing ( segment_t s,
size_t  bitness 
)

Change segment addressing mode (16, 32, 64 bits).

You must use this function to change segment addressing, never change the 'bitness' field directly. This function will delete all instructions, comments and names in the segment

Parameters
spointer to segment
bitnessnew addressing mode of segment
  • 2: 64bit segment
  • 1: 32bit segment
  • 0: 16bit segment
Returns
success