Module index

Module ida_segregs

IDA Plugin SDK API wrapper: segregs

Global variables

var R_cs
R_cs = 30
var R_ds
R_ds = 32
var R_es
R_es = 29
var R_fs
R_fs = 33
var R_gs
R_gs = 34
var R_ss
R_ss = 31
var SR_auto
the value is determined by IDA
var SR_autostart
used as 'SR_auto' for segment starting address
var SR_inherit
the value is inherited from the previous range
var SR_user
the value is specified by the user

Functions

def copy_sreg_ranges(*args) ‑> void
Duplicate segment register ranges.
copy_sreg_ranges(dst_rg, src_rg, map_selector=False)
dst_rg: number of destination segment register (C++: int)
src_rg: copy ranges from (C++: int)
map_selector: map selectors to linear addresses using sel2ea()
(C++: bool)
def del_sreg_range(*args) ‑> bool
Delete segment register range started at ea. When a segment register range is deleted, the previous range is extended to cover the empty space. The segment register range at the beginning of a segment cannot be deleted.
del_sreg_range(ea, rg) -> bool
ea: start_ea of the deleted range (C++: ea_t)
rg: the segment register number (C++: int)
return: success
def get_prev_sreg_range(*args) ‑> bool
Get segment register range previous to one with address.more efficient then get_sreg_range(reg, ea-1)
get_prev_sreg_range(out, ea, rg) -> bool
out: segment register range (C++: sreg_range_t *)
ea: any linear address in the program (C++: ea_t)
rg: the segment register number (C++: int)
return: success
def get_sreg(*args) ‑> sel_t
Get value of a segment register. This function uses segment register range and default segment register values stored in the segment structure.
get_sreg(ea, rg) -> sel_t
ea: linear address in the program (C++: ea_t)
rg: number of the segment register (C++: int)
return: value of the segment register, BADSEL if value is unknown.
def get_sreg_range(*args) ‑> bool
Get segment register range by linear address.
get_sreg_range(out, ea, rg) -> bool
out: segment register range (C++: sreg_range_t *)
ea: any linear address in the program (C++: ea_t)
rg: the segment register number (C++: int)
return: success
def get_sreg_range_num(*args) ‑> int
Get number of segment register range by address.
get_sreg_range_num(ea, rg) -> int
ea: any address in the range (C++: ea_t)
rg: the segment register number (C++: int)
return: -1 if no range occupies the specified address. otherwise
returns number of the specified range (0..get_srranges_qty()-1)
def get_sreg_ranges_qty(*args) ‑> size_t
Get number of segment register ranges.
get_sreg_ranges_qty(rg) -> size_t
rg: the segment register number (C++: int)
def getn_sreg_range(*args) ‑> bool
Get segment register range by its number.
getn_sreg_range(out, rg, n) -> bool
out: segment register range (C++: sreg_range_t *)
rg: the segment register number (C++: int)
n: number of range (0..qty()-1) (C++: int)
return: success
def set_default_dataseg(*args) ‑> void
Set default value of DS register for all segments.
set_default_dataseg(ds_sel)
ds_sel (C++: sel_t)
def set_default_sreg_value(*args) ‑> bool
Set default value of a segment register for a segment.
set_default_sreg_value(sg, rg, value) -> bool
sg: pointer to segment structure if NULL, then set the register
for all segments (C++: segment_t *)
rg: number of segment register (C++: int)
value: its default value. this value will be used by
get_sreg() if value of the register is unknown at the specified address. (C++: sel_t)
return: success
def set_sreg_at_next_code(*args) ‑> void
Set the segment register value at the next instruction. This function is designed to be called from 'idb_event::sgr_changed' handler in order to contain the effect of changing a segment register value only until the next instruction.It is useful, for example, in the ARM module: the modification of the T register does not affect existing instructions later in the code.
set_sreg_at_next_code(ea1, ea2, rg, value)
ea1: address to start to search for an instruction (C++: ea_t)
ea2: the maximal address (C++: ea_t)
rg: the segment register number (C++: int)
value: the segment register value (C++: sel_t)
def split_sreg_range(*args) ‑> bool
Create a new segment register range. This function is used when the IDP emulator detects that a segment register changes its value.
split_sreg_range(ea, rg, v, tag, silent=False) -> bool
ea: linear address where the segment register will have a new
value. if ea== BADADDR , nothing to do. (C++: ea_t)
rg: the number of the segment register (C++: int)
v: the new value of the segment register. If the value is
unknown, you should specify BADSEL . (C++: sel_t)
tag: the register info tag. see Segment register range tags
(C++: uchar)
silent: if false, display a warning() in the case of failure
(C++: bool)
return: success

Classes

class sreg_range_t (*args)
Proxy of C++ sreg_range_t class.
__init__(self) -> sreg_range_t

Ancestors

Instance variables

var tag
sreg_range_t_tag_get(self) -> uchar
var val
sreg_range_t_val_get(self) -> sel_t

Inherited members