Latest available version: IDA and decompilers v8.4.240320sp1 see all releases
Hex-Rays logo State-of-the-art binary code analysis tools
email icon
Segment addressing

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...
 

Detailed Description

Function Documentation

◆ get_segm_para()

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 == nullptr, the segment base paragraph

◆ get_segm_base()

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 == nullptr, otherwise segment base linear address

◆ set_segm_addressing()

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