Zydis  master
Disassembler.h
Go to the documentation of this file.
1 /***************************************************************************************************
2 
3  Zyan Disassembler Library (Zydis)
4 
5  Original Author : Joel Hoener
6 
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in all
15  * copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24 
25 ***************************************************************************************************/
26 
32 #ifndef ZYDIS_DISASSEMBLER_H
33 #define ZYDIS_DISASSEMBLER_H
34 
35 #include <Zydis/Decoder.h>
36 #include <Zydis/Formatter.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /* ============================================================================================== */
43 /* Types */
44 /* ============================================================================================== */
45 
52 {
56  ZyanU64 runtime_address;
76  char text[96];
78 
79 /* ============================================================================================== */
80 /* Exported functions */
81 /* ============================================================================================== */
82 
117  ZyanU64 runtime_address, const void* buffer, ZyanUSize length,
118  ZydisDisassembledInstruction *instruction);
119 
126  ZyanU64 runtime_address, const void* buffer, ZyanUSize length,
127  ZydisDisassembledInstruction *instruction);
128 
129 /* ============================================================================================== */
130 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif /* ZYDIS_DISASSEMBLER_H */
Functions for decoding instructions.
#define ZYDIS_EXPORT
Symbol is exported in shared library builds.
Definition: Defines.h:67
ZYDIS_EXPORT ZyanStatus ZydisDisassembleATT(ZydisMachineMode machine_mode, ZyanU64 runtime_address, const void *buffer, ZyanUSize length, ZydisDisassembledInstruction *instruction)
Disassemble an instruction and format it to human-readable text in a single step (AT&T syntax).
struct ZydisDisassembledInstruction_ ZydisDisassembledInstruction
All commonly used information about a decoded instruction that Zydis can provide.
ZYDIS_EXPORT ZyanStatus ZydisDisassembleIntel(ZydisMachineMode machine_mode, ZyanU64 runtime_address, const void *buffer, ZyanUSize length, ZydisDisassembledInstruction *instruction)
Disassemble an instruction and format it to human-readable text in a single step (Intel syntax).
Functions for formatting instructions to human-readable text.
#define ZYDIS_MAX_OPERAND_COUNT
Definition: SharedTypes.h:50
enum ZydisMachineMode_ ZydisMachineMode
Defines the ZydisMachineMode enum.
Information about a decoded instruction.
Definition: DecoderTypes.h:1252
Defines the ZydisDecodedOperand struct.
Definition: DecoderTypes.h:214
All commonly used information about a decoded instruction that Zydis can provide.
Definition: Disassembler.h:52
ZyanU64 runtime_address
The runtime address that was passed when disassembling the instruction.
Definition: Disassembler.h:56
char text[96]
The textual, human-readable representation of the instruction.
Definition: Disassembler.h:76
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT]
The operands of the decoded instruction in a machine-readable format.
Definition: Disassembler.h:70
ZydisDecodedInstruction info
General information about the decoded instruction in machine-readable format.
Definition: Disassembler.h:60