IDAPython 8.4
|
Functions that deal with segments. IDA requires that all program addresses belong to segments (each address must belong to exactly one segment). The situation when an address doesn't belong to any segment is allowed as a temporary situation only when the user changes program segmentation. Bytes outside a segment can't be converted to instructions, have names, comments, etc. Each segment has its start address, ending address and represents a contiguous range of addresses. There might be unused holes between segments. Each segment has its unique segment selector. This selector is used to distinguish the segment from other segments. For 16-bit programs the selector is equal to the segment base paragraph. For 32-bit programs there is special array to translate the selectors to the segment base paragraphs. A selector is a 32/64 bit value. The segment base paragraph determines the offsets in the segment. If the start address of the segment == (base << 4) then the first offset in the segment will be 0. The start address should be higher or equal to (base << 4). We will call the offsets in the segment 'virtual addresses'. So, the virtual address of the first byte of the segment is (start address of segment - segment base linear address) For IBM PC, the virtual address corresponds to the offset part of the address. For other processors (Z80, for example), virtual addresses correspond to Z80 addresses and linear addresses are used only internally. For MS Windows programs the segment base paragraph is 0 and therefore the segment virtual addresses are equal to linear addresses.
Classes | |
class | lock_segment |
Proxy of C++ lock_segment class. More... | |
class | segment_defsr_array |
Proxy of C++ wrapped_array_t< sel_t,SREG_NUM > class. More... | |
class | segment_t |
Proxy of C++ segment_t class. More... | |
Functions | |
"bool" | set_segment_translations (*args) |
set_segment_translations(segstart, transmap) -> bool Set new translation list. | |
"bool" | is_visible_segm (*args) |
is_visible_segm(s) -> bool See SFL_HIDDEN. | |
"bool" | is_finally_visible_segm (*args) |
is_finally_visible_segm(s) -> bool See SFL_HIDDEN, SCF_SHHID_SEGM. | |
"void" | set_visible_segm (*args) |
set_visible_segm(s, visible) See SFL_HIDDEN. | |
"bool" | is_spec_segm (*args) |
is_spec_segm(seg_type) -> bool Has segment a special type?. | |
"bool" | is_spec_ea (*args) |
is_spec_ea(ea) -> bool Does the address belong to a segment with a special type?. | |
"void" | lock_segm (*args) |
lock_segm(segm, lock) Lock segment pointer Locked pointers are guaranteed to remain valid until they are unlocked. | |
"bool" | is_segm_locked (*args) |
is_segm_locked(segm) -> bool Is a segment pointer locked? | |
"sel_t *, ea_t *" | getn_selector (*args) |
getn_selector(n) -> bool Get description of selector (0..get_selector_qty()-1) | |
"size_t" | get_selector_qty (*args) |
get_selector_qty() -> size_t Get number of defined selectors. | |
"sel_t" | setup_selector (*args) |
setup_selector(segbase) -> sel_t Allocate a selector for a segment if necessary. | |
"sel_t" | allocate_selector (*args) |
allocate_selector(segbase) -> sel_t Allocate a selector for a segment unconditionally. | |
"sel_t" | find_free_selector (*args) |
find_free_selector() -> sel_t Find first unused selector. | |
"int" | set_selector (*args) |
set_selector(selector, paragraph) -> int Set mapping of selector to a paragraph. | |
"void" | del_selector (*args) |
del_selector(selector) Delete mapping of a selector. | |
"ea_t" | sel2para (*args) |
sel2para(selector) -> ea_t Get mapping of a selector. | |
"ea_t" | sel2ea (*args) |
sel2ea(selector) -> ea_t Get mapping of a selector as a linear address. | |
"sel_t" | find_selector (*args) |
find_selector(base) -> sel_t Find a selector that has mapping to the specified paragraph. | |
"segment_t *" | get_segm_by_sel (*args) |
get_segm_by_sel(selector) -> segment_t Get pointer to segment structure. | |
"bool" | add_segm_ex (*args) |
add_segm_ex(NONNULL_s, name, sclass, flags) -> bool Add a new segment. | |
"bool" | add_segm (*args) |
add_segm(para, start, end, name, sclass, flags=0) -> bool Add a new segment, second form. | |
"bool" | del_segm (*args) |
del_segm(ea, flags) -> bool Delete a segment. | |
"int" | get_segm_qty (*args) |
get_segm_qty() -> int Get number of segments. | |
"segment_t *" | getseg (*args) |
getseg(ea) -> segment_t Get pointer to segment by linear address. | |
"segment_t *" | getnseg (*args) |
getnseg(n) -> segment_t Get pointer to segment by its number. | |
"int" | get_segm_num (*args) |
get_segm_num(ea) -> int Get number of segment by address. | |
"segment_t *" | get_next_seg (*args) |
get_next_seg(ea) -> segment_t Get pointer to the next segment. | |
"segment_t *" | get_prev_seg (*args) |
get_prev_seg(ea) -> segment_t Get pointer to the previous segment. | |
"segment_t *" | get_first_seg (*args) |
get_first_seg() -> segment_t Get pointer to the first segment. | |
"segment_t *" | get_last_seg (*args) |
get_last_seg() -> segment_t Get pointer to the last segment. | |
"segment_t *" | get_segm_by_name (*args) |
get_segm_by_name(name) -> segment_t Get pointer to segment by its name. | |
"bool" | set_segm_end (*args) |
set_segm_end(ea, newend, flags) -> bool Set segment end address. | |
"bool" | set_segm_start (*args) |
set_segm_start(ea, newstart, flags) -> bool Set segment start address. | |
"bool" | move_segm_start (*args) |
move_segm_start(ea, newstart, mode) -> bool Move segment start. | |
"char const *" | move_segm_strerror (*args) |
move_segm_strerror(code) -> char const * Return string describing error MOVE_SEGM_... code. | |
"move_segm_code_t" | move_segm (*args) |
move_segm(s, to, flags=0) -> move_segm_code_t This function moves all information to the new address. | |
"int" | change_segment_status (*args) |
change_segment_status(s, is_deb_segm) -> int Convert a debugger segment to a regular segment and vice versa. | |
"bool" | take_memory_snapshot (*args) |
take_memory_snapshot(type) -> bool Take a memory snapshot of the running process. | |
"bool" | is_miniidb (*args) |
is_miniidb() -> bool Is the database a miniidb created by the debugger?. | |
"bool" | set_segm_base (*args) |
set_segm_base(s, newbase) -> bool Internal function. | |
"int" | set_group_selector (*args) |
set_group_selector(grp, sel) -> int Create a new group of segments (used OMF files). | |
"sel_t" | get_group_selector (*args) |
get_group_selector(grpsel) -> sel_t Get common selector for a group of segments. | |
"bool" | add_segment_translation (*args) |
add_segment_translation(segstart, mappedseg) -> bool Add segment translation. | |
"void" | del_segment_translations (*args) |
del_segment_translations(segstart) Delete the translation list | |
"ssize_t" | get_segment_translations (*args) |
get_segment_translations(transmap, segstart) -> ssize_t Get segment translation list. | |
"qstring *" | get_segment_cmt (*args) |
get_segment_cmt(s, repeatable) -> str Get segment comment. | |
"void" | set_segment_cmt (*args) |
set_segment_cmt(s, cmt, repeatable) Set segment comment. | |
"void" | std_out_segm_footer (*args) |
std_out_segm_footer(ctx, seg) Generate segment footer line as a comment line. | |
"int" | set_segm_name (*args) |
set_segm_name(s, name, flags=0) -> int Rename segment. | |
"qstring *" | get_segm_name (*args) |
get_segm_name(s, flags=0) -> str Get true segment name by pointer to segment. | |
"qstring *" | get_visible_segm_name (*args) |
get_visible_segm_name(s) -> str Get segment name by pointer to segment. | |
"qstring *" | get_segm_class (*args) |
get_segm_class(s) -> str Get segment class. | |
"int" | set_segm_class (*args) |
set_segm_class(s, sclass, flags=0) -> int Set segment class. | |
"uchar" | segtype (*args) |
segtype(ea) -> uchar Get segment type. | |
"char const *" | get_segment_alignment (*args) |
get_segment_alignment(align) -> char const * Get text representation of segment alignment code. | |
"char const *" | get_segment_combination (*args) |
get_segment_combination(comb) -> char const * Get text representation of segment combination code. | |
"ea_t" | get_segm_para (*args) |
get_segm_para(s) -> ea_t Get segment base paragraph. | |
"ea_t" | get_segm_base (*args) |
get_segm_base(s) -> ea_t Get segment base linear address. | |
"bool" | set_segm_addressing (*args) |
set_segm_addressing(s, bitness) -> bool Change segment addressing mode (16, 32, 64 bits). | |
"bool" | update_segm (*args) |
update_segm(s) -> bool | |
"adiff_t" | segm_adjust_diff (*args) |
segm_adjust_diff(s, delta) -> adiff_t Truncate and sign extend a delta depending on the segment. | |
"ea_t" | segm_adjust_ea (*args) |
segm_adjust_ea(s, ea) -> ea_t Truncate an address depending on the segment. | |
"sel_t" | get_defsr (*args) |
get_defsr(s, reg) -> sel_t Deprecated, use instead: value = s.defsr[reg] | |
"void" | set_defsr (*args) |
set_defsr(s, reg, value) Deprecated, use instead: s.defsr[reg] = value | |
"int" | rebase_program (*args) |
rebase_program(delta, flags) -> int Rebase the whole program by 'delta' bytes. | |
Variables | |
SREG_NUM = _ida_segment.SREG_NUM | |
saAbs = _ida_segment.saAbs | |
saRelByte = _ida_segment.saRelByte | |
saRelWord = _ida_segment.saRelWord | |
saRelPara = _ida_segment.saRelPara | |
saRelPage = _ida_segment.saRelPage | |
saRelDble = _ida_segment.saRelDble | |
saRel4K = _ida_segment.saRel4K | |
saGroup = _ida_segment.saGroup | |
saRel32Bytes = _ida_segment.saRel32Bytes | |
saRel64Bytes = _ida_segment.saRel64Bytes | |
saRelQword = _ida_segment.saRelQword | |
saRel128Bytes = _ida_segment.saRel128Bytes | |
saRel512Bytes = _ida_segment.saRel512Bytes | |
saRel1024Bytes = _ida_segment.saRel1024Bytes | |
saRel2048Bytes = _ida_segment.saRel2048Bytes | |
saRel_MAX_ALIGN_CODE = _ida_segment.saRel_MAX_ALIGN_CODE | |
scPriv = _ida_segment.scPriv | |
scGroup = _ida_segment.scGroup | |
scPub = _ida_segment.scPub | |
scPub2 = _ida_segment.scPub2 | |
scStack = _ida_segment.scStack | |
scCommon = _ida_segment.scCommon | |
scPub3 = _ida_segment.scPub3 | |
sc_MAX_COMB_CODE = _ida_segment.sc_MAX_COMB_CODE | |
SEGPERM_EXEC = _ida_segment.SEGPERM_EXEC | |
SEGPERM_WRITE = _ida_segment.SEGPERM_WRITE | |
SEGPERM_READ = _ida_segment.SEGPERM_READ | |
SEGPERM_MAXVAL = _ida_segment.SEGPERM_MAXVAL | |
SEG_MAX_BITNESS_CODE = _ida_segment.SEG_MAX_BITNESS_CODE | |
SFL_COMORG = _ida_segment.SFL_COMORG | |
SFL_OBOK = _ida_segment.SFL_OBOK | |
SFL_HIDDEN = _ida_segment.SFL_HIDDEN | |
SFL_DEBUG = _ida_segment.SFL_DEBUG | |
SFL_LOADER = _ida_segment.SFL_LOADER | |
SFL_HIDETYPE = _ida_segment.SFL_HIDETYPE | |
SFL_HEADER = _ida_segment.SFL_HEADER | |
SEG_NORM = _ida_segment.SEG_NORM | |
SEG_XTRN = _ida_segment.SEG_XTRN | |
SEG_CODE = _ida_segment.SEG_CODE | |
SEG_DATA = _ida_segment.SEG_DATA | |
SEG_IMP = _ida_segment.SEG_IMP | |
SEG_GRP = _ida_segment.SEG_GRP | |
SEG_NULL = _ida_segment.SEG_NULL | |
SEG_UNDF = _ida_segment.SEG_UNDF | |
SEG_BSS = _ida_segment.SEG_BSS | |
SEG_ABSSYM = _ida_segment.SEG_ABSSYM | |
SEG_COMM = _ida_segment.SEG_COMM | |
SEG_IMEM = _ida_segment.SEG_IMEM | |
SEG_MAX_SEGTYPE_CODE = _ida_segment.SEG_MAX_SEGTYPE_CODE | |
ADDSEG_NOSREG = _ida_segment.ADDSEG_NOSREG | |
ADDSEG_OR_DIE = _ida_segment.ADDSEG_OR_DIE | |
ADDSEG_NOTRUNC = _ida_segment.ADDSEG_NOTRUNC | |
ADDSEG_QUIET = _ida_segment.ADDSEG_QUIET | |
ADDSEG_FILLGAP = _ida_segment.ADDSEG_FILLGAP | |
ADDSEG_SPARSE = _ida_segment.ADDSEG_SPARSE | |
ADDSEG_NOAA = _ida_segment.ADDSEG_NOAA | |
ADDSEG_IDBENC = _ida_segment.ADDSEG_IDBENC | |
SEGMOD_KILL = _ida_segment.SEGMOD_KILL | |
SEGMOD_KEEP = _ida_segment.SEGMOD_KEEP | |
SEGMOD_SILENT = _ida_segment.SEGMOD_SILENT | |
SEGMOD_KEEP0 = _ida_segment.SEGMOD_KEEP0 | |
SEGMOD_KEEPSEL = _ida_segment.SEGMOD_KEEPSEL | |
SEGMOD_NOMOVE = _ida_segment.SEGMOD_NOMOVE | |
SEGMOD_SPARSE = _ida_segment.SEGMOD_SPARSE | |
MOVE_SEGM_OK = _ida_segment.MOVE_SEGM_OK | |
MOVE_SEGM_PARAM = _ida_segment.MOVE_SEGM_PARAM | |
MOVE_SEGM_ROOM = _ida_segment.MOVE_SEGM_ROOM | |
MOVE_SEGM_IDP = _ida_segment.MOVE_SEGM_IDP | |
MOVE_SEGM_CHUNK = _ida_segment.MOVE_SEGM_CHUNK | |
MOVE_SEGM_LOADER = _ida_segment.MOVE_SEGM_LOADER | |
MOVE_SEGM_ODD = _ida_segment.MOVE_SEGM_ODD | |
MOVE_SEGM_ORPHAN = _ida_segment.MOVE_SEGM_ORPHAN | |
MOVE_SEGM_DEBUG = _ida_segment.MOVE_SEGM_DEBUG | |
MOVE_SEGM_SOURCEFILES = _ida_segment.MOVE_SEGM_SOURCEFILES | |
MOVE_SEGM_MAPPING = _ida_segment.MOVE_SEGM_MAPPING | |
MOVE_SEGM_INVAL = _ida_segment.MOVE_SEGM_INVAL | |
MSF_SILENT = _ida_segment.MSF_SILENT | |
MSF_NOFIX = _ida_segment.MSF_NOFIX | |
MSF_LDKEEP = _ida_segment.MSF_LDKEEP | |
MSF_FIXONCE = _ida_segment.MSF_FIXONCE | |
MSF_PRIORITY = _ida_segment.MSF_PRIORITY | |
MSF_NETNODES = _ida_segment.MSF_NETNODES | |
CSS_OK = _ida_segment.CSS_OK | |
CSS_NODBG = _ida_segment.CSS_NODBG | |
CSS_NORANGE = _ida_segment.CSS_NORANGE | |
CSS_NOMEM = _ida_segment.CSS_NOMEM | |
CSS_BREAK = _ida_segment.CSS_BREAK | |
SNAP_ALL_SEG = _ida_segment.SNAP_ALL_SEG | |
SNAP_LOAD_SEG = _ida_segment.SNAP_LOAD_SEG | |
SNAP_CUR_SEG = _ida_segment.SNAP_CUR_SEG | |
MAX_GROUPS = _ida_segment.MAX_GROUPS | |
MAX_SEGM_TRANSLATIONS = _ida_segment.MAX_SEGM_TRANSLATIONS | |
"bool" add_segm | ( | * | args | ) |
Segment alignment is set to saRelByte. Segment combination is "public" or "stack" (if segment class is "STACK"). Addressing mode of segment is taken as default (16bit or 32bit). Default segment registers are set to BADSEL. If a segment already exists at the specified range of addresses, this segment will be truncated. Instructions and data in the old segment will be deleted if the new segment has another addressing mode or another segment base address.
para | (C++: ea_t) segment base paragraph. if paragraph can't fit in 16bit, then a new selector is allocated and mapped to the paragraph. |
start | (C++: ea_t) start address of the segment. if start==BADADDR then start <- to_ea(para,0). |
end | (C++: ea_t) end address of the segment. end address should be higher than start address. For emulate empty segments, use SEG_NULL segment type. If the end address is lower than start address, then fail. If end==BADADDR, then a segment up to the next segment will be created (if the next segment doesn't exist, then 1 byte segment will be created). If 'end' is too high and the new segment would overlap the next segment, 'end' is adjusted properly. |
name | (C++: const char *) name of new segment. may be nullptr |
sclass | (C++: const char *) class of the segment. may be nullptr. type of the new segment is modified if class is one of predefined names:
|
flags | (C++: int) Add segment flags |
1 | ok |
0 | failed, a warning message is displayed |
"bool" add_segm_ex | ( | * | args | ) |
If a segment already exists at the specified range of addresses, this segment will be truncated. Instructions and data in the old segment will be deleted if the new segment has another addressing mode or another segment base address.
NONNULL_s | (C++: segment_t *) |
name | (C++: const char *) name of new segment. may be nullptr. if specified, the segment is immediately renamed |
sclass | (C++: const char *) class of the segment. may be nullptr. if specified, the segment class is immediately changed |
flags | (C++: int) Add segment flags |
1 | ok |
0 | failed, a warning message is displayed |
"bool" add_segment_translation | ( | * | args | ) |
segstart | (C++: ea_t) start address of the segment to add translation to |
mappedseg | (C++: ea_t) start address of the overlayed segment |
1 | ok |
0 | too many translations or bad segstart |
"sel_t" allocate_selector | ( | * | args | ) |
You must call this function before calling add_segm_ex(). add_segm() calls this function itself, so you don't need to allocate a selector. This function will allocate a new free selector and setup its mapping using find_free_selector() and set_selector() functions.
segbase | (C++: ea_t) a new segment base paragraph |
"int" change_segment_status | ( | * | args | ) |
When converting debug->regular, the memory contents will be copied to the database.
s | (C++: segment_t *) segment to modify |
is_deb_segm | (C++: bool) new status of the segment |
"bool" del_segm | ( | * | args | ) |
ea | (C++: ea_t) any address belonging to the segment |
flags | (C++: int) Segment modification flags |
1 | ok |
0 | failed, no segment at 'ea'. |
"void" del_segment_translations | ( | * | args | ) |
segstart | (C++: ea_t) start address of the segment to delete translation list |
"void" del_selector | ( | * | args | ) |
Be wary of deleting selectors that are being used in the program, this can make a mess in the segments.
selector | (C++: sel_t) number of selector to remove from the translation table |
"sel_t" find_free_selector | ( | * | args | ) |
"sel_t" find_selector | ( | * | args | ) |
base | (C++: ea_t) paragraph to search in the translation table |
"sel_t" get_defsr | ( | * | args | ) |
s | segment_t * |
reg | int |
"segment_t *" get_first_seg | ( | * | args | ) |
"sel_t" get_group_selector | ( | * | args | ) |
grpsel | (C++: sel_t) selector of group segment |
"segment_t *" get_last_seg | ( | * | args | ) |
"segment_t *" get_next_seg | ( | * | args | ) |
ea | (C++: ea_t) |
"segment_t *" get_prev_seg | ( | * | args | ) |
ea | (C++: ea_t) |
"ea_t" get_segm_base | ( | * | args | ) |
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)
s | (C++: const segment_t *) pointer to segment |
"segment_t *" get_segm_by_name | ( | * | args | ) |
If there are several segments with the same name, returns the first of them.
name | (C++: const char *) segment name. may be nullptr. |
"segment_t *" get_segm_by_sel | ( | * | args | ) |
This function finds a segment by its selector. If there are several segments with the same selectors, the last one will be returned.
selector | (C++: sel_t) a segment with the specified selector will be returned |
"qstring *" get_segm_class | ( | * | args | ) |
Segment class is arbitrary text (max 8 characters).
s | (C++: const segment_t *) pointer to segment |
"qstring *" get_segm_name | ( | * | args | ) |
s | (C++: const segment_t *) pointer to segment |
flags | (C++: int) 0-return name as is; 1-substitute bad symbols with _ 1 corresponds to GN_VISIBLE |
"int" get_segm_num | ( | * | args | ) |
ea | (C++: ea_t) linear address belonging to the segment |
"ea_t" get_segm_para | ( | * | args | ) |
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).
s | (C++: const segment_t *) pointer to segment |
"int" get_segm_qty | ( | * | args | ) |
"char const *" get_segment_alignment | ( | * | args | ) |
align | (C++: uchar) |
"qstring *" get_segment_cmt | ( | * | args | ) |
s | (C++: const segment_t *) pointer to segment structure |
repeatable | (C++: bool) 0: get regular comment. 1: get repeatable comment. |
"char const *" get_segment_combination | ( | * | args | ) |
comb | (C++: uchar) |
"ssize_t" get_segment_translations | ( | * | args | ) |
transmap | (C++: eavec_t *) vector of segment start addresses for the translation list |
segstart | (C++: ea_t) start address of the segment to get information about |
"size_t" get_selector_qty | ( | * | args | ) |
"qstring *" get_visible_segm_name | ( | * | args | ) |
s | (C++: const segment_t *) pointer to segment |
"sel_t *, ea_t *" getn_selector | ( | * | args | ) |
n | (C++: int) |
"segment_t *" getnseg | ( | * | args | ) |
n | (C++: int) segment number in the range (0..get_segm_qty()-1) |
"segment_t *" getseg | ( | * | args | ) |
ea | (C++: ea_t) linear address belonging to the segment |
"bool" is_finally_visible_segm | ( | * | args | ) |
s | (C++: segment_t *) |
"bool" is_miniidb | ( | * | args | ) |
"bool" is_spec_ea | ( | * | args | ) |
(SEG_XTRN, SEG_GRP, SEG_ABSSYM, SEG_COMM)
ea | (C++: ea_t) linear address |
"bool" is_spec_segm | ( | * | args | ) |
(SEG_XTRN, SEG_GRP, SEG_ABSSYM, SEG_COMM)
seg_type | (C++: uchar) |
"bool" is_visible_segm | ( | * | args | ) |
s | (C++: segment_t *) |
"void" lock_segm | ( | * | args | ) |
"move_segm_code_t" move_segm | ( | * | args | ) |
It fixes up address sensitive information in the kernel. The total effect is equal to reloading the segment to the target address. For the file format dependent address sensitive information, loader_t::move_segm is called. Also IDB notification event idb_event::segm_moved is called.
s | (C++: segment_t *) segment to move |
to | (C++: ea_t) new segment start address |
flags | (C++: int) Move segment flags |
"bool" move_segm_start | ( | * | args | ) |
The main difference between this function and set_segm_start() is that this function may expand the previous segment while set_segm_start() never does it. So, this function allows to change bounds of two segments simultaneously. If the previous segment and the specified segment have the same addressing mode and segment base, then instructions and data are not destroyed - they simply move from one segment to another. Otherwise all instructions/data which migrate from one segment to another are destroyed.
ea | (C++: ea_t) any address belonging to the segment |
newstart | (C++: ea_t) new start address of the segment note that segment start address should be higher than segment base linear address. |
mode | (C++: int) policy for destroying defined items
|
1 | ok |
0 | failed, a warning message is displayed |
"char const *" move_segm_strerror | ( | * | args | ) |
code | (C++: move_segm_code_t) enum move_segm_code_t |
"int" rebase_program | ( | * | args | ) |
delta | (C++: adiff_t) number of bytes to move the program |
flags | (C++: int) Move segment flags it is recommended to use MSF_FIXONCE so that the loader takes care of global variables it stored in the database |
"adiff_t" segm_adjust_diff | ( | * | args | ) |
"ea_t" segm_adjust_ea | ( | * | args | ) |
"uchar" segtype | ( | * | args | ) |
ea | (C++: ea_t) any linear address within the segment |
"ea_t" sel2ea | ( | * | args | ) |
selector | (C++: sel_t) number of selector to translate to linear address |
"ea_t" sel2para | ( | * | args | ) |
selector | (C++: sel_t) number of selector to translate |
"void" set_defsr | ( | * | args | ) |
s | segment_t * |
reg | int |
value | sel_t |
"int" set_group_selector | ( | * | args | ) |
grp | (C++: sel_t) selector of group segment (segment type is SEG_GRP) You should create an 'empty' (1 byte) group segment It won't contain anything and will be used to redirect references to the group of segments to the common selector. |
sel | (C++: sel_t) common selector of all segments belonging to the segment You should create all segments within the group with the same selector value. |
"bool" set_segm_addressing | ( | * | args | ) |
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
s | (C++: segment_t *) pointer to segment |
bitness | (C++: size_t) new addressing mode of segment
|
"bool" set_segm_base | ( | * | args | ) |
s | (C++: segment_t *) |
newbase | (C++: ea_t) |
"int" set_segm_class | ( | * | args | ) |
s | (C++: segment_t *) pointer to segment (may be nullptr) |
sclass | (C++: const char *) segment class (may be nullptr). If segment type is SEG_NORM and segment class is one of predefined names, then segment type is changed to:
|
flags | (C++: int) Add segment flags |
1 | ok, name is good and segment is renamed |
0 | failure, name is nullptr or bad or segment is nullptr |
"bool" set_segm_end | ( | * | args | ) |
The next segment is shrinked to allow expansion of the specified segment. The kernel might even delete the next segment if necessary. The kernel will ask the user for a permission to destroy instructions or data going out of segment scope if such instructions exist.
ea | (C++: ea_t) any address belonging to the segment |
newend | (C++: ea_t) new end address of the segment |
flags | (C++: int) Segment modification flags |
1 | ok |
0 | failed, a warning message is displayed |
"int" set_segm_name | ( | * | args | ) |
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.
s | (C++: segment_t *) pointer to segment (may be nullptr) |
name | (C++: const char *) new segment name |
flags | (C++: int) ADDSEG_IDBENC or 0 |
1 | ok, name is good and segment is renamed |
0 | failure, name is bad or segment is nullptr |
"bool" set_segm_start | ( | * | args | ) |
The previous segment is trimmed to allow expansion of the specified segment. The kernel might even delete the previous segment if necessary. The kernel will ask the user for a permission to destroy instructions or data going out of segment scope if such instructions exist.
ea | (C++: ea_t) any address belonging to the segment |
newstart | (C++: ea_t) new start address of the segment note that segment start address should be higher than segment base linear address. |
flags | (C++: int) Segment modification flags |
1 | ok |
0 | failed, a warning message is displayed |
"void" set_segment_cmt | ( | * | args | ) |
s | (C++: const segment_t *) pointer to segment structure |
cmt | (C++: const char *) comment string, may be multiline (with ' '). maximal size is 4096 bytes. Use empty str ("") to delete comment |
repeatable | (C++: bool) 0: set regular comment. 1: set repeatable comment. |
"bool" set_segment_translations | ( | * | args | ) |
segstart | (C++: ea_t) start address of the segment to add translation to |
transmap | (C++: const eavec_t &) vector of segment start addresses for the translation list. If transmap is empty, the translation list is deleted. |
1 | ok |
0 | too many translations or bad segstart |
"int" set_selector | ( | * | args | ) |
You should call this function before creating a segment which uses the selector, otherwise the creation of the segment will fail.
selector | (C++: sel_t) number of selector to map
|
paragraph | (C++: ea_t) paragraph to map selector |
1 | ok |
0 | failure (bad selector or too many mappings) |
"void" set_visible_segm | ( | * | args | ) |
s | (C++: segment_t *) |
visible | (C++: bool) |
"sel_t" setup_selector | ( | * | args | ) |
You must call this function before calling add_segm_ex(). add_segm() calls this function itself, so you don't need to allocate a selector. This function will allocate a selector if 'segbase' requires more than 16 bits and the current processor is IBM PC. Otherwise it will return the segbase value.
segbase | (C++: ea_t) a new segment base paragraph |
"void" std_out_segm_footer | ( | * | args | ) |
This function may be used in IDP modules to generate segment footer if the target assembler doesn't have 'ends' directive.
ctx | (C++: struct outctx_t &) outctx_t & |
seg | (C++: segment_t *) |
"bool" take_memory_snapshot | ( | * | args | ) |
type | (C++: int) specifies which snapshot we want (see SNAP_ Snapshot types) |
"bool" update_segm | ( | * | args | ) |
s | segment_t * |
ADDSEG_FILLGAP = _ida_segment.ADDSEG_FILLGAP |
ADDSEG_IDBENC = _ida_segment.ADDSEG_IDBENC |
ADDSEG_NOAA = _ida_segment.ADDSEG_NOAA |
ADDSEG_NOSREG = _ida_segment.ADDSEG_NOSREG |
ADDSEG_NOTRUNC = _ida_segment.ADDSEG_NOTRUNC |
ADDSEG_OR_DIE = _ida_segment.ADDSEG_OR_DIE |
ADDSEG_QUIET = _ida_segment.ADDSEG_QUIET |
ADDSEG_SPARSE = _ida_segment.ADDSEG_SPARSE |
CSS_BREAK = _ida_segment.CSS_BREAK |
CSS_NODBG = _ida_segment.CSS_NODBG |
CSS_NOMEM = _ida_segment.CSS_NOMEM |
CSS_NORANGE = _ida_segment.CSS_NORANGE |
CSS_OK = _ida_segment.CSS_OK |
MAX_GROUPS = _ida_segment.MAX_GROUPS |
MAX_SEGM_TRANSLATIONS = _ida_segment.MAX_SEGM_TRANSLATIONS |
MOVE_SEGM_CHUNK = _ida_segment.MOVE_SEGM_CHUNK |
MOVE_SEGM_DEBUG = _ida_segment.MOVE_SEGM_DEBUG |
MOVE_SEGM_IDP = _ida_segment.MOVE_SEGM_IDP |
MOVE_SEGM_INVAL = _ida_segment.MOVE_SEGM_INVAL |
MOVE_SEGM_LOADER = _ida_segment.MOVE_SEGM_LOADER |
MOVE_SEGM_MAPPING = _ida_segment.MOVE_SEGM_MAPPING |
MOVE_SEGM_ODD = _ida_segment.MOVE_SEGM_ODD |
MOVE_SEGM_OK = _ida_segment.MOVE_SEGM_OK |
MOVE_SEGM_ORPHAN = _ida_segment.MOVE_SEGM_ORPHAN |
MOVE_SEGM_PARAM = _ida_segment.MOVE_SEGM_PARAM |
MOVE_SEGM_ROOM = _ida_segment.MOVE_SEGM_ROOM |
MOVE_SEGM_SOURCEFILES = _ida_segment.MOVE_SEGM_SOURCEFILES |
MSF_FIXONCE = _ida_segment.MSF_FIXONCE |
MSF_LDKEEP = _ida_segment.MSF_LDKEEP |
MSF_NETNODES = _ida_segment.MSF_NETNODES |
MSF_NOFIX = _ida_segment.MSF_NOFIX |
MSF_PRIORITY = _ida_segment.MSF_PRIORITY |
MSF_SILENT = _ida_segment.MSF_SILENT |
saAbs = _ida_segment.saAbs |
saGroup = _ida_segment.saGroup |
saRel1024Bytes = _ida_segment.saRel1024Bytes |
saRel128Bytes = _ida_segment.saRel128Bytes |
saRel2048Bytes = _ida_segment.saRel2048Bytes |
saRel32Bytes = _ida_segment.saRel32Bytes |
saRel4K = _ida_segment.saRel4K |
saRel512Bytes = _ida_segment.saRel512Bytes |
saRel64Bytes = _ida_segment.saRel64Bytes |
saRel_MAX_ALIGN_CODE = _ida_segment.saRel_MAX_ALIGN_CODE |
saRelByte = _ida_segment.saRelByte |
saRelDble = _ida_segment.saRelDble |
saRelPage = _ida_segment.saRelPage |
saRelPara = _ida_segment.saRelPara |
saRelQword = _ida_segment.saRelQword |
saRelWord = _ida_segment.saRelWord |
sc_MAX_COMB_CODE = _ida_segment.sc_MAX_COMB_CODE |
scCommon = _ida_segment.scCommon |
scGroup = _ida_segment.scGroup |
scPriv = _ida_segment.scPriv |
scPub = _ida_segment.scPub |
scPub2 = _ida_segment.scPub2 |
scPub3 = _ida_segment.scPub3 |
scStack = _ida_segment.scStack |
SEG_ABSSYM = _ida_segment.SEG_ABSSYM |
SEG_BSS = _ida_segment.SEG_BSS |
SEG_CODE = _ida_segment.SEG_CODE |
SEG_COMM = _ida_segment.SEG_COMM |
SEG_DATA = _ida_segment.SEG_DATA |
SEG_GRP = _ida_segment.SEG_GRP |
SEG_IMEM = _ida_segment.SEG_IMEM |
SEG_IMP = _ida_segment.SEG_IMP |
SEG_MAX_BITNESS_CODE = _ida_segment.SEG_MAX_BITNESS_CODE |
SEG_MAX_SEGTYPE_CODE = _ida_segment.SEG_MAX_SEGTYPE_CODE |
SEG_NORM = _ida_segment.SEG_NORM |
SEG_NULL = _ida_segment.SEG_NULL |
SEG_UNDF = _ida_segment.SEG_UNDF |
SEG_XTRN = _ida_segment.SEG_XTRN |
SEGMOD_KEEP = _ida_segment.SEGMOD_KEEP |
SEGMOD_KEEP0 = _ida_segment.SEGMOD_KEEP0 |
SEGMOD_KEEPSEL = _ida_segment.SEGMOD_KEEPSEL |
SEGMOD_KILL = _ida_segment.SEGMOD_KILL |
SEGMOD_NOMOVE = _ida_segment.SEGMOD_NOMOVE |
SEGMOD_SILENT = _ida_segment.SEGMOD_SILENT |
SEGMOD_SPARSE = _ida_segment.SEGMOD_SPARSE |
SEGPERM_EXEC = _ida_segment.SEGPERM_EXEC |
SEGPERM_MAXVAL = _ida_segment.SEGPERM_MAXVAL |
SEGPERM_READ = _ida_segment.SEGPERM_READ |
SEGPERM_WRITE = _ida_segment.SEGPERM_WRITE |
SFL_COMORG = _ida_segment.SFL_COMORG |
SFL_DEBUG = _ida_segment.SFL_DEBUG |
SFL_HEADER = _ida_segment.SFL_HEADER |
SFL_HIDDEN = _ida_segment.SFL_HIDDEN |
SFL_HIDETYPE = _ida_segment.SFL_HIDETYPE |
SFL_LOADER = _ida_segment.SFL_LOADER |
SFL_OBOK = _ida_segment.SFL_OBOK |
SNAP_ALL_SEG = _ida_segment.SNAP_ALL_SEG |
SNAP_CUR_SEG = _ida_segment.SNAP_CUR_SEG |
SNAP_LOAD_SEG = _ida_segment.SNAP_LOAD_SEG |
SREG_NUM = _ida_segment.SREG_NUM |