mark_func_spoiled

summary: mark a register “spoiled” by a function

description:

At least two possibilies are offered in order to indicate that a function spoils registers (excluding the “normal” ones):

You can either parse & apply a declaration:

func_tfinfo = ida_typeinf.tinfo_t(“int _spoils<rsi> main();”) ida_typeinf.apply_tinfo(func.start_ea, func_tinfo, ida_typeinf.TINFO_DEFINITE)

or retrieve & modify the tinfo_t object directly.

This script showcases the latter.

level: beginner

Functions

mark_spoiled(address, regs)

Module Contents

mark_func_spoiled.mark_spoiled(address, regs)