Describes a processor module (IDP). More...
#include <idp.hpp>
Public Member Functions | |
bool | has_idp_opts (void) const |
#PR_IDP_OPTS | |
bool | has_realcvt (void) const |
#PR_REALCVT | |
bool | has_segregs (void) const |
PR_SEGS | |
bool | use32 (void) const |
PR_USE64 or PR_USE32 | |
bool | use64 (void) const |
PR_USE64 | |
bool | ti (void) const |
PR_TYPEINFO | |
bool | stkup (void) const |
PR_STACK_UP | |
bool | use_tbyte (void) const |
PR_USE_TBYTE | |
bool | use_mappings (void) const |
PR2_MAPPINGS | |
bool | has_code16_bit (void) const |
PR2_CODE16_BIT | |
bool | supports_macros (void) const |
PR2_MACRO | |
bool | supports_calcrel (void) const |
PR2_USE_CALCREL | |
bool | calcrel_in_bits (void) const |
PR2_REL_BITS | |
int | get_default_segm_bitness (bool is_64bit_app) const |
Get default segment bitness. More... | |
Byte size | |
Number of 8bit bytes required to hold one byte of the target processor. | |
int | cbsize (void) |
for code segments | |
int | dbsize (void) |
for non-code segments | |
Public Attributes | |
int32 | version |
Expected kernel version, should be IDP_INTERFACE_VERSION. | |
int32 | id |
one of Processor IDs | |
uint32 | flag |
an ORed combination of Processor feature bits | |
uint32 | flag2 |
an ORed combination of Processor additional feature bits | |
int32 | cnbits |
Number of bits in a byte for code segments (usually 8). More... | |
int32 | dnbits |
Number of bits in a byte for non-code segments (usually 8). More... | |
Segment registers | |
Segment register information (use virtual CS and DS registers if your processor doesn't have segment registers): | |
int32 | reg_first_sreg |
number of first segment register | |
int32 | reg_last_sreg |
number of last segment register | |
int32 | segreg_size |
size of a segment register in bytes | |
Virtual segment registers | |
If your processor doesn't have segment registers, you should define 2 virtual segment registers for CS and DS. Let's call them rVcs and rVds. | |
int32 | reg_code_sreg |
number of CS register | |
int32 | reg_data_sreg |
number of DS register | |
Empirics | |
const bytes_t * | codestart |
Array of typical code start sequences. More... | |
const bytes_t * | retcodes |
Array of 'return' instruction opcodes. More... | |
Names | |
IDP module may support several compatible processors. The following arrays define processor names: | |
enum | event_t { ev_init , ev_term , ev_newprc , ev_newasm , ev_newfile , ev_oldfile , ev_newbinary , ev_endbinary , ev_set_idp_options , ev_set_proc_options , ev_ana_insn , ev_emu_insn , ev_out_header , ev_out_footer , ev_out_segstart , ev_out_segend , ev_out_assumes , ev_out_insn , ev_out_mnem , ev_out_operand , ev_out_data , ev_out_label , ev_out_special_item , ev_gen_stkvar_def , ev_gen_regvar_def , ev_gen_src_file_lnnum , ev_creating_segm , ev_moving_segm , ev_coagulate , ev_undefine , ev_treat_hindering_item , ev_rename , ev_is_far_jump , ev_is_sane_insn , ev_is_cond_insn , ev_is_call_insn , ev_is_ret_insn , ev_may_be_func , ev_is_basic_block_end , ev_is_indirect_jump , ev_is_insn_table_jump , ev_is_switch , ev_calc_switch_cases , ev_create_switch_xrefs , ev_is_align_insn , ev_is_alloca_probe , ev_delay_slot_insn , ev_is_sp_based , ev_can_have_type , ev_cmp_operands , ev_adjust_refinfo , ev_get_operand_string , ev_get_reg_name , ev_str2reg , ev_get_autocmt , ev_get_bg_color , ev_is_jump_func , ev_func_bounds , ev_verify_sp , ev_verify_noreturn , ev_create_func_frame , ev_get_frame_retsize , ev_get_stkvar_scale_factor , ev_demangle_name , ev_add_cref , ev_add_dref , ev_del_cref , ev_del_dref , ev_coagulate_dref , ev_may_show_sreg , ev_loader_elf_machine , ev_auto_queue_empty , ev_validate_flirt_func , ev_adjust_libfunc_ea , ev_assemble , ev_extract_address , ev_realcvt , ev_gen_asm_or_lst , ev_gen_map_file , ev_create_flat_group , ev_getreg , ev_analyze_prolog , ev_calc_spdelta , ev_calcrel , ev_find_reg_value , ev_find_op_value , ev_replaying_undo , ev_ending_undo , ev_set_code16_mode , ev_get_code16_mode , ev_get_procmod , ev_asm_installed , ev_get_reg_accesses , ev_is_control_flow_guard , ev_broadcast , ev_create_merge_handlers , ev_privrange_changed , ev_last_cb_before_debugger , ev_next_exec_insn = 1000 , ev_calc_step_over , ev_calc_next_eas , ev_get_macro_insn_head , ev_get_dbr_opnum , ev_insn_reads_tbit , ev_clean_tbit , ev_get_idd_opinfo , ev_get_reg_info , ev_update_call_stack , ev_last_cb_before_type_callbacks , ev_setup_til = 2000 , ev_get_abi_info , ev_max_ptr_size , ev_get_default_enum_size , ev_get_cc_regs , ev_obsolete1 , ev_obsolete2 , ev_get_simd_types , ev_calc_cdecl_purged_bytes , ev_calc_purged_bytes , ev_calc_retloc , ev_calc_arglocs , ev_calc_varglocs , ev_adjust_argloc , ev_lower_func_type , ev_equal_reglocs , ev_use_stkarg_type , ev_use_regarg_type , ev_use_arg_types , ev_arg_addrs_ready , ev_decorate_name , ev_arch_changed , ev_get_stkarg_area_info , ev_last_cb_before_loader , ev_loader =3000 } |
Callback notification codes. More... | |
typedef const regval_t &idaapi | regval_getter_t(const char *name, const regval_t *regvalues) |
const char *const * | psnames |
short processor names (nullptr terminated). More... | |
const char *const * | plnames |
long processor names (nullptr terminated). More... | |
const asm_t *const * | assemblers |
pointer to array of target More... | |
hook_cb_t * | _notify |
Event notification handler. | |
const char *const * | reg_names |
array of register names | |
int32 | regs_num |
number of registers | |
int | get_proc_index () |
bool | delay_slot_insn (ea_t *ea, bool *bexec, bool *fexec) |
Helper function to get the delay slot instruction. | |
ssize_t | privrange_changed (const range_t &old_privrange, adiff_t delta, qstring *errbuf=nullptr) |
int | get_stkvar_scale (void) |
Get the stack variable scaling factor. More... | |
static ssize_t | notify (event_t event_code,...) |
static ssize_t | init (const char *idp_modname) |
static ssize_t | term () |
static ssize_t | newprc (int pnum, bool keep_cfg) |
static ssize_t | newasm (int asmnum) |
static ssize_t | asm_installed (int asmnum) |
static ssize_t | newfile (const char *fname) |
static ssize_t | oldfile (const char *fname) |
static ssize_t | newbinary (const char *filename, qoff64_t fileoff, ea_t basepara, ea_t binoff, uint64 nbytes) |
static ssize_t | endbinary (bool ok) |
static ssize_t | creating_segm (segment_t *seg) |
static ssize_t | assemble (uchar *_bin, ea_t ea, ea_t cs, ea_t ip, bool _use32, const char *line) |
static ssize_t | ana_insn (insn_t *out) |
static ssize_t | emu_insn (const insn_t &insn) |
static ssize_t | out_header (outctx_t &ctx) |
static ssize_t | out_footer (outctx_t &ctx) |
static ssize_t | out_segstart (outctx_t &ctx, segment_t *seg) |
static ssize_t | out_segend (outctx_t &ctx, segment_t *seg) |
static ssize_t | out_assumes (outctx_t &ctx) |
static ssize_t | out_insn (outctx_t &ctx) |
static ssize_t | out_mnem (outctx_t &ctx) |
static ssize_t | out_operand (outctx_t &ctx, const op_t &op) |
static ssize_t | out_data (outctx_t &ctx, bool analyze_only) |
static ssize_t | out_label (outctx_t &ctx, const char *colored_name) |
static ssize_t | out_special_item (outctx_t &ctx, uchar segtype) |
static ssize_t | gen_stkvar_def (outctx_t &ctx, const class member_t *mptr, sval_t v) |
static ssize_t | gen_regvar_def (outctx_t &ctx, regvar_t *v) |
static ssize_t | gen_src_file_lnnum (outctx_t &ctx, const char *file, size_t lnnum) |
static ssize_t | rename (ea_t ea, const char *new_name, int flags) |
static ssize_t | may_show_sreg (ea_t current_ea) |
static ssize_t | coagulate (ea_t start_ea) |
static void | auto_queue_empty (int type) |
static ssize_t | func_bounds (int *possible_return_code, func_t *pfn, ea_t max_func_end_ea) |
static ssize_t | may_be_func (const insn_t &insn, int state) |
static ssize_t | is_sane_insn (const insn_t &insn, int no_crefs) |
static ssize_t | cmp_operands (const op_t &op1, const op_t &op2) |
static ssize_t | is_jump_func (func_t *pfn, ea_t *jump_target, ea_t *func_pointer) |
static ssize_t | is_basic_block_end (const insn_t &insn, bool call_insn_stops_block) |
static ssize_t | getreg (uval_t *rv, int regnum) |
static ssize_t | undefine (ea_t ea) |
static ssize_t | moving_segm (segment_t *seg, ea_t to, int flags) |
static ssize_t | is_sp_based (const insn_t &insn, const op_t &x) |
static ssize_t | is_far_jump (int icode) |
static ssize_t | is_call_insn (const insn_t &insn) |
static ssize_t | is_ret_insn (const insn_t &insn, bool strict) |
static ssize_t | is_align_insn (ea_t ea) |
static ssize_t | can_have_type (const op_t &op) |
static ssize_t | get_stkvar_scale_factor () |
static ssize_t | demangle_name (int32 *res, qstring *out, const char *name, uint32 disable_mask, int demreq) |
static ssize_t | create_flat_group (ea_t image_base, int bitness, sel_t dataseg_sel) |
static ssize_t | is_alloca_probe (ea_t ea) |
static ssize_t | get_reg_name (qstring *buf, int reg, size_t width, int reghi) |
static ssize_t | gen_asm_or_lst (bool starting, FILE *fp, bool is_asm, int flags, void *outline) |
static ssize_t | gen_map_file (int *nlines, FILE *fp) |
static ssize_t | get_autocmt (qstring *buf, const insn_t &insn) |
static ssize_t | loader_elf_machine (linput_t *li, int machine_type, const char **p_procname, proc_def_t **p_pd, elf_loader_t *ldr, reader_t *reader) |
static ssize_t | is_indirect_jump (const insn_t &insn) |
static ssize_t | verify_noreturn (func_t *pfn) |
static ssize_t | verify_sp (func_t *pfn) |
static ssize_t | create_func_frame (func_t *pfn) |
static ssize_t | get_frame_retsize (int *retsize, const func_t *pfn) |
static ssize_t | analyze_prolog (ea_t fct_ea) |
static ssize_t | calc_spdelta (sval_t *spdelta, const insn_t &ins) |
static ssize_t | calcrel (bytevec_t *out_relbits, size_t *out_consumed, ea_t ea) |
static ssize_t | get_reg_accesses (reg_accesses_t *accvec, const insn_t &insn, int flags) |
static ssize_t | is_control_flow_guard (int *p_reg, const insn_t *insn) |
static ssize_t | find_reg_value (uval_t *out, const insn_t &insn, int reg) |
static ssize_t | find_op_value (uval_t *out, const insn_t &insn, int op) |
static ssize_t | treat_hindering_item (ea_t hindering_item_ea, flags64_t new_item_flags, ea_t new_item_ea, asize_t new_item_length) |
static ssize_t | extract_address (ea_t *out_ea, ea_t screen_ea, const char *string, size_t x) |
static ssize_t | str2reg (const char *regname) |
static ssize_t | is_switch (switch_info_t *si, const insn_t &insn) |
static ssize_t | create_switch_xrefs (ea_t jumpea, const switch_info_t &si) |
static ssize_t | calc_switch_cases (void *casevec, eavec_t *targets, ea_t insn_ea, const switch_info_t &si) |
static ssize_t | get_bg_color (bgcolor_t *color, ea_t ea) |
static ssize_t | validate_flirt_func (ea_t start_ea, const char *funcname) |
static ssize_t | get_operand_string (qstring *buf, const insn_t &insn, int opnum) |
static ssize_t | add_cref (ea_t from, ea_t to, cref_t type) |
static ssize_t | add_dref (ea_t from, ea_t to, dref_t type) |
static ssize_t | del_cref (ea_t from, ea_t to, bool expand) |
static ssize_t | del_dref (ea_t from, ea_t to) |
static ssize_t | coagulate_dref (ea_t from, ea_t to, bool may_define, ea_t *code_ea) |
static const char * | set_idp_options (const char *keyword, int vtype, const void *value, bool idb_loaded=true) |
static ssize_t | set_proc_options (const char *options, int confidence) |
static ssize_t | adjust_libfunc_ea (const idasgn_t &sig, const libfunc_t &libfun, ea_t *ea) |
static fpvalue_error_t | realcvt (void *m, fpvalue_t *e, uint16 swt) |
static ssize_t | adjust_refinfo (refinfo_t *ri, ea_t ea, int n, const fixup_data_t &fd) |
static ssize_t | is_cond_insn (const insn_t &insn) |
static ssize_t | set_code16_mode (ea_t ea, bool code16=true) |
static bool | get_code16_mode (ea_t ea) |
static ssize_t | next_exec_insn (ea_t *target, ea_t ea, int tid, regval_getter_t *_getreg, const regval_t ®values) |
static ssize_t | calc_step_over (ea_t *target, ea_t ip) |
static ssize_t | get_macro_insn_head (ea_t *head, ea_t ip) |
static ssize_t | get_dbr_opnum (int *opnum, const insn_t &insn) |
static ssize_t | insn_reads_tbit (const insn_t &insn, regval_getter_t *_getreg, const regval_t ®values) |
static ssize_t | get_idd_opinfo (idd_opinfo_t *opinf, ea_t ea, int n, int thread_id, regval_getter_t *_getreg, const regval_t ®values) |
static ssize_t | calc_next_eas (eavec_t *res, const insn_t &insn, bool over) |
static ssize_t | clean_tbit (ea_t ea, regval_getter_t *_getreg, const regval_t ®values) |
static const char * | get_reg_info (const char *regname, bitrange_t *bitrange) |
Get register information - useful for registers like al, ah, dil, etc. More... | |
static ssize_t | update_call_stack (call_stack_t *stack, int tid, regval_getter_t *_getreg, const regval_t ®values) |
static ssize_t | setup_til () |
static ssize_t | max_ptr_size () |
static ssize_t | calc_cdecl_purged_bytes (ea_t ea) |
static ssize_t | equal_reglocs (const argloc_t &a1, const argloc_t &a2) |
static ssize_t | decorate_name (qstring *outbuf, const char *name, bool mangle, cm_t cc, const tinfo_t &type) |
static ssize_t | calc_retloc (argloc_t *retloc, const tinfo_t &rettype, cm_t cc) |
static ssize_t | calc_varglocs (func_type_data_t *ftd, regobjs_t *regs, relobj_t *stkargs, int nfixed) |
static ssize_t | calc_arglocs (func_type_data_t *fti) |
static ssize_t | use_stkarg_type (ea_t ea, const funcarg_t &arg) |
static ssize_t | use_regarg_type (int *idx, ea_t ea, void *rargs) |
static ssize_t | use_arg_types (ea_t ea, func_type_data_t *fti, void *rargs) |
static ssize_t | calc_purged_bytes (int *p_purged_bytes, const func_type_data_t &fti) |
static ssize_t | get_stkarg_area_info (stkarg_area_info_t *out, cm_t cc) |
static ssize_t | get_cc_regs (callregs_t *regs, cm_t cc) |
static ssize_t | get_simd_types (void *out, const simd_info_t *simd_attrs, const argloc_t *argloc, bool create_tifs) |
static ssize_t | arg_addrs_ready (ea_t caller, int n, const tinfo_t &tif, ea_t *addrs) |
static ssize_t | adjust_argloc (argloc_t *argloc, const tinfo_t *type, int size) |
static ssize_t | lower_func_type (intvec_t *argnums, func_type_data_t *fti) |
static ssize_t | get_abi_info (qstrvec_t *abi_names, qstrvec_t *abi_opts, comp_t comp) |
static ssize_t | arch_changed () |
static ssize_t | create_merge_handlers (merge_data_t *md) |
Instruction set | |
int32 | instruc_start |
icode of the first instruction | |
int32 | instruc_end |
icode of the last instruction + 1 | |
const instruc_t * | instruc |
Array of instructions. | |
size_t | tbyte_size |
Size of long double (tbyte) for this processor (meaningful only if asm_t::a_tbyte != nullptr) | |
char | real_width [4] |
Number of digits in floating numbers after the decimal point. More... | |
int32 | icode_return |
Icode of return instruction. It is ok to give any of possible return instructions. | |
void * | unused_slot |
Reserved, currently equals to nullptr. | |
bool | is_canon_insn (uint16 itype) const |
Does the given value specify a valid instruction for this instruction set?. More... | |
void | ensure_processor (void) |
size_t | sizeof_ldbl () const |
Get size of long double. | |
bool | is_funcarg_off (const func_t *pfn, uval_t frameoff) const |
Does the given offset lie within the arguments section? | |
sval_t | lvar_off (const func_t *pfn, uval_t frameoff) const |
Does the given offset lie within the local variables section? | |
bool | is_lumina_usable () const |
Detailed Description
Describes a processor module (IDP).
An IDP file may have only one such structure called LPH. The kernel will copy it to ::ph structure and use ::ph.
Member Enumeration Documentation
◆ event_t
enum processor_t::event_t |
Callback notification codes.
These are passed to notify() when certain events occur in the kernel, allowing the processor module to take the appropriate action.
If you are not developing a processor module, you do not need to use the codes directly many of them already have a corresponding function to use instead ( is_call_insn vs is_call_insn(ea_t), for example).
If you are developing a processor module, your notify() function must implement the desired behavior when called with a given code. Not all events need to be handled, some of them are optional.
Enumerator | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ev_init | The IDP module is just loaded.
| ||||||||||||||||||
ev_term | The IDP module is being unloaded. | ||||||||||||||||||
ev_newprc | Before changing processor type.
| ||||||||||||||||||
ev_newasm | Before setting a new assembler.
| ||||||||||||||||||
ev_newfile | A new file has been loaded.
| ||||||||||||||||||
ev_oldfile | An old file has been loaded.
| ||||||||||||||||||
ev_newbinary | IDA is about to load a binary file.
| ||||||||||||||||||
ev_endbinary | IDA has loaded a binary file.
| ||||||||||||||||||
ev_set_idp_options | Set IDP-specific configuration option Also see set_options_t in config.hpp.
| ||||||||||||||||||
ev_set_proc_options | Called if the user specified an option string in the command line: -p<processor name>:<options>. Can be used for setting a processor subtype. Also called if option string is passed to set_processor_type() and IDC's SetProcessorType().
| ||||||||||||||||||
ev_ana_insn | Analyze one instruction and fill 'out' structure. This function shouldn't change the database, flags or anything else. All these actions should be performed only by emu_insn() function. \insn_t{ea} contains address of instruction to analyze.
| ||||||||||||||||||
ev_emu_insn | Emulate instruction, create cross-references, plan to analyze subsequent instructions, modify flags etc. Upon entrance to this function, all information about the instruction is in 'insn' structure.
| ||||||||||||||||||
ev_out_header | Function to produce start of disassembled text.
| ||||||||||||||||||
ev_out_footer | Function to produce end of disassembled text.
| ||||||||||||||||||
ev_out_segstart | Function to produce start of segment.
| ||||||||||||||||||
ev_out_segend | Function to produce end of segment.
| ||||||||||||||||||
ev_out_assumes | Function to produce assume directives when segment register value changes.
| ||||||||||||||||||
ev_out_insn | Generate text representation of an instruction in 'ctx.insn' outctx_t provides functions to output the generated text. This function shouldn't change the database, flags or anything else. All these actions should be performed only by emu_insn() function.
| ||||||||||||||||||
ev_out_mnem | Generate instruction mnemonics. This callback should append the colored mnemonics to ctx.outbuf Optional notification, if absent, out_mnem will be called.
| ||||||||||||||||||
ev_out_operand | Generate text representation of an instruction operand outctx_t provides functions to output the generated text. All these actions should be performed only by emu_insn() function.
| ||||||||||||||||||
ev_out_data | Generate text representation of data items This function may change the database and create cross-references if analyze_only is set.
| ||||||||||||||||||
ev_out_label | The kernel is going to generate an instruction label line or a function header.
| ||||||||||||||||||
ev_out_special_item | Generate text representation of an item in a special segment i.e. absolute symbols, externs, communal definitions etc
| ||||||||||||||||||
ev_gen_stkvar_def | Generate stack variable definition line Default line is varname = type ptr value, where 'type' is one of byte,word,dword,qword,tbyte.
| ||||||||||||||||||
ev_gen_regvar_def | Generate register variable definition line.
| ||||||||||||||||||
ev_gen_src_file_lnnum | Callback: generate analog of: < #line "file.c" 123
<
directive.
| ||||||||||||||||||
ev_creating_segm | A new segment is about to be created.
| ||||||||||||||||||
ev_moving_segm | May the kernel move the segment?
| ||||||||||||||||||
ev_coagulate | Try to define some unexplored bytes. This notification will be called if the kernel tried all possibilities and could not find anything more useful than to convert to array of bytes. The module can help the kernel and convert the bytes into something more useful.
| ||||||||||||||||||
ev_undefine | An item in the database (insn or data) is being deleted.
| ||||||||||||||||||
ev_treat_hindering_item | An item hinders creation of another item.
| ||||||||||||||||||
ev_rename | The kernel is going to rename a byte.
| ||||||||||||||||||
ev_is_far_jump | is indirect far jump or call instruction? meaningful only if the processor has 'near' and 'far' reference types
| ||||||||||||||||||
ev_is_sane_insn | Is the instruction sane for the current file type?.
| ||||||||||||||||||
ev_is_cond_insn | Is conditional instruction?
| ||||||||||||||||||
ev_is_call_insn | Is the instruction a "call"?
| ||||||||||||||||||
ev_is_ret_insn | Is the instruction a "return"?
| ||||||||||||||||||
ev_may_be_func | Can a function start here?
| ||||||||||||||||||
ev_is_basic_block_end | Is the current instruction end of a basic block?. This function should be defined for processors with delayed jump slots.
| ||||||||||||||||||
ev_is_indirect_jump | Determine if instruction is an indirect jump. If CF_JUMP bit cannot describe all jump types jumps, please define this callback.
| ||||||||||||||||||
ev_is_insn_table_jump | Reserved. | ||||||||||||||||||
ev_is_switch | Find 'switch' idiom or override processor module's decision. It will be called for instructions marked with CF_JUMP.
| ||||||||||||||||||
ev_calc_switch_cases | Calculate case values and targets for a custom jump table.
| ||||||||||||||||||
ev_create_switch_xrefs | Create xrefs for a custom jump table.
| ||||||||||||||||||
ev_is_align_insn | Is the instruction created only for alignment purposes?. Do not directly call this function, use is_align_insn()
| ||||||||||||||||||
ev_is_alloca_probe | Does the function at 'ea' behave as __alloca_probe?
| ||||||||||||||||||
ev_delay_slot_insn | Get delay slot instruction.
| ||||||||||||||||||
ev_is_sp_based | Check whether the operand is relative to stack pointer or frame pointer This event is used to determine how to output a stack variable If not implemented, then all operands are sp based by default. Implement this event only if some stack references use frame pointer instead of stack pointer.
| ||||||||||||||||||
ev_can_have_type | Can the operand have a type as offset, segment, decimal, etc? (for example, a register AX can't have a type, meaning that the user can't change its representation. see bytes.hpp for information about types and flags)
| ||||||||||||||||||
ev_cmp_operands | Compare instruction operands.
| ||||||||||||||||||
ev_adjust_refinfo | Called from apply_fixup before converting operand to reference. Can be used for changing the reference info. (e.g. the PPC module adds REFINFO_NOBASE for some references)
| ||||||||||||||||||
ev_get_operand_string | Request text string for operand (cli, java, ...).
| ||||||||||||||||||
ev_get_reg_name | Generate text representation of a register. Most processor modules do not need to implement this callback. It is useful only if processor_t::reg_names[reg] does not provide the correct register name.
| ||||||||||||||||||
ev_str2reg | Convert a register name to a register number. The register number is the register index in the processor_t::reg_names array Most processor modules do not need to implement this callback It is useful only if processor_t::reg_names[reg] does not provide the correct register names
| ||||||||||||||||||
ev_get_autocmt | Callback: get dynamic auto comment. Will be called if the autocomments are enabled and the comment retrieved from ida.int starts with '$!'. 'insn' contains valid info.
| ||||||||||||||||||
ev_get_bg_color | Get item background color. Plugins can hook this callback to color disassembly lines dynamically
| ||||||||||||||||||
ev_is_jump_func | Is the function a trivial "jump" function?.
| ||||||||||||||||||
ev_func_bounds | find_func_bounds() finished its work. The module may fine tune the function bounds
| ||||||||||||||||||
ev_verify_sp | All function instructions have been analyzed. Now the processor module can analyze the stack pointer for the whole function
| ||||||||||||||||||
ev_verify_noreturn | The kernel wants to set 'noreturn' flags for a function.
| ||||||||||||||||||
ev_create_func_frame | Create a function frame for a newly created function Set up frame size, its attributes etc.
| ||||||||||||||||||
ev_get_frame_retsize | Get size of function return address in bytes If this event is not implemented, the kernel will assume.
| ||||||||||||||||||
ev_get_stkvar_scale_factor | Should stack variable references be multiplied by a coefficient before being used in the stack frame?. Currently used by TMS320C55 because the references into the stack should be multiplied by 2
| ||||||||||||||||||
ev_demangle_name | Demangle a C++ (or another language) name into a user-readable string. This event is called by demangle_name()
| ||||||||||||||||||
ev_add_cref | A code reference is being created.
| ||||||||||||||||||
ev_add_dref | A data reference is being created.
| ||||||||||||||||||
ev_del_cref | A code reference is being deleted.
| ||||||||||||||||||
ev_del_dref | A data reference is being deleted.
| ||||||||||||||||||
ev_coagulate_dref | Data reference is being analyzed. plugin may correct 'code_ea' (e.g. for thumb mode refs, we clear the last bit)
| ||||||||||||||||||
ev_may_show_sreg | The kernel wants to display the segment registers in the messages window.
| ||||||||||||||||||
ev_loader_elf_machine | ELF loader machine type checkpoint. A plugin check of the 'machine_type'. If it is the desired one, the the plugin fills 'p_procname' with the processor name (one of the names present in processor_t::psnames). 'p_pd' is used to handle relocations, otherwise can be left untouched. This event occurs for each newly loaded ELF file
| ||||||||||||||||||
ev_auto_queue_empty | One analysis queue is empty.
| ||||||||||||||||||
ev_validate_flirt_func | Flirt has recognized a library function. This callback can be used by a plugin or proc module to intercept it and validate such a function.
| ||||||||||||||||||
ev_adjust_libfunc_ea | Called when a signature module has been matched against bytes in the database. This is used to compute the offset at which a particular module's libfunc should be applied.
| ||||||||||||||||||
ev_assemble | Assemble an instruction. (display a warning if an error is found).
| ||||||||||||||||||
ev_extract_address | Extract address from a string.
| ||||||||||||||||||
ev_realcvt | Floating point -> IEEE conversion.
ref REAL_ERROR_ on error | ||||||||||||||||||
ev_gen_asm_or_lst | Callback: generating asm or lst file. The kernel calls this callback twice, at the beginning and at the end of listing generation. The processor module can intercept this event and adjust its output
| ||||||||||||||||||
ev_gen_map_file | Generate map file. If not implemented the kernel itself will create the map file.
| ||||||||||||||||||
ev_create_flat_group | Create special segment representing the flat group.
| ||||||||||||||||||
ev_getreg | IBM PC only internal request, should never be used for other purpose Get register value by internal index.
| ||||||||||||||||||
ev_analyze_prolog | Analyzes function prolog, epilog, and updates purge, and function attributes.
| ||||||||||||||||||
ev_calc_spdelta | Calculate amount of change to sp for the given insn. This event is required to decompile code snippets.
| ||||||||||||||||||
ev_calcrel | Reserved. | ||||||||||||||||||
ev_find_reg_value | Find register value via a register tracker. The returned value in 'out' is valid before executing the instruction.
| ||||||||||||||||||
ev_find_op_value | Find operand value via a register tracker. The returned value in 'out' is valid before executing the instruction.
| ||||||||||||||||||
ev_replaying_undo | Replaying an undo/redo buffer.
| ||||||||||||||||||
ev_ending_undo | Ended undoing/redoing an action.
| ||||||||||||||||||
ev_set_code16_mode | Some processors have ISA 16-bit mode e.g. ARM Thumb mode, PPC VLE, MIPS16 Set ISA 16-bit mode
| ||||||||||||||||||
ev_get_code16_mode | Get ISA 16-bit mode.
| ||||||||||||||||||
ev_get_procmod | Get pointer to the processor module object. All processor modules must implement this. The pointer is returned as size_t. | ||||||||||||||||||
ev_asm_installed | After setting a new assembler.
| ||||||||||||||||||
ev_get_reg_accesses | Get info about the registers that are used/changed by an instruction.
| ||||||||||||||||||
ev_is_control_flow_guard | Detect if an instruction is a "thunk call" to a flow guard function (equivalent to call reg/return/nop)
| ||||||||||||||||||
ev_broadcast | Broadcast call.
| ||||||||||||||||||
ev_create_merge_handlers | Create merge handlers, if needed.
| ||||||||||||||||||
ev_privrange_changed | Privrange interval has been moved to a new location. Most common actions to be done by module in this case: fix indices of netnodes used by module
| ||||||||||||||||||
ev_last_cb_before_debugger | START OF DEBUGGER CALLBACKS. | ||||||||||||||||||
ev_next_exec_insn | Get next address to be executed This function must return the next address to be executed. If the instruction following the current one is executed, then it must return BADADDR Usually the instructions to consider are: jumps, branches, calls, returns. This function is essential if the 'single step' is not supported in hardware.
| ||||||||||||||||||
ev_calc_step_over | Calculate the address of the instruction which will be executed after "step over". The kernel will put a breakpoint there. If the step over is equal to step into or we cannot calculate the address, return BADADDR.
| ||||||||||||||||||
ev_calc_next_eas | Calculate list of addresses the instruction in 'insn' may pass control to. This callback is required for source level debugging.
| ||||||||||||||||||
ev_get_macro_insn_head | Calculate the start of a macro instruction. This notification is called if IP points to the middle of an instruction
| ||||||||||||||||||
ev_get_dbr_opnum | Get the number of the operand to be displayed in the debugger reference view (text mode).
| ||||||||||||||||||
ev_insn_reads_tbit | Check if insn will read the TF bit.
| ||||||||||||||||||
ev_clean_tbit | Clear the TF bit after an insn like pushf stored it in memory.
| ||||||||||||||||||
ev_get_idd_opinfo | Get operand information. This callback is used to calculate the operand value for double clicking on it, hints, etc.
| ||||||||||||||||||
ev_get_reg_info | Get register information by its name. example: "ah" returns:
This callback may be unimplemented if the register names are all present in processor_t::reg_names and they all have the same size
| ||||||||||||||||||
ev_update_call_stack | Calculate the call stack trace for the given thread. This callback is invoked when the process is suspended and should fill the 'trace' object with the information about the current call stack. Note that this callback is NOT invoked if the current debugger backend implements stack tracing via debugger_t::event_t::ev_update_call_stack. The debugger-specific algorithm takes priority. Implementing this callback in the processor module is useful when multiple debugging platforms follow similar patterns, and thus the same processor-specific algorithm can be used for different platforms.
| ||||||||||||||||||
ev_setup_til | Setup default type libraries. (called after loading a new file into the database). The processor module may load tils, setup memory model and perform other actions required to set up the type system. This is an optional callback.
| ||||||||||||||||||
ev_get_abi_info | Get all possible ABI names and optional extensions for given compiler abiname/option is a string entirely consisting of letters, digits and underscore.
| ||||||||||||||||||
ev_max_ptr_size | Get maximal size of a pointer in bytes.
| ||||||||||||||||||
ev_get_default_enum_size | Get default enum size. Not generated anymore. inf_get_cc_size_e() is used instead | ||||||||||||||||||
ev_get_cc_regs | Get register allocation convention for given calling convention.
| ||||||||||||||||||
ev_obsolete1 | ev_get_stkarg_offset is obsolete. See ev_get_stkarg_area_info | ||||||||||||||||||
ev_obsolete2 | ev_shadow_args_size is obsolete. See ev_get_stkarg_area_info | ||||||||||||||||||
ev_get_simd_types | Get SIMD-related types according to given attributes ant/or argument location.
| ||||||||||||||||||
ev_calc_cdecl_purged_bytes | Calculate number of purged bytes after call.
| ||||||||||||||||||
ev_calc_purged_bytes | Calculate number of purged bytes by the given function type.
| ||||||||||||||||||
ev_calc_retloc | Calculate return value location.
| ||||||||||||||||||
ev_calc_arglocs | Calculate function argument locations. This callback should fill retloc, all arglocs, and stkargs. This callback is never called for CM_CC_SPECIAL functions.
| ||||||||||||||||||
ev_calc_varglocs | Calculate locations of the arguments that correspond to '...'.
| ||||||||||||||||||
ev_adjust_argloc | Adjust argloc according to its type/size and platform endianess.
| ||||||||||||||||||
ev_lower_func_type | Get function arguments which should be converted to pointers when lowering function prototype. The processor module can also modify 'fti' in order to make non-standard conversion of some arguments.
| ||||||||||||||||||
ev_equal_reglocs | Are 2 register arglocs the same?. We need this callback for the pc module.
| ||||||||||||||||||
ev_use_stkarg_type | Use information about a stack argument.
| ||||||||||||||||||
ev_use_regarg_type | Use information about register argument.
| ||||||||||||||||||
ev_use_arg_types | Use information about callee arguments.
| ||||||||||||||||||
ev_arg_addrs_ready | Argument address info is ready.
| ||||||||||||||||||
ev_decorate_name | Decorate/undecorate a C symbol name.
| ||||||||||||||||||
ev_arch_changed | The loader is done parsing arch-related information, which the processor module might want to use to finish its initialization.
| ||||||||||||||||||
ev_get_stkarg_area_info | Get some metrics of the stack argument area.
| ||||||||||||||||||
ev_loader | This code and higher ones are reserved for the loaders. The arguments and the return values are defined by the loaders |
Member Function Documentation
◆ get_default_segm_bitness()
|
inline |
Get default segment bitness.
- Return values
-
2 PR_DEFSEG64 1 PR_DEFSEG32 0 none specified
◆ get_proc_index()
|
inline |
- Return values
-
currently selected processor subtype (index into psnames/plnames)
◆ get_reg_info()
|
inlinestatic |
Get register information - useful for registers like al, ah, dil, etc.
Example: this function for "al" returns "eax" in 32bit mode
- Returns
- main register name (nullptr no such register)
◆ get_stkvar_scale()
|
inline |
Get the stack variable scaling factor.
Useful for processors who refer to the stack with implicit scaling factor. TMS320C55 for example: SP(#1) really refers to (SP+2)
◆ is_canon_insn()
|
inline |
Does the given value specify a valid instruction for this instruction set?.
See instruc_start and instruc_end
Member Data Documentation
◆ cnbits
int32 processor_t::cnbits |
Number of bits in a byte for code segments (usually 8).
IDA supports values up to supported address bits size
◆ dnbits
int32 processor_t::dnbits |
Number of bits in a byte for non-code segments (usually 8).
IDA supports values up to supported address bit size
◆ psnames
const char* const* processor_t::psnames |
short processor names (nullptr terminated).
Each name should be shorter than 9 characters
◆ plnames
const char* const* processor_t::plnames |
long processor names (nullptr terminated).
No restriction on name lengths.
◆ assemblers
const asm_t* const* processor_t::assemblers |
pointer to array of target
assembler definitions. You may change this array when current processor is changed. (nullptr terminated)
◆ codestart
const bytes_t* processor_t::codestart |
Array of typical code start sequences.
This array is used when a new file is loaded to find the beginnings of code sequences. This array is terminated with a zero length item.
◆ retcodes
const bytes_t* processor_t::retcodes |
Array of 'return' instruction opcodes.
This array is used to determine form of autogenerated locret_... labels. The last item of it should be { 0, nullptr } This array may be nullptr Better way of handling return instructions is to define the is_ret_insn callback in the notify() function
◆ real_width
char processor_t::real_width[4] |
Number of digits in floating numbers after the decimal point.
If an element of this array equals 0, then the corresponding floating point data is not used for the processor. This array is used to align numbers in the output.
- real_width[0] - number of digits for short floats (only PDP-11 has them)
- real_width[1] - number of digits for "float"
- real_width[2] - number of digits for "double"
- real_width[3] - number of digits for "long double"
Example: IBM PC module has { 0,7,15,19 }
The documentation for this struct was generated from the following files:
Generated by