IDA SDK
Public Member Functions | Public Attributes | List of all members
macro_constructor_t Struct Referenceabstract

Helper class for processor modules to build macro instructions. More...

#include <ua.hpp>

Public Member Functions

virtual bool idaapi build_macro (insn_t *insn, bool may_go_forward)=0
 Try to extend the instruction. More...
 
Address translation

The following functions can be used by processor modules to map addresses from one region to another.

They are especially useful for microprocessors that map the same memory region to multiple address ranges or use memory bank switching. The user can use the following techniques to desribe address translations:

  • some processors support the segment transation feature. the user can specify the mapping in Edit, Segments, Change segment translation
  • the user can specify mapping for an individual direct call instruction by specifying it as an offset (Edit, Operand types, Offset)
  • specify the value of the data segment virtual register (ds). it will be used to calculate data addresses
bool construct_macro (insn_t *insn, bool enable)
 Construct a macro instruction. More...
 

Public Attributes

size_t reserved = 0
 

Detailed Description

Helper class for processor modules to build macro instructions.

Member Function Documentation

◆ construct_macro()

bool macro_constructor_t::construct_macro ( insn_t insn,
bool  enable 
)
inline

Construct a macro instruction.

This function may be called from ana() to generate a macro instruction.

The real work is done by the 'build_macro()' virtual function. It must be defined by the processor module.

construct_macro() modifies the database using the info provided by build_macro(). It verifies if the instruction can really be created (for example, that other items do not hinder), may plan to reanalyze the macro, etc. If the macro instructions are disabled by the user, construct_macro() will destroy the macro instruction. Note: if INSN_MODMAC is not set in insn.flags, the database will not be modified.

Parameters
insnthe instruction to modify into a macro
enableenable macro generation
Return values
truethe macro instruction is generated in 'insn'
falsedid not create a macro

◆ build_macro()

virtual bool idaapi macro_constructor_t::build_macro ( insn_t insn,
bool  may_go_forward 
)
pure virtual

Try to extend the instruction.

Parameters
insnInstruction to modify, usually the first instruction of the macro
may_go_forwardIs it ok to consider the next instruction for the macro? This argument may be false, for example, if there is a cross reference to the end of INSN. In this case creating a macro is not desired. However, it may still be useful to perform minor tweaks to the instruction using the information about the surrounding instructions.
Returns
true if created an macro instruction. This function may modify 'insn' and return false; these changes will be accepted by the kernel but the instruction will not be considered as a macro.

The documentation for this struct was generated from the following file: