IDA C++ SDK 9.2
Loading...
Searching...
No Matches
Segment names

Various ways to retrieve the name of a segment. More...

Functions

idaman DEPRECATED int ida_export set_segm_name (segment_t *s, const char *name, int flags=0)
 Rename segment.
idaman int ida_export set_segment_name (ea_t ea, const char *name, int flags=0)
 Rename segment by address.
idaman DEPRECATED 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 ssize_t ida_export get_segment_name (qstring *buf, ea_t ea, int flags=0)
 Get segment name by address.
DEPRECATED ssize_t idaapi get_visible_segm_name (qstring *buf, const segment_t *s)
 Get segment name by pointer to segment.
ssize_t get_segm_expr (qstring *buf, ea_t from, sel_t sel)
 Get colored segment name expression in the form (segname + displacement).

Detailed Description

Various ways to retrieve the name of a segment.

Function Documentation

◆ set_segm_name()

idaman DEPRECATED int ida_export set_segm_name ( segment_t * s,
const char * name,
int flags = 0 )

Rename segment.

The new name is validated (see validate_name). A segment always has a name. If you hadn't specified a name, the kernel will assign it "seg###" name where ### is segment number.

Deprecated
Use segment_info_t::set_name() and set_segment_info() or set_segment_name().
Parameters
spointer to segment (may be nullptr)
namenew segment name
flagsADDSEG_IDBENC or 0
Return values
1ok, name is good and segment is renamed
0failure, name is bad or segment is nullptr

◆ set_segment_name()

idaman int ida_export set_segment_name ( ea_t ea,
const char * name,
int flags = 0 )

Rename segment by address.

The new name is validated (see validate_name). A segment always has a name. If you hadn't specified a name, the kernel will assign it "seg###" name where ### is segment number.

Parameters
eaany address within the segment
namenew segment name
flagsADDSEG_IDBENC or 0
Return values
1ok, name is good and segment is renamed
0failure, name is bad or no segment at ea

◆ get_segm_name()

idaman DEPRECATED ssize_t ida_export get_segm_name ( qstring * buf,
const segment_t * s,
int flags = 0 )

Get true segment name by pointer to segment.

Deprecated
Use get_segment_info() and segment_info_t::get_name() or get_segment_name().
Parameters
bufoutput buffer. cannot be nullptr
spointer to segment
flags0-return name as is; 1-substitute bad symbols with _ 1 corresponds to GN_VISIBLE
Returns
size of segment name (-1 if s==nullptr)

◆ get_segment_name()

idaman ssize_t ida_export get_segment_name ( qstring * buf,
ea_t ea,
int flags = 0 )

Get segment name by address.

Parameters
bufoutput buffer. cannot be nullptr
eaany address within the segment
flags0-return name as is; 1-substitute bad symbols with _ 1 corresponds to GN_VISIBLE
Returns
size of segment name (-1 if no segment at ea)

◆ get_visible_segm_name()

DEPRECATED ssize_t idaapi get_visible_segm_name ( qstring * buf,
const segment_t * s )
inline

Get segment name by pointer to segment.

Deprecated
Use get_segment_name() with GN_VISIBLE flag.
Parameters
bufoutput buffer. cannot be nullptr
spointer to segment
Returns
size of segment name (-1 if s==nullptr)

◆ get_segm_expr()

ssize_t get_segm_expr ( qstring * buf,
ea_t from,
sel_t sel )

Get colored segment name expression in the form (segname + displacement).

Parameters
bufoutput buffer to hold segment expression
fromlinear address of instruction operand or data referring to the name. This address will be used to get fixup information, so it should point to exact position of operand in the instruction.
selvalue to convert to segment expression
Returns
size of segment expression or -1