IDAPython 9.0
|
Functions that deal with fixup information. A loader should setup fixup information using set_fixup().
Classes | |
class | fixup_data_t |
class | fixup_info_t |
Variables | |
FIXUP_OFF8 = _ida_fixup.FIXUP_OFF8 | |
FIXUP_OFF16 = _ida_fixup.FIXUP_OFF16 | |
FIXUP_SEG16 = _ida_fixup.FIXUP_SEG16 | |
FIXUP_PTR16 = _ida_fixup.FIXUP_PTR16 | |
FIXUP_OFF32 = _ida_fixup.FIXUP_OFF32 | |
FIXUP_PTR32 = _ida_fixup.FIXUP_PTR32 | |
FIXUP_HI8 = _ida_fixup.FIXUP_HI8 | |
FIXUP_HI16 = _ida_fixup.FIXUP_HI16 | |
FIXUP_LOW8 = _ida_fixup.FIXUP_LOW8 | |
FIXUP_LOW16 = _ida_fixup.FIXUP_LOW16 | |
V695_FIXUP_VHIGH = _ida_fixup.V695_FIXUP_VHIGH | |
V695_FIXUP_VLOW = _ida_fixup.V695_FIXUP_VLOW | |
FIXUP_OFF64 = _ida_fixup.FIXUP_OFF64 | |
FIXUP_OFF8S = _ida_fixup.FIXUP_OFF8S | |
FIXUP_OFF16S = _ida_fixup.FIXUP_OFF16S | |
FIXUP_OFF32S = _ida_fixup.FIXUP_OFF32S | |
FIXUP_CUSTOM = _ida_fixup.FIXUP_CUSTOM | |
FIXUPF_REL = _ida_fixup.FIXUPF_REL | |
FIXUPF_EXTDEF = _ida_fixup.FIXUPF_EXTDEF | |
FIXUPF_UNUSED = _ida_fixup.FIXUPF_UNUSED | |
FIXUPF_CREATED = _ida_fixup.FIXUPF_CREATED | |
FIXUPF_LOADER_MASK = _ida_fixup.FIXUPF_LOADER_MASK | |
int calc_fixup_size | ( | 'fixup_type_t' | type | ) |
Calculate size of fixup in bytes (the number of bytes the fixup patches) @retval -1: means error
bool contains_fixups | ( | ida_idaapi.ea_t | ea, |
'asize_t' | size ) |
Does the specified address range contain any fixup information?
None del_fixup | ( | ida_idaapi.ea_t | source | ) |
Delete fixup information.
bool exists_fixup | ( | ida_idaapi.ea_t | source | ) |
Check that a fixup exists at the given address.
'fixup_type_t' find_custom_fixup | ( | str | name | ) |
None gen_fix_fixups | ( | ida_idaapi.ea_t | _from, |
ida_idaapi.ea_t | to, | ||
'asize_t' | size ) |
Relocate the bytes with fixup information once more (generic function). This function may be called from loader_t::move_segm() if it suits the goal. If loader_t::move_segm is not defined then this function will be called automatically when moving segments or rebasing the entire program. Special parameter values (from = BADADDR, size = 0, to = delta) are used when the function is called from rebase_program(delta).
ida_idaapi.ea_t get_first_fixup_ea | ( | ) |
bool get_fixup | ( | 'fixup_data_t' | fd, |
ida_idaapi.ea_t | source ) |
Get fixup information.
str get_fixup_desc | ( | ida_idaapi.ea_t | source, |
'fixup_data_t' | fd ) |
Get FIXUP description comment.
'fixup_handler_t const *' get_fixup_handler | ( | 'fixup_type_t' | type | ) |
Get handler of standard or custom fixup.
int get_fixup_value | ( | ida_idaapi.ea_t | ea, |
'fixup_type_t' | type ) |
Get the operand value. This function get fixup bytes from data or an instruction at `ea` and convert them to the operand value (maybe partially). It is opposite in meaning to the `patch_fixup_value()`. For example, FIXUP_HI8 read a byte at `ea` and shifts it left by 8 bits, or AArch64's custom fixup BRANCH26 get low 26 bits of the insn at `ea` and shifts it left by 2 bits. This function is mainly used to get a relocation addend. @param ea: address to get fixup bytes from, the size of the fixup bytes depends on the fixup type. @param type: fixup type @retval operand: value
bool get_fixups | ( | 'fixups_t *' | out, |
ida_idaapi.ea_t | ea, | ||
'asize_t' | size ) |
ida_idaapi.ea_t get_next_fixup_ea | ( | ida_idaapi.ea_t | ea | ) |
ida_idaapi.ea_t get_prev_fixup_ea | ( | ida_idaapi.ea_t | ea | ) |
bool handle_fixups_in_macro | ( | 'refinfo_t' | ri, |
ida_idaapi.ea_t | ea, | ||
'fixup_type_t' | other, | ||
int | macro_reft_and_flags ) |
Handle two fixups in a macro. We often combine two instruction that load parts of a value into one macro instruction. For example: ADRP X0, #var@PAGE ADD X0, X0, #var@PAGEOFF --> ADRL X0, var lui $v0, %hi(var) addiu $v0, $v0, %lo(var) --> la $v0, var @returns success ('false' means that RI was not changed)
bool is_fixup_custom | ( | 'fixup_type_t' | type | ) |
Is fixup processed by processor module?
bool patch_fixup_value | ( | ida_idaapi.ea_t | ea, |
'fixup_data_t' | fd ) |
Patch the fixup bytes. This function updates data or an instruction at `ea` to the fixup bytes. For example, FIXUP_HI8 updates a byte at `ea` to the high byte of `fd->off`, or AArch64's custom fixup BRANCH26 updates low 26 bits of the insn at `ea` to the value of `fd->off` shifted right by 2. @param ea: address where data are changed, the size of the changed data depends on the fixup type. @param fd: fixup data @retval false: the fixup bytes do not fit (e.g. `fd->off` is greater than 0xFFFFFFC for BRANCH26). The database is changed even in this case.
None set_fixup | ( | ida_idaapi.ea_t | source, |
'fixup_data_t' | fd ) |
Set fixup information. You should fill fixup_data_t and call this function and the kernel will remember information in the database. @param source: the fixup source address, i.e. the address modified by the fixup @param fd: fixup data
FIXUP_CUSTOM = _ida_fixup.FIXUP_CUSTOM |
FIXUP_HI16 = _ida_fixup.FIXUP_HI16 |
FIXUP_HI8 = _ida_fixup.FIXUP_HI8 |
FIXUP_LOW16 = _ida_fixup.FIXUP_LOW16 |
FIXUP_LOW8 = _ida_fixup.FIXUP_LOW8 |
FIXUP_OFF16 = _ida_fixup.FIXUP_OFF16 |
FIXUP_OFF16S = _ida_fixup.FIXUP_OFF16S |
FIXUP_OFF32 = _ida_fixup.FIXUP_OFF32 |
FIXUP_OFF32S = _ida_fixup.FIXUP_OFF32S |
FIXUP_OFF64 = _ida_fixup.FIXUP_OFF64 |
FIXUP_OFF8 = _ida_fixup.FIXUP_OFF8 |
FIXUP_OFF8S = _ida_fixup.FIXUP_OFF8S |
FIXUP_PTR16 = _ida_fixup.FIXUP_PTR16 |
FIXUP_PTR32 = _ida_fixup.FIXUP_PTR32 |
FIXUP_SEG16 = _ida_fixup.FIXUP_SEG16 |
FIXUPF_CREATED = _ida_fixup.FIXUPF_CREATED |
FIXUPF_EXTDEF = _ida_fixup.FIXUPF_EXTDEF |
FIXUPF_LOADER_MASK = _ida_fixup.FIXUPF_LOADER_MASK |
FIXUPF_REL = _ida_fixup.FIXUPF_REL |
FIXUPF_UNUSED = _ida_fixup.FIXUPF_UNUSED |
V695_FIXUP_VHIGH = _ida_fixup.V695_FIXUP_VHIGH |
V695_FIXUP_VLOW = _ida_fixup.V695_FIXUP_VLOW |