Latest available version: IDA and decompilers v8.4.240320sp1 see all releases
Hex-Rays logo State-of-the-art binary code analysis tools
email icon
macro_constructor_t Struct Referenceabstract

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

#include <ua.hpp>

Public Member Functions

bool construct_macro (insn_t *insn, bool enable)
 Construct a macro instruction. More...
 
virtual bool idaapi build_macro (insn_t *insn, bool may_go_forward)=0
 Try to extend the 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: