fcml  1.2.2
Classes | Macros | Typedefs | Functions
fcml_renderer.h File Reference

Structures and functions declarations related to FCML renderers. More...

#include "fcml_lib_export.h"
#include "fcml_types.h"
#include "fcml_errors.h"
#include "fcml_dialect.h"
#include "fcml_disassembler.h"
Include dependency graph for fcml_renderer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fcml_st_render_config
 Renderer configuration. More...
 

Macros

#define FCML_REND_MAX_BUFF_LEN   512
 The rendered instruction size can not exceed this value. More...
 
#define FCML_REND_FLAG_RENDER_CODE   0x00000001
 Render the instruction code as HEX string. More...
 
#define FCML_REND_FLAG_HEX_IMM   0x00000002
 Render the immediate operand as HEX integer. More...
 
#define FCML_REND_FLAG_RENDER_DEFAULT_SEG   0x00000004
 Render the segment code register even if it is a default one. More...
 
#define FCML_REND_FLAG_HEX_DISPLACEMENT   0x00000008
 Render the displacement value as HEX integer. More...
 
#define FCML_REND_FLAG_COND_GROUP_1   0x00000010
 Render the conditional mnemonics using suffixes from first group. More...
 
#define FCML_REND_FLAG_COND_GROUP_2   0x00000020
 Render the conditional mnemonics using suffixes from second group. More...
 
#define FCML_REND_FLAG_COND_SHOW_CARRY   0x00000040
 Render the conditional mnemonics using suffixes for 'carry'. More...
 
#define FCML_REND_FLAG_RENDER_SIB_HINT   0x00000080
 Render SIB operand hints. More...
 
#define FCML_REND_FLAG_RENDER_ABS_HINT   0x00000100
 Render ABS (Absolute offset) operand hints. More...
 
#define FCML_REND_FLAG_RENDER_REL_HINT   0x00000200
 Render REL (Relative offset) operand hints. More...
 
#define FCML_REND_FLAG_RENDER_INDIRECT_HINT   0x00000400
 Render hints for absolute addressing. More...
 
#define FCML_REND_FLAG_REP_PREFIX_GROUP_1   0x00000800
 Renders repetition prefixes using the first group (repe,repne). More...
 
#define FCML_REND_FLAG_REP_PREFIX_GROUP_2   0x00001000
 Renders repetition prefixes using the second group (repz,repnz). More...
 
#define FCML_REND_FLAG_CODE_PADDING   0x00002000
 Renders the code padding between the instruction code and the mnemonic. More...
 
#define FCML_REND_FLAG_MNEMONIC_PADDING   0x00004000
 Renders the mnemonic padding between the mnemonic and the operands. More...
 
#define FCML_REND_FLAG_REMOVE_LEADING_ZEROS   0x00008000
 Should be used only with FCML_REND_FLAG_HEX_IMM and FCML_REND_FLAG_ HEX_DISPLACEMENT flags. More...
 
#define FCML_REND_DEFAULT_FLAGS   0
 Default set of the rendering flags. More...
 
#define FCML_REND_DEFAULT_CODE_PADDING   8
 Default number of characters used as code padding. More...
 
#define FCML_REND_DEFAULT_MNEMONIC_PADDING   8
 Default number of characters used as mnemonic padding. More...
 

Typedefs

typedef struct fcml_st_render_config fcml_st_render_config
 Renderer configuration. More...
 

Functions

LIB_EXPORT fcml_ceh_error LIB_CALL fcml_fn_render (const fcml_st_dialect *dialect, const fcml_st_render_config *config, fcml_char *buffer, fcml_usize buffer_len, const fcml_st_disassembler_result *result)
 Renders the disassembled instruction into its textual representation. More...
 

Detailed Description

Structures and functions declarations related to FCML renderers.

Macro Definition Documentation

◆ FCML_REND_MAX_BUFF_LEN

#define FCML_REND_MAX_BUFF_LEN   512

The rendered instruction size can not exceed this value.

Typedef Documentation

◆ fcml_st_render_config

Renderer configuration.

Function Documentation

◆ fcml_fn_render()

LIB_EXPORT fcml_ceh_error LIB_CALL fcml_fn_render ( const fcml_st_dialect dialect,
const fcml_st_render_config config,
fcml_char *  buffer,
fcml_usize  buffer_len,
const fcml_st_disassembler_result result 
)

Renders the disassembled instruction into its textual representation.

Prepares textual representation of the disassembled code using syntax based on the provided dialect.

Parameters
dialectDialect instance.
configRenderer configuration.
[out]bufferDestination buffer for the generated instruction.
buffer_lenSize of the destination buffer.
resultDisassembled instruction.
Returns
Error code or FCML_CEH_GEC_NO_ERROR.