Zydis: include/Zydis/Disassembler.h Source File

Zydis v4.1.0

Loading...
Searching...
No Matches
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
39extern "C" {
40#endif
41
42/* ============================================================================================== */
43/* Types */
44/* ============================================================================================== */
45
51 typedef struct ZydisDisassembledInstruction_
52{
56 ZyanU64 runtime_address;
60 ZydisDecodedInstruction info;
70 ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
76 char text[96];
77} ZydisDisassembledInstruction;
78
79/* ============================================================================================== */
80/* Exported functions */
81/* ============================================================================================== */
82
116 ZYDIS_EXPORT ZyanStatus ZydisDisassembleIntel(ZydisMachineMode machine_mode,
117 ZyanU64 runtime_address, const void* buffer, ZyanUSize length,
118 ZydisDisassembledInstruction *instruction);
119
125 ZYDIS_EXPORT ZyanStatus ZydisDisassembleATT(ZydisMachineMode machine_mode,
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 */
Decoder.h
Functions for decoding instructions.
ZYDIS_EXPORT
#define ZYDIS_EXPORT
Symbol is exported in shared library builds.
Definition Defines.h:67
ZydisDisassembleATT
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).
ZydisDisassembledInstruction
struct ZydisDisassembledInstruction_ ZydisDisassembledInstruction
All commonly used information about a decoded instruction that Zydis can provide.
ZydisDisassembleIntel
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).
Formatter.h
Functions for formatting instructions to human-readable text.
ZYDIS_MAX_OPERAND_COUNT
#define ZYDIS_MAX_OPERAND_COUNT
Definition SharedTypes.h:50
ZydisMachineMode
enum ZydisMachineMode_ ZydisMachineMode
Defines the ZydisMachineMode enum.
ZydisDecodedInstruction_
Information about a decoded instruction.
Definition DecoderTypes.h:1238
ZydisDecodedOperand_
Defines the ZydisDecodedOperand struct.
Definition DecoderTypes.h:200
ZydisDisassembledInstruction_
All commonly used information about a decoded instruction that Zydis can provide.
Definition Disassembler.h:52
ZydisDisassembledInstruction_::runtime_address
ZyanU64 runtime_address
The runtime address that was passed when disassembling the instruction.
Definition Disassembler.h:56
ZydisDisassembledInstruction_::text
char text[96]
The textual, human-readable representation of the instruction.
Definition Disassembler.h:76
ZydisDisassembledInstruction_::operands
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT]
The operands of the decoded instruction in a machine-readable format.
Definition Disassembler.h:70
ZydisDisassembledInstruction_::info
ZydisDecodedInstruction info
General information about the decoded instruction in machine-readable format.
Definition Disassembler.h:60