X86DisassemblerDecoder.h
Go to the documentation of this file.
1 /*===-- X86DisassemblerDecoderInternal.h - Disassembler decoder ---*- C -*-===*
2  *
3  * The LLVM Compiler Infrastructure
4  *
5  * This file is distributed under the University of Illinois Open Source
6  * License. See LICENSE.TXT for details.
7  *
8  *===----------------------------------------------------------------------===*
9  *
10  * This file is part of the X86 Disassembler.
11  * It contains the public interface of the instruction decoder.
12  * Documentation for the disassembler can be found in X86Disassembler.h.
13  *
14  *===----------------------------------------------------------------------===*/
15 
16 /* Capstone Disassembly Engine */
17 /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
18 
19 #ifndef CS_X86_DISASSEMBLERDECODER_H
20 #define CS_X86_DISASSEMBLERDECODER_H
21 
22 #if defined(CAPSTONE_HAS_OSXKERNEL)
23 #include <libkern/libkern.h>
24 #else
25 #include <stdio.h>
26 #endif
27 
29 
30 /*
31  * Accessor functions for various fields of an Intel instruction
32  */
33 #define modFromModRM(modRM) (((modRM) & 0xc0) >> 6)
34 #define regFromModRM(modRM) (((modRM) & 0x38) >> 3)
35 #define rmFromModRM(modRM) ((modRM) & 0x7)
36 #define scaleFromSIB(sib) (((sib) & 0xc0) >> 6)
37 #define indexFromSIB(sib) (((sib) & 0x38) >> 3)
38 #define baseFromSIB(sib) ((sib) & 0x7)
39 #define wFromREX(rex) (((rex) & 0x8) >> 3)
40 #define rFromREX(rex) (((rex) & 0x4) >> 2)
41 #define xFromREX(rex) (((rex) & 0x2) >> 1)
42 #define bFromREX(rex) ((rex) & 0x1)
43 
44 #define rFromEVEX2of4(evex) (((~(evex)) & 0x80) >> 7)
45 #define xFromEVEX2of4(evex) (((~(evex)) & 0x40) >> 6)
46 #define bFromEVEX2of4(evex) (((~(evex)) & 0x20) >> 5)
47 #define r2FromEVEX2of4(evex) (((~(evex)) & 0x10) >> 4)
48 #define mmFromEVEX2of4(evex) ((evex) & 0x3)
49 #define wFromEVEX3of4(evex) (((evex) & 0x80) >> 7)
50 #define vvvvFromEVEX3of4(evex) (((~(evex)) & 0x78) >> 3)
51 #define ppFromEVEX3of4(evex) ((evex) & 0x3)
52 #define zFromEVEX4of4(evex) (((evex) & 0x80) >> 7)
53 #define l2FromEVEX4of4(evex) (((evex) & 0x40) >> 6)
54 #define lFromEVEX4of4(evex) (((evex) & 0x20) >> 5)
55 #define bFromEVEX4of4(evex) (((evex) & 0x10) >> 4)
56 #define v2FromEVEX4of4(evex) (((~evex) & 0x8) >> 3)
57 #define aaaFromEVEX4of4(evex) ((evex) & 0x7)
58 
59 #define rFromVEX2of3(vex) (((~(vex)) & 0x80) >> 7)
60 #define xFromVEX2of3(vex) (((~(vex)) & 0x40) >> 6)
61 #define bFromVEX2of3(vex) (((~(vex)) & 0x20) >> 5)
62 #define mmmmmFromVEX2of3(vex) ((vex) & 0x1f)
63 #define wFromVEX3of3(vex) (((vex) & 0x80) >> 7)
64 #define vvvvFromVEX3of3(vex) (((~(vex)) & 0x78) >> 3)
65 #define lFromVEX3of3(vex) (((vex) & 0x4) >> 2)
66 #define ppFromVEX3of3(vex) ((vex) & 0x3)
67 
68 #define rFromVEX2of2(vex) (((~(vex)) & 0x80) >> 7)
69 #define vvvvFromVEX2of2(vex) (((~(vex)) & 0x78) >> 3)
70 #define lFromVEX2of2(vex) (((vex) & 0x4) >> 2)
71 #define ppFromVEX2of2(vex) ((vex) & 0x3)
72 
73 #define rFromXOP2of3(xop) (((~(xop)) & 0x80) >> 7)
74 #define xFromXOP2of3(xop) (((~(xop)) & 0x40) >> 6)
75 #define bFromXOP2of3(xop) (((~(xop)) & 0x20) >> 5)
76 #define mmmmmFromXOP2of3(xop) ((xop) & 0x1f)
77 #define wFromXOP3of3(xop) (((xop) & 0x80) >> 7)
78 #define vvvvFromXOP3of3(vex) (((~(vex)) & 0x78) >> 3)
79 #define lFromXOP3of3(xop) (((xop) & 0x4) >> 2)
80 #define ppFromXOP3of3(xop) ((xop) & 0x3)
81 
82 /*
83  * These enums represent Intel registers for use by the decoder.
84  */
85 
86 #define REGS_8BIT \
87  ENTRY(AL) \
88  ENTRY(CL) \
89  ENTRY(DL) \
90  ENTRY(BL) \
91  ENTRY(AH) \
92  ENTRY(CH) \
93  ENTRY(DH) \
94  ENTRY(BH) \
95  ENTRY(R8B) \
96  ENTRY(R9B) \
97  ENTRY(R10B) \
98  ENTRY(R11B) \
99  ENTRY(R12B) \
100  ENTRY(R13B) \
101  ENTRY(R14B) \
102  ENTRY(R15B) \
103  ENTRY(SPL) \
104  ENTRY(BPL) \
105  ENTRY(SIL) \
106  ENTRY(DIL)
107 
108 #define EA_BASES_16BIT \
109  ENTRY(BX_SI) \
110  ENTRY(BX_DI) \
111  ENTRY(BP_SI) \
112  ENTRY(BP_DI) \
113  ENTRY(SI) \
114  ENTRY(DI) \
115  ENTRY(BP) \
116  ENTRY(BX) \
117  ENTRY(R8W) \
118  ENTRY(R9W) \
119  ENTRY(R10W) \
120  ENTRY(R11W) \
121  ENTRY(R12W) \
122  ENTRY(R13W) \
123  ENTRY(R14W) \
124  ENTRY(R15W)
125 
126 #define REGS_16BIT \
127  ENTRY(AX) \
128  ENTRY(CX) \
129  ENTRY(DX) \
130  ENTRY(BX) \
131  ENTRY(SP) \
132  ENTRY(BP) \
133  ENTRY(SI) \
134  ENTRY(DI) \
135  ENTRY(R8W) \
136  ENTRY(R9W) \
137  ENTRY(R10W) \
138  ENTRY(R11W) \
139  ENTRY(R12W) \
140  ENTRY(R13W) \
141  ENTRY(R14W) \
142  ENTRY(R15W)
143 
144 #define EA_BASES_32BIT \
145  ENTRY(EAX) \
146  ENTRY(ECX) \
147  ENTRY(EDX) \
148  ENTRY(EBX) \
149  ENTRY(sib) \
150  ENTRY(EBP) \
151  ENTRY(ESI) \
152  ENTRY(EDI) \
153  ENTRY(R8D) \
154  ENTRY(R9D) \
155  ENTRY(R10D) \
156  ENTRY(R11D) \
157  ENTRY(R12D) \
158  ENTRY(R13D) \
159  ENTRY(R14D) \
160  ENTRY(R15D)
161 
162 #define REGS_32BIT \
163  ENTRY(EAX) \
164  ENTRY(ECX) \
165  ENTRY(EDX) \
166  ENTRY(EBX) \
167  ENTRY(ESP) \
168  ENTRY(EBP) \
169  ENTRY(ESI) \
170  ENTRY(EDI) \
171  ENTRY(R8D) \
172  ENTRY(R9D) \
173  ENTRY(R10D) \
174  ENTRY(R11D) \
175  ENTRY(R12D) \
176  ENTRY(R13D) \
177  ENTRY(R14D) \
178  ENTRY(R15D)
179 
180 #define EA_BASES_64BIT \
181  ENTRY(RAX) \
182  ENTRY(RCX) \
183  ENTRY(RDX) \
184  ENTRY(RBX) \
185  ENTRY(sib64) \
186  ENTRY(RBP) \
187  ENTRY(RSI) \
188  ENTRY(RDI) \
189  ENTRY(R8) \
190  ENTRY(R9) \
191  ENTRY(R10) \
192  ENTRY(R11) \
193  ENTRY(R12) \
194  ENTRY(R13) \
195  ENTRY(R14) \
196  ENTRY(R15)
197 
198 #define REGS_64BIT \
199  ENTRY(RAX) \
200  ENTRY(RCX) \
201  ENTRY(RDX) \
202  ENTRY(RBX) \
203  ENTRY(RSP) \
204  ENTRY(RBP) \
205  ENTRY(RSI) \
206  ENTRY(RDI) \
207  ENTRY(R8) \
208  ENTRY(R9) \
209  ENTRY(R10) \
210  ENTRY(R11) \
211  ENTRY(R12) \
212  ENTRY(R13) \
213  ENTRY(R14) \
214  ENTRY(R15)
215 
216 #define REGS_MMX \
217  ENTRY(MM0) \
218  ENTRY(MM1) \
219  ENTRY(MM2) \
220  ENTRY(MM3) \
221  ENTRY(MM4) \
222  ENTRY(MM5) \
223  ENTRY(MM6) \
224  ENTRY(MM7)
225 
226 #define REGS_XMM \
227  ENTRY(XMM0) \
228  ENTRY(XMM1) \
229  ENTRY(XMM2) \
230  ENTRY(XMM3) \
231  ENTRY(XMM4) \
232  ENTRY(XMM5) \
233  ENTRY(XMM6) \
234  ENTRY(XMM7) \
235  ENTRY(XMM8) \
236  ENTRY(XMM9) \
237  ENTRY(XMM10) \
238  ENTRY(XMM11) \
239  ENTRY(XMM12) \
240  ENTRY(XMM13) \
241  ENTRY(XMM14) \
242  ENTRY(XMM15) \
243  ENTRY(XMM16) \
244  ENTRY(XMM17) \
245  ENTRY(XMM18) \
246  ENTRY(XMM19) \
247  ENTRY(XMM20) \
248  ENTRY(XMM21) \
249  ENTRY(XMM22) \
250  ENTRY(XMM23) \
251  ENTRY(XMM24) \
252  ENTRY(XMM25) \
253  ENTRY(XMM26) \
254  ENTRY(XMM27) \
255  ENTRY(XMM28) \
256  ENTRY(XMM29) \
257  ENTRY(XMM30) \
258  ENTRY(XMM31)
259 
260 
261 #define REGS_YMM \
262  ENTRY(YMM0) \
263  ENTRY(YMM1) \
264  ENTRY(YMM2) \
265  ENTRY(YMM3) \
266  ENTRY(YMM4) \
267  ENTRY(YMM5) \
268  ENTRY(YMM6) \
269  ENTRY(YMM7) \
270  ENTRY(YMM8) \
271  ENTRY(YMM9) \
272  ENTRY(YMM10) \
273  ENTRY(YMM11) \
274  ENTRY(YMM12) \
275  ENTRY(YMM13) \
276  ENTRY(YMM14) \
277  ENTRY(YMM15) \
278  ENTRY(YMM16) \
279  ENTRY(YMM17) \
280  ENTRY(YMM18) \
281  ENTRY(YMM19) \
282  ENTRY(YMM20) \
283  ENTRY(YMM21) \
284  ENTRY(YMM22) \
285  ENTRY(YMM23) \
286  ENTRY(YMM24) \
287  ENTRY(YMM25) \
288  ENTRY(YMM26) \
289  ENTRY(YMM27) \
290  ENTRY(YMM28) \
291  ENTRY(YMM29) \
292  ENTRY(YMM30) \
293  ENTRY(YMM31)
294 
295 #define REGS_ZMM \
296  ENTRY(ZMM0) \
297  ENTRY(ZMM1) \
298  ENTRY(ZMM2) \
299  ENTRY(ZMM3) \
300  ENTRY(ZMM4) \
301  ENTRY(ZMM5) \
302  ENTRY(ZMM6) \
303  ENTRY(ZMM7) \
304  ENTRY(ZMM8) \
305  ENTRY(ZMM9) \
306  ENTRY(ZMM10) \
307  ENTRY(ZMM11) \
308  ENTRY(ZMM12) \
309  ENTRY(ZMM13) \
310  ENTRY(ZMM14) \
311  ENTRY(ZMM15) \
312  ENTRY(ZMM16) \
313  ENTRY(ZMM17) \
314  ENTRY(ZMM18) \
315  ENTRY(ZMM19) \
316  ENTRY(ZMM20) \
317  ENTRY(ZMM21) \
318  ENTRY(ZMM22) \
319  ENTRY(ZMM23) \
320  ENTRY(ZMM24) \
321  ENTRY(ZMM25) \
322  ENTRY(ZMM26) \
323  ENTRY(ZMM27) \
324  ENTRY(ZMM28) \
325  ENTRY(ZMM29) \
326  ENTRY(ZMM30) \
327  ENTRY(ZMM31)
328 
329 #define REGS_MASKS \
330  ENTRY(K0) \
331  ENTRY(K1) \
332  ENTRY(K2) \
333  ENTRY(K3) \
334  ENTRY(K4) \
335  ENTRY(K5) \
336  ENTRY(K6) \
337  ENTRY(K7)
338 
339 #define REGS_SEGMENT \
340  ENTRY(ES) \
341  ENTRY(CS) \
342  ENTRY(SS) \
343  ENTRY(DS) \
344  ENTRY(FS) \
345  ENTRY(GS)
346 
347 #define REGS_DEBUG \
348  ENTRY(DR0) \
349  ENTRY(DR1) \
350  ENTRY(DR2) \
351  ENTRY(DR3) \
352  ENTRY(DR4) \
353  ENTRY(DR5) \
354  ENTRY(DR6) \
355  ENTRY(DR7) \
356  ENTRY(DR8) \
357  ENTRY(DR9) \
358  ENTRY(DR10) \
359  ENTRY(DR11) \
360  ENTRY(DR12) \
361  ENTRY(DR13) \
362  ENTRY(DR14) \
363  ENTRY(DR15)
364 
365 #define REGS_CONTROL \
366  ENTRY(CR0) \
367  ENTRY(CR1) \
368  ENTRY(CR2) \
369  ENTRY(CR3) \
370  ENTRY(CR4) \
371  ENTRY(CR5) \
372  ENTRY(CR6) \
373  ENTRY(CR7) \
374  ENTRY(CR8) \
375  ENTRY(CR9) \
376  ENTRY(CR10) \
377  ENTRY(CR11) \
378  ENTRY(CR12) \
379  ENTRY(CR13) \
380  ENTRY(CR14) \
381  ENTRY(CR15)
382 
383 #define ALL_EA_BASES \
384  EA_BASES_16BIT \
385  EA_BASES_32BIT \
386  EA_BASES_64BIT
387 
388 #define ALL_SIB_BASES \
389  REGS_32BIT \
390  REGS_64BIT
391 
392 #define ALL_REGS \
393  REGS_8BIT \
394  REGS_16BIT \
395  REGS_32BIT \
396  REGS_64BIT \
397  REGS_MMX \
398  REGS_XMM \
399  REGS_YMM \
400  REGS_ZMM \
401  REGS_MASKS \
402  REGS_SEGMENT \
403  REGS_DEBUG \
404  REGS_CONTROL \
405  ENTRY(RIP)
406 
407 /*
408  * EABase - All possible values of the base field for effective-address
409  * computations, a.k.a. the Mod and R/M fields of the ModR/M byte. We
410  * distinguish between bases (EA_BASE_*) and registers that just happen to be
411  * referred to when Mod == 0b11 (EA_REG_*).
412  */
413 typedef enum {
415 #define ENTRY(x) EA_BASE_##x,
417 #undef ENTRY
418 #define ENTRY(x) EA_REG_##x,
419  ALL_REGS
420 #undef ENTRY
422 } EABase;
423 
424 /*
425  * SIBIndex - All possible values of the SIB index field.
426  * Borrows entries from ALL_EA_BASES with the special case that
427  * sib is synonymous with NONE.
428  * Vector SIB: index can be XMM or YMM.
429  */
430 typedef enum {
432 #define ENTRY(x) SIB_INDEX_##x,
434  REGS_XMM
435  REGS_YMM
436  REGS_ZMM
437 #undef ENTRY
439 } SIBIndex;
440 
441 /*
442  * SIBBase - All possible values of the SIB base field.
443  */
444 typedef enum {
446 #define ENTRY(x) SIB_BASE_##x,
448 #undef ENTRY
450 } SIBBase;
451 
452 /*
453  * EADisplacement - Possible displacement types for effective-address
454  * computations.
455  */
456 typedef enum {
462 
463 /*
464  * Reg - All possible values of the reg field in the ModR/M byte.
465  */
466 typedef enum {
467 #define ENTRY(x) MODRM_REG_##x,
468  ALL_REGS
469 #undef ENTRY
471 } Reg;
472 
473 /*
474  * SegmentOverride - All possible segment overrides.
475  */
476 typedef enum {
486 
487 /*
488  * VEXLeadingOpcodeByte - Possible values for the VEX.m-mmmm field
489  */
490 typedef enum {
491  VEX_LOB_0F = 0x1,
495 
496 typedef enum {
500 } XOPMapSelect;
501 
502 /*
503  * VEXPrefixCode - Possible values for the VEX.pp/EVEX.pp field
504  */
505 typedef enum {
510 } VEXPrefixCode;
511 
512 typedef enum {
514  TYPE_VEX_2B = 0x1,
515  TYPE_VEX_3B = 0x2,
516  TYPE_EVEX = 0x3,
517  TYPE_XOP = 0x4
519 
520 struct reader_info {
521  const uint8_t *code;
524 };
525 
526 /*
527  * byteReader_t - Type for the byte reader that the consumer must provide to
528  * the decoder. Reads a single byte from the instruction's address space.
529  * @param arg - A baton that the consumer can associate with any internal
530  * state that it needs.
531  * @param byte - A pointer to a single byte in memory that should be set to
532  * contain the value at address.
533  * @param address - The address in the instruction's address space that should
534  * be read from.
535  * @return - -1 if the byte cannot be read for any reason; 0 otherwise.
536  */
537 typedef int (*byteReader_t)(const struct reader_info *arg, uint8_t* byte, uint64_t address);
538 
539 /*
540  * dlog_t - Type for the logging function that the consumer can provide to
541  * get debugging output from the decoder.
542  * @param arg - A baton that the consumer can associate with any internal
543  * state that it needs.
544  * @param log - A string that contains the message. Will be reused after
545  * the logger returns.
546  */
547 typedef void (*dlog_t)(void* arg, const char *log);
548 
553 };
554 
555 /*
556  * The x86 internal instruction, which is produced by the decoder.
557  */
558 typedef struct InternalInstruction {
559  // from here, all members must be initialized to ZERO to work properly
562  /* true if the prefix byte corresponding to the entry is present; false if not */
574  /* contains the location (for use with the reader) of the prefix byte */
586  /* The value of the REX prefix, if present */
588  /* The segment override type */
591  uint8_t orgModRM; // save original modRM because we will modify modRM
592  /* The SIB byte, used for more complex 32- or 64-bit memory operands */
595  /* The displacement, used for memory operands */
598  /* The value of the two-byte escape prefix (usually 0x0f) */
600  /* The value of the three-byte escape prefix (usually 0x38 or 0x3a) */
602  /* SIB state */
607  /* true if the prefix byte, 0xf2 or 0xf3 is xacquire or xrelease */
609 
610  /* The value of the vector extension prefix(EVEX/VEX/XOP), if present */
612 
613  /* Offsets from the start of the instruction to the pieces of data, which is
614  needed to find relocation entries for adding symbolic operands */
618 
619  // end-of-zero-members
620 
621  /* Reader interface (C) */
623 
624  /* Opaque value passed to the reader */
625  const void* readerArg;
626  /* The address of the next byte to read via the reader */
628 
629  /* Logger interface (C) */
631  /* Opaque value passed to the logger */
632  void* dlogArg;
633 
634  /* General instruction information */
635 
636  /* The mode to disassemble for (64-bit, protected, real) */
638  /* The start of the instruction, usable with the reader */
640  /* The length of the instruction, in bytes */
641  size_t length;
642 
643  /* Prefix state */
644 
645  /* The type of the vector extension prefix */
647 
648  /* The location where a mandatory prefix would have to be (i.e., right before
649  the opcode, or right before the REX prefix if one is present) */
651 
652  /* Sizes of various critical pieces of data, in bytes */
657 
658  uint8_t immSize; // immediate size for X86_OP_IMM operand
659 
660  /* opcode state */
661 
662  /* The last byte of the opcode, not counting any ModR/M extension */
664 
665  /* decode state */
666 
667  /* The type of opcode, used for indexing into the array of decode tables */
669  /* The instruction ID, extracted from the decode table */
671  /* The specifier for the instruction, from the instruction info table */
672  const struct InstructionSpecifier *spec;
673 
674  /* state for additional bytes, consumed during operand decode. Pattern:
675  consumed___ indicates that the byte was already consumed and does not
676  need to be consumed again */
677 
678  /* The VEX.vvvv field, which contains a third register operand for some AVX
679  instructions */
681 
682  /* The writemask for AVX-512 instructions which is contained in EVEX.aaa */
684 
685  /* The ModR/M byte, which contains most register operands and some portion of
686  all memory operands */
688 
689  // special data to handle MOVcr, MOVdr, MOVrc, MOVrd
690  uint8_t firstByte; // save the first byte in stream
691 
692  /* Immediates. There can be two in some cases */
695 
696  /* A register or immediate operand encoded into the opcode */
698 
699  /* Portions of the ModR/M byte */
700 
701  /* These fields determine the allowable values for the ModR/M fields, which
702  depend on operand and address widths */
706 
707  /* The Mod and R/M fields can encode a base for an effective address, or a
708  register. These are separated into two fields here */
711  /* The reg field always encodes a register */
713 
714  const struct OperandSpecifier *operands;
716 
717 /* decodeInstruction - Decode one instruction and store the decoding results in
718  * a buffer provided by the consumer.
719  * @param insn - The buffer to store the instruction in. Allocated by the
720  * consumer.
721  * @param reader - The byteReader_t for the bytes to be read.
722  * @param readerArg - An argument to pass to the reader for storing context
723  * specific to the consumer. May be NULL.
724  * @param logger - The dlog_t to be used in printing status messages from the
725  * disassembler. May be NULL.
726  * @param loggerArg - An argument to pass to the logger for storing context
727  * specific to the logger. May be NULL.
728  * @param startLoc - The address (in the reader's address space) of the first
729  * byte in the instruction.
730  * @param mode - The mode (16-bit, 32-bit, 64-bit) to decode in.
731  * @return - Nonzero if there was an error during decode, 0 otherwise.
732  */
733 int decodeInstruction(struct InternalInstruction* insn,
735  const void* readerArg,
736  uint64_t startLoc,
738 
739 //const char *x86DisassemblerGetInstrName(unsigned Opcode, const void *mii);
740 
741 #endif
TYPE_NO_VEX_XOP
@ TYPE_NO_VEX_XOP
Definition: X86DisassemblerDecoder.h:513
InternalInstruction::modRMOffset
uint8_t modRMOffset
Definition: X86DisassemblerDecoder.h:617
InternalInstruction::displacementOffset
uint8_t displacementOffset
Definition: X86DisassemblerDecoder.h:615
DisassemblerMode
DisassemblerMode
Definition: X86DisassemblerDecoderCommon.h:511
InternalInstruction::necessaryPrefixLocation
uint64_t necessaryPrefixLocation
Definition: X86DisassemblerDecoder.h:650
InternalInstruction::prefix67
uint64_t prefix67
Definition: X86DisassemblerDecoder.h:582
InternalInstruction::eaBaseBase
EABase eaBaseBase
Definition: X86DisassemblerDecoder.h:703
InternalInstruction::isPrefixf0
bool isPrefixf0
Definition: X86DisassemblerDecoder.h:571
InternalInstruction::sibScale
uint8_t sibScale
Definition: X86DisassemblerDecoder.h:604
VEX_PREFIX_NONE
@ VEX_PREFIX_NONE
Definition: X86DisassemblerDecoder.h:506
EA_DISP_NONE
@ EA_DISP_NONE
Definition: X86DisassemblerDecoder.h:457
InternalInstruction::isPrefixf2
bool isPrefixf2
Definition: X86DisassemblerDecoder.h:572
InternalInstruction::isPrefix26
bool isPrefix26
Definition: X86DisassemblerDecoder.h:563
InternalInstruction::prefix36
uint64_t prefix36
Definition: X86DisassemblerDecoder.h:577
VEX_LOB_0F38
@ VEX_LOB_0F38
Definition: X86DisassemblerDecoder.h:492
EA_DISP_32
@ EA_DISP_32
Definition: X86DisassemblerDecoder.h:460
InternalInstruction::length
size_t length
Definition: X86DisassemblerDecoder.h:641
InternalInstruction::reg
Reg reg
Definition: X86DisassemblerDecoder.h:712
InternalInstruction::consumedDisplacement
bool consumedDisplacement
Definition: X86DisassemblerDecoder.h:596
uint16_t
unsigned short uint16_t
Definition: stdint-msvc2008.h:79
InternalInstruction::prefix64
uint64_t prefix64
Definition: X86DisassemblerDecoder.h:579
SIB_BASE_max
@ SIB_BASE_max
Definition: X86DisassemblerDecoder.h:449
EA_DISP_16
@ EA_DISP_16
Definition: X86DisassemblerDecoder.h:459
reader_info
Definition: X86DisassemblerDecoder.h:520
InternalInstruction::startLocation
uint64_t startLocation
Definition: X86DisassemblerDecoder.h:639
EA_DISP_8
@ EA_DISP_8
Definition: X86DisassemblerDecoder.h:458
SIB_INDEX_max
@ SIB_INDEX_max
Definition: X86DisassemblerDecoder.h:438
InternalInstruction::numImmediatesTranslated
uint8_t numImmediatesTranslated
Definition: X86DisassemblerDecoder.h:693
InternalInstruction::prefix26
uint64_t prefix26
Definition: X86DisassemblerDecoder.h:575
OperandSpecifier
Definition: X86DisassemblerDecoderCommon.h:499
reader_info::offset
uint64_t offset
Definition: X86DisassemblerDecoder.h:523
dlog_t
void(* dlog_t)(void *arg, const char *log)
Definition: X86DisassemblerDecoder.h:547
InternalInstruction::segmentOverride
SegmentOverride segmentOverride
Definition: X86DisassemblerDecoder.h:589
InternalInstruction::prefix2
uint8_t prefix2
Definition: X86DisassemblerDecoder.h:561
InternalInstruction::rexPrefix
uint8_t rexPrefix
Definition: X86DisassemblerDecoder.h:587
SEG_OVERRIDE_max
@ SEG_OVERRIDE_max
Definition: X86DisassemblerDecoder.h:484
InternalInstruction::vectorExtensionType
VectorExtensionType vectorExtensionType
Definition: X86DisassemblerDecoder.h:646
mode
const char int mode
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:135
InternalInstruction::addressSize
uint8_t addressSize
Definition: X86DisassemblerDecoder.h:654
ALL_SIB_BASES
#define ALL_SIB_BASES
Definition: X86DisassemblerDecoder.h:388
InternalInstruction::opcode
uint8_t opcode
Definition: X86DisassemblerDecoder.h:663
InternalInstruction::readerArg
const void * readerArg
Definition: X86DisassemblerDecoder.h:625
VEXPrefixCode
VEXPrefixCode
Definition: X86DisassemblerDecoder.h:505
OpcodeType
OpcodeType
Definition: X86DisassemblerDecoderCommon.h:287
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
InternalInstruction::isPrefixf3
bool isPrefixf3
Definition: X86DisassemblerDecoder.h:573
TYPE_XOP
@ TYPE_XOP
Definition: X86DisassemblerDecoder.h:517
reader_info::size
uint64_t size
Definition: X86DisassemblerDecoder.h:522
SEG_OVERRIDE_DS
@ SEG_OVERRIDE_DS
Definition: X86DisassemblerDecoder.h:480
InternalInstruction::prefix3
uint8_t prefix3
Definition: X86DisassemblerDecoder.h:561
InternalInstruction::xAcquireRelease
bool xAcquireRelease
Definition: X86DisassemblerDecoder.h:608
XOPMapSelect
XOPMapSelect
Definition: X86DisassemblerDecoder.h:496
InternalInstruction::dlogArg
void * dlogArg
Definition: X86DisassemblerDecoder.h:632
VEX_PREFIX_66
@ VEX_PREFIX_66
Definition: X86DisassemblerDecoder.h:507
InternalInstruction::displacementSize
uint8_t displacementSize
Definition: X86DisassemblerDecoder.h:655
InternalInstruction::vectorExtensionPrefix
uint8_t vectorExtensionPrefix[4]
Definition: X86DisassemblerDecoder.h:611
SEG_OVERRIDE_CS
@ SEG_OVERRIDE_CS
Definition: X86DisassemblerDecoder.h:478
InternalInstruction::prefix0
uint8_t prefix0
Definition: X86DisassemblerDecoder.h:561
TYPE_VEX_2B
@ TYPE_VEX_2B
Definition: X86DisassemblerDecoder.h:514
xds_interop_client.int
int
Definition: xds_interop_client.py:113
InternalInstruction::prefixf0
uint64_t prefixf0
Definition: X86DisassemblerDecoder.h:583
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
InstructionSpecifier
Definition: X86DisassemblerDecoder.h:551
MODRM_REG_max
@ MODRM_REG_max
Definition: X86DisassemblerDecoder.h:470
InternalInstruction::reader
byteReader_t reader
Definition: X86DisassemblerDecoder.h:622
InternalInstruction::isPrefix65
bool isPrefix65
Definition: X86DisassemblerDecoder.h:568
InternalInstruction::numImmediatesConsumed
uint8_t numImmediatesConsumed
Definition: X86DisassemblerDecoder.h:606
SegmentOverride
SegmentOverride
Definition: X86DisassemblerDecoder.h:476
InternalInstruction::instructionID
uint16_t instructionID
Definition: X86DisassemblerDecoder.h:670
InternalInstruction
Definition: X86DisassemblerDecoder.h:558
InternalInstruction::isPrefix67
bool isPrefix67
Definition: X86DisassemblerDecoder.h:570
InternalInstruction::prefix66
uint64_t prefix66
Definition: X86DisassemblerDecoder.h:581
InternalInstruction::immediates
uint64_t immediates[2]
Definition: X86DisassemblerDecoder.h:694
InternalInstruction::opcodeRegister
Reg opcodeRegister
Definition: X86DisassemblerDecoder.h:697
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
InternalInstruction::registerSize
uint8_t registerSize
Definition: X86DisassemblerDecoder.h:653
SEG_OVERRIDE_FS
@ SEG_OVERRIDE_FS
Definition: X86DisassemblerDecoder.h:482
InstructionSpecifier::operands
uint16_t operands
Definition: X86DisassemblerDecoder.h:552
InternalInstruction::vvvv
Reg vvvv
Definition: X86DisassemblerDecoder.h:680
InternalInstruction::modRM
uint8_t modRM
Definition: X86DisassemblerDecoder.h:687
XOP_MAP_SELECT_8
@ XOP_MAP_SELECT_8
Definition: X86DisassemblerDecoder.h:497
VEX_PREFIX_F3
@ VEX_PREFIX_F3
Definition: X86DisassemblerDecoder.h:508
SIB_BASE_NONE
@ SIB_BASE_NONE
Definition: X86DisassemblerDecoder.h:445
InternalInstruction::orgModRM
uint8_t orgModRM
Definition: X86DisassemblerDecoder.h:591
InternalInstruction::eaRegBase
EABase eaRegBase
Definition: X86DisassemblerDecoder.h:704
InternalInstruction::readerCursor
uint64_t readerCursor
Definition: X86DisassemblerDecoder.h:627
InternalInstruction::opcodeType
OpcodeType opcodeType
Definition: X86DisassemblerDecoder.h:668
InternalInstruction::threeByteEscape
uint8_t threeByteEscape
Definition: X86DisassemblerDecoder.h:601
InternalInstruction::twoByteEscape
uint8_t twoByteEscape
Definition: X86DisassemblerDecoder.h:599
InternalInstruction::writemask
Reg writemask
Definition: X86DisassemblerDecoder.h:683
InternalInstruction::prefixf3
uint64_t prefixf3
Definition: X86DisassemblerDecoder.h:585
InternalInstruction::immSize
uint8_t immSize
Definition: X86DisassemblerDecoder.h:658
SEG_OVERRIDE_NONE
@ SEG_OVERRIDE_NONE
Definition: X86DisassemblerDecoder.h:477
InternalInstruction::operands
const struct OperandSpecifier * operands
Definition: X86DisassemblerDecoder.h:714
ares::byte
unsigned char byte
Definition: ares-test.h:33
InternalInstruction::immediateOffset
uint8_t immediateOffset
Definition: X86DisassemblerDecoder.h:616
SIBIndex
SIBIndex
Definition: X86DisassemblerDecoder.h:430
InternalInstruction::isPrefix2e
bool isPrefix2e
Definition: X86DisassemblerDecoder.h:564
InternalInstruction::displacement
int64_t displacement
Definition: X86DisassemblerDecoder.h:597
VEX_LOB_0F
@ VEX_LOB_0F
Definition: X86DisassemblerDecoder.h:491
SEG_OVERRIDE_ES
@ SEG_OVERRIDE_ES
Definition: X86DisassemblerDecoder.h:481
TYPE_EVEX
@ TYPE_EVEX
Definition: X86DisassemblerDecoder.h:516
REGS_ZMM
#define REGS_ZMM
Definition: X86DisassemblerDecoder.h:295
ALL_REGS
#define ALL_REGS
Definition: X86DisassemblerDecoder.h:392
EA_BASE_NONE
@ EA_BASE_NONE
Definition: X86DisassemblerDecoder.h:414
InternalInstruction::regBase
Reg regBase
Definition: X86DisassemblerDecoder.h:705
REGS_YMM
#define REGS_YMM
Definition: X86DisassemblerDecoder.h:261
InternalInstruction::sibBase
SIBBase sibBase
Definition: X86DisassemblerDecoder.h:605
ALL_EA_BASES
#define ALL_EA_BASES
Definition: X86DisassemblerDecoder.h:383
SIB_INDEX_NONE
@ SIB_INDEX_NONE
Definition: X86DisassemblerDecoder.h:431
XOP_MAP_SELECT_9
@ XOP_MAP_SELECT_9
Definition: X86DisassemblerDecoder.h:498
TYPE_VEX_3B
@ TYPE_VEX_3B
Definition: X86DisassemblerDecoder.h:515
EABase
EABase
Definition: X86DisassemblerDecoder.h:413
arg
struct arg arg
InternalInstruction::prefix2e
uint64_t prefix2e
Definition: X86DisassemblerDecoder.h:576
EA_max
@ EA_max
Definition: X86DisassemblerDecoder.h:421
InternalInstruction::operandSize
uint8_t operandSize
Definition: X86DisassemblerDecoder.h:560
log
bool log
Definition: abseil-cpp/absl/synchronization/mutex.cc:310
InternalInstruction
struct InternalInstruction InternalInstruction
InternalInstruction::mode
DisassemblerMode mode
Definition: X86DisassemblerDecoder.h:637
InternalInstruction::prefix1
uint8_t prefix1
Definition: X86DisassemblerDecoder.h:561
REGS_XMM
#define REGS_XMM
Definition: X86DisassemblerDecoder.h:226
InternalInstruction::prefix3e
uint64_t prefix3e
Definition: X86DisassemblerDecoder.h:578
Reg
Reg
Definition: X86DisassemblerDecoder.h:466
InternalInstruction::sibIndex
SIBIndex sibIndex
Definition: X86DisassemblerDecoder.h:603
SEG_OVERRIDE_GS
@ SEG_OVERRIDE_GS
Definition: X86DisassemblerDecoder.h:483
InternalInstruction::firstByte
uint8_t firstByte
Definition: X86DisassemblerDecoder.h:690
XOP_MAP_SELECT_A
@ XOP_MAP_SELECT_A
Definition: X86DisassemblerDecoder.h:499
byteReader_t
int(* byteReader_t)(const struct reader_info *arg, uint8_t *byte, uint64_t address)
Definition: X86DisassemblerDecoder.h:537
InternalInstruction::consumedModRM
bool consumedModRM
Definition: X86DisassemblerDecoder.h:590
InternalInstruction::immediateSize
uint8_t immediateSize
Definition: X86DisassemblerDecoder.h:656
InternalInstruction::eaDisplacement
EADisplacement eaDisplacement
Definition: X86DisassemblerDecoder.h:710
InternalInstruction::spec
const struct InstructionSpecifier * spec
Definition: X86DisassemblerDecoder.h:672
VEX_LOB_0F3A
@ VEX_LOB_0F3A
Definition: X86DisassemblerDecoder.h:493
InternalInstruction::consumedSIB
bool consumedSIB
Definition: X86DisassemblerDecoder.h:593
InternalInstruction::prefixf2
uint64_t prefixf2
Definition: X86DisassemblerDecoder.h:584
InternalInstruction::isPrefix36
bool isPrefix36
Definition: X86DisassemblerDecoder.h:565
VectorExtensionType
VectorExtensionType
Definition: X86DisassemblerDecoder.h:512
InternalInstruction::dlog
dlog_t dlog
Definition: X86DisassemblerDecoder.h:630
InternalInstruction::isPrefix3e
bool isPrefix3e
Definition: X86DisassemblerDecoder.h:566
SEG_OVERRIDE_SS
@ SEG_OVERRIDE_SS
Definition: X86DisassemblerDecoder.h:479
reader_info::code
const uint8_t * code
Definition: X86DisassemblerDecoder.h:521
InternalInstruction::isPrefix64
bool isPrefix64
Definition: X86DisassemblerDecoder.h:567
InternalInstruction::sib
uint8_t sib
Definition: X86DisassemblerDecoder.h:594
EADisplacement
EADisplacement
Definition: X86DisassemblerDecoder.h:456
InternalInstruction::eaBase
EABase eaBase
Definition: X86DisassemblerDecoder.h:709
SIBBase
SIBBase
Definition: X86DisassemblerDecoder.h:444
reader
void reader(void *n)
Definition: libuv/docs/code/locks/main.c:8
decodeInstruction
int decodeInstruction(struct InternalInstruction *insn, byteReader_t reader, const void *readerArg, uint64_t startLoc, DisassemblerMode mode)
X86DisassemblerDecoderCommon.h
InternalInstruction::isPrefix66
bool isPrefix66
Definition: X86DisassemblerDecoder.h:569
VEXLeadingOpcodeByte
VEXLeadingOpcodeByte
Definition: X86DisassemblerDecoder.h:490
InternalInstruction::prefix65
uint64_t prefix65
Definition: X86DisassemblerDecoder.h:580
VEX_PREFIX_F2
@ VEX_PREFIX_F2
Definition: X86DisassemblerDecoder.h:509


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:54