IDA SDK

- Main Page
- Header Files
- Classes
- Modules

Functions
Segment names
Segments

## Detailed Description

Various ways to retrieve the name of a segment.

## Functions
idaman int ida_export | vset_segm_name (segment_t *s, const char *format, va_list va)
| See set_segm_name()
int | set_segm_name (segment_t *s, const char *format,...)
| Rename segment. More...
idaman ssize_t ida_export | get_true_segm_name (const segment_t *s, char *buf, size_t bufsize)
| Get true segment name by pointer to segment. More...
idaman ssize_t ida_export | get_segm_name (const segment_t *s, char *buf, size_t bufsize)
| Get segment name by pointer to segment. More...
ssize_t idaapi | get_segm_name (ea_t ea, char *buf, size_t bufsize)
| Get segment name by linear address. More...
char * | get_segm_expr (ea_t from, sel_t sel, char *buf, size_t bufsize)
| Get colored segment name expression in the form (segname + displacement). More...

## Function Documentation

int set_segm_name | ( | segment_t * | s,
|  | const char * | format,
|  |  | ...
| ) |  |
| inline

Rename segment.

The new name is validated (see validate_name3). 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

  s | pointer to segment (may be NULL)
  format | new name, printf() style format string

Return values

  1 | ok, name is good and segment is renamed
  0 | failure, name is bad or segment is NULL

idaman ssize_t ida_export get_true_segm_name | ( | const segment_t * | s,
|  | char * | buf,
|  | size_t | bufsize
| ) |  |

Get true segment name by pointer to segment.

Parameters

  s | pointer to segment
  buf | output buffer. can not be NULL
  bufsize | output buffersize

Returns
  size of segment name (-1 if s==NULL)

idaman ssize_t ida_export get_segm_name | ( | const segment_t * | s,
|  | char * | buf,
|  | size_t | bufsize
| ) |  |

Get segment name by pointer to segment.

Parameters

  s | pointer to segment
  buf | output buffer. can not be NULL
  bufsize | output buffersize

Returns
  size of segment name (-1 if s==NULL)

ssize_t idaapi get_segm_name | ( | ea_t | ea,
|  | char * | buf,
|  | size_t | bufsize
| ) |  |
| inline

Get segment name by linear address.

Parameters

  ea | any linear address within the segment
  buf | output buffer. can not be NULL
  bufsize | output buffersize

Returns
  size of segment name (-1 if s==NULL)

char* get_segm_expr | ( | ea_t | from,
|  | sel_t | sel,
|  | char * | buf,
|  | size_t | bufsize
| ) |  |

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

Parameters

  from | linear 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.
  sel | value to convert to segment expression
  buf | output buffer to hold segment expression
  bufsize | size of the output buffer

Returns
  NULL-can't convert to segment expression. otherwise pointer to 'buf'