fcml
1.3.0
Toggle main menu visibility
Loading...
Searching...
No Matches
fcml_renderer.h
Go to the documentation of this file.
1
/*
2
* FCML - Free Code Manipulation Library.
3
* Copyright (C) 2010-2020 Slawomir Wojtasiak
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
26
27
#ifndef FCML_REND_H_
28
#define FCML_REND_H_
29
30
#include "
fcml_lib_export.h
"
31
32
#include "
fcml_types.h
"
33
#include "
fcml_errors.h
"
34
#include "
fcml_dialect.h
"
35
#include "
fcml_disassembler.h
"
36
37
#ifdef __cplusplus
38
extern
"C"
{
39
#endif
40
42
#define FCML_REND_MAX_BUFF_LEN 512
43
48
50
#define FCML_REND_FLAG_RENDER_CODE 0x00000001
52
#define FCML_REND_FLAG_HEX_IMM 0x00000002
54
#define FCML_REND_FLAG_RENDER_DEFAULT_SEG 0x00000004
56
#define FCML_REND_FLAG_HEX_DISPLACEMENT 0x00000008
58
#define FCML_REND_FLAG_COND_GROUP_1 0x00000010
60
#define FCML_REND_FLAG_COND_GROUP_2 0x00000020
62
#define FCML_REND_FLAG_COND_SHOW_CARRY 0x00000040
64
#define FCML_REND_FLAG_RENDER_SIB_HINT 0x00000080
66
#define FCML_REND_FLAG_RENDER_ABS_HINT 0x00000100
68
#define FCML_REND_FLAG_RENDER_REL_HINT 0x00000200
70
#define FCML_REND_FLAG_RENDER_INDIRECT_HINT 0x00000400
72
#define FCML_REND_FLAG_REP_PREFIX_GROUP_1 0x00000800
74
#define FCML_REND_FLAG_REP_PREFIX_GROUP_2 0x00001000
76
#define FCML_REND_FLAG_CODE_PADDING 0x00002000
78
#define FCML_REND_FLAG_MNEMONIC_PADDING 0x00004000
81
#define FCML_REND_FLAG_REMOVE_LEADING_ZEROS 0x00008000
82
84
#define FCML_REND_DEFAULT_FLAGS 0
86
#define FCML_REND_DEFAULT_CODE_PADDING 8
88
#define FCML_REND_DEFAULT_MNEMONIC_PADDING 8
89
91
93
typedef
struct
fcml_st_render_config
{
95
fcml_uint32_t
render_flags
;
97
fcml_uint16_t
prefered_mnemonic_padding
;
99
fcml_uint16_t
prefered_code_padding
;
100
}
fcml_st_render_config
;
101
115
LIB_EXPORT
fcml_ceh_error
LIB_CALL
fcml_fn_render
(
116
const
fcml_st_dialect
*dialect,
const
fcml_st_render_config
*config,
117
fcml_char *buffer, fcml_usize buffer_len,
118
const
fcml_st_disassembler_result
*result);
119
120
#ifdef __cplusplus
121
}
122
#endif
123
124
#endif
/* FCML_REND_H_ */
fcml_dialect.h
Structures and functions related to dialects.
fcml_st_dialect
struct fcml_st_dialect fcml_st_dialect
Assembler dialect.
Definition
fcml_dialect.h:36
fcml_disassembler.h
Structures and functions declarations related to FCML disassembler.
fcml_errors.h
Global error handling related declarations.
fcml_ceh_error
fcml_uint16_t fcml_ceh_error
All error codes should be held in variables of this type.
Definition
fcml_errors.h:156
fcml_lib_export.h
Handles Win32 DLL symbols importing/exporting.
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.
fcml_types.h
Types declarations.
fcml_st_disassembler_result
Reusable disassembler result holder.
Definition
fcml_disassembler.h:268
fcml_st_render_config
Renderer configuration.
Definition
fcml_renderer.h:93
fcml_st_render_config::prefered_code_padding
fcml_uint16_t prefered_code_padding
Preferred code padding in HEX bytes (2 characters on one byte.).
Definition
fcml_renderer.h:99
fcml_st_render_config::prefered_mnemonic_padding
fcml_uint16_t prefered_mnemonic_padding
Preferred mnemonic padding in characters.
Definition
fcml_renderer.h:97
fcml_st_render_config::render_flags
fcml_uint32_t render_flags
Flags which allows to control rendering process.
Definition
fcml_renderer.h:95
include
fcml_renderer.h
Generated by
1.17.0