Functions that deal with offsets.
"Being an offset" is a characteristic of an operand. This means that operand or its part represent offset from some address in the program. This linear address is called "offset base". Some operands may have 2 offsets simultaneously. Generally, IDA doesn't handle this except for Motorola outer offsets. Thus there may be two offset values in an operand: simple offset and outer offset.
Outer offsets are handled by specifying special operand number: it should be ORed with OPND_OUTER value.
See bytes.hpp for further explanation of operand numbers.
|
'reftype_t' | get_default_reftype (ida_idaapi.ea_t ea) |
|
bool | op_offset_ex (ida_idaapi.ea_t ea, int n, 'refinfo_t' ri) |
|
bool | op_offset (*args) |
|
bool | op_plain_offset (ida_idaapi.ea_t ea, int n, ida_idaapi.ea_t base) |
|
ida_idaapi.ea_t | get_offbase (ida_idaapi.ea_t ea, int n) |
|
str | get_offset_expression (ida_idaapi.ea_t ea, int n, ida_idaapi.ea_t _from, 'adiff_t' offset, int getn_flags=0) |
|
str | get_offset_expr (ida_idaapi.ea_t ea, int n, 'refinfo_t' ri, ida_idaapi.ea_t _from, 'adiff_t' offset, int getn_flags=0) |
|
ida_idaapi.ea_t | can_be_off32 (ida_idaapi.ea_t ea) |
|
ida_idaapi.ea_t | calc_offset_base (ida_idaapi.ea_t ea, int n) |
|
ida_idaapi.ea_t | calc_probable_base_by_value (ida_idaapi.ea_t ea, int off) |
|
bool | calc_reference_data ('ea_t *' target, 'ea_t *' base, ida_idaapi.ea_t _from, 'refinfo_t' ri, 'adiff_t' opval) |
|
ida_idaapi.ea_t | add_refinfo_dref ('insn_t const &' insn, ida_idaapi.ea_t _from, 'refinfo_t' ri, 'adiff_t' opval, 'dref_t' type, int opoff) |
|
ida_idaapi.ea_t | calc_target (*args) |
|
ida_idaapi.ea_t | calc_basevalue (ida_idaapi.ea_t target, ida_idaapi.ea_t base) |
|
This function has the following signatures:
0. calc_target(from: ida_idaapi.ea_t, opval: adiff_t, ri: const refinfo_t &) -> ida_idaapi.ea_t
1. calc_target(from: ida_idaapi.ea_t, ea: ida_idaapi.ea_t, n: int, opval: adiff_t) -> ida_idaapi.ea_t
# 0: calc_target(from: ida_idaapi.ea_t, opval: adiff_t, ri: const refinfo_t &) -> ida_idaapi.ea_t
Calculate the target using the provided refinfo_t.
# 1: calc_target(from: ida_idaapi.ea_t, ea: ida_idaapi.ea_t, n: int, opval: adiff_t) -> ida_idaapi.ea_t
Retrieve refinfo_t structure and calculate the target.
Get offset expression (in the form "offset name+displ"). This function uses offset translation function ( processor_t::translate) if your IDP module has such a function. Translation function is used to map linear addresses in the program (only for offsets).
Example: suppose we have instruction at linear address 0x00011000: `mov ax, [bx+7422h] ` and at ds:7422h: `array dw ... ` We want to represent the second operand with an offset expression, so then we call: `get_offset_expresion(0x001100, 1, 0x001102, 0x7422, buf);
| | | | |
| | | | +output buffer
| | | +value of offset expression
| | +address offset value in the instruction
| +the second operand
+address of instruction` and the function will return a colored string: `offset array `
@param ea: start of instruction or data with the offset expression
@param n: operand number (may be ORed with OPND_OUTER)
* 0: first operand
* 1: second operand
* ...
* 7: eighth operand
@param offset: value of operand or its part. The function will return text representation of this value as offset expression.
@param getn_flags: combination of:
* GETN_APPZERO: meaningful only if the name refers to a structure. appends the struct field name if the field offset is zero
* GETN_NODUMMY: do not generate dummy names for the expression but pretend they already exist (useful to verify that the offset expression can be represented)
@retval 0: can't convert to offset expression
@retval 1: ok, a simple offset expression
@retval 2: ok, a complex offset expression