IDA C++ SDK 9.2
Loading...
Searching...
No Matches
intel.hpp
Go to the documentation of this file.
1/*
2 * Interactive disassembler (IDA).
3 * Copyright (c) 1990-2026 Hex-Rays
4 * ALL RIGHTS RESERVED.
5 *
6 */
7
8#ifndef _INTEL_HPP
9#define _INTEL_HPP
10#include <ua.hpp>
11#include <typeinf.hpp>
12#ifndef __PC_PRIVATE_BUILD
13#include <allins.hpp>
14#endif
15
16#define PROC_MAXOP 5 // max number of operands
17CASSERT(PROC_MAXOP <= UA_MAXOP);
18
19//---------------------------------
20// Intel 80x86 insn_t.auxpref bits
21#define aux_lock 0x00000001
22#define aux_rep 0x00000002
23#define aux_repne 0x00000004
24#define aux_use32 0x00000008 // segment type is 32-bits
25#define aux_use64 0x00000010 // segment type is 64-bits
26#define aux_large 0x00000020 // offset field is 32-bit (16-bit is not enough)
27#define aux_short 0x00000040 // short (byte) displacement used
28#define aux_sgpref 0x00000080 // a segment prefix byte is not used
29#define aux_oppref 0x00000100 // operand size prefix byte is not used
30#define aux_adpref 0x00000200 // address size prefix byte is not used
31#define aux_basess 0x00000400 // SS based instruction
32#define aux_natop 0x00000800 // operand size is not overridden by prefix
33#define aux_natad 0x00001000 // addressing mode is not overridden by prefix
34#define aux_fpemu 0x00002000 // FP emulator instruction
35#define aux_vexpr 0x00004000 // VEX-encoded instruction
36#define aux_bnd 0x00008000 // MPX-encoded instruction
37#define aux_evex 0x00010000 // EVEX-encoded instruction
38#define aux_xop 0x00020000 // XOP-encoded instruction
39#define aux_xacquire 0x00040000 // HLE prefix hints
40#define aux_xrelease 0x00080000 // HLE prefix hints
41#define aux_hint_nop 0x00100000 // instruction has no meaning other than hintable nop
42
43//---------------------------------
44// operand types and other customization:
45#define o_trreg o_idpspec0 // IDP specific type
46#define o_dbreg o_idpspec1 // IDP specific type
47#define o_crreg o_idpspec2 // IDP specific type
48#define o_fpreg o_idpspec3 // IDP specific type
49#define o_mmxreg o_idpspec4 // IDP specific type
50#define o_xmmreg o_idpspec5 // xmm register
51#define o_ymmreg o_idpspec5+1 // ymm register
52#define o_zmmreg o_idpspec5+2 // zmm register
53#define o_kreg o_idpspec5+3 // opmask register
54
55// 04.10.97: For o_mem,o_near,o_far we keep segment information as
56// segrg - number of segment register to use
57// if it is == SEGREG_IMM, then the segment was specified as an immediate
58// value, look at segsel.
59
60#define segrg specval_shorts.high
61#define SEGREG_IMM 0xFFFF // this value of segrg means that
62 // segment selector value is in
63 // "segsel":
64#define segsel specval_shorts.low
65#define hasSIB specflag1
66#define sib specflag2
67#define rex insnpref // REX byte for 64-bit mode, or bits from the VEX byte if vexpr()
68
69// Op6 is used for opmask registers in EVEX.
70// specflags from Op6 are used to extend insn_t.
71#define evex_flags Op6.specflag2 // bits from the EVEX byte if evexpr()
72
73#define cr_suff specflag1 // o_crreg: D suffix for cr registers (used for CR8D)
74
75// bits in insn_t.evex_flags:
76const int EVEX_R = 0x01; // High-16 register specifier modifier
77const int EVEX_L = 0x02; // Vector length/RC
78const int EVEX_z = 0x04; // Zeroing/Merging
79const int EVEX_b = 0x08; // Broadcast/RC/SAE Context
80const int EVEX_V = 0x10; // High-16 NDS/VIDX register specifier
81
82// bits in insn_t.rex:
83const int REX_W = 8; // 64-bit operand size
84const int REX_R = 4; // modrm reg field extension
85const int REX_X = 2; // sib index field extension
86const int REX_B = 1; // modrm r/m, sib base, or opcode reg fields extension
87const int VEX_L = 0x80; // 256-bit operation (YMM register)
88
89typedef short regnum_t;
90
92{
93 R_none = -1,
94 R_ax = 0,
95 R_cx, // 1
96 R_dx, // 2
97 R_bx, // 3
98 R_sp, // 4
99 R_bp, // 5
100 R_si, // 6
101 R_di, // 7
102 R_r8, // 8
103 R_r9, // 9
104 R_r10, // 10
105 R_r11, // 11
106 R_r12, // 12
107 R_r13, // 13
108 R_r14, // 14
109 R_r15, // 15
110
111 R_al, // 16
112 R_cl, // 17
113 R_dl, // 18
114 R_bl, // 19
115 R_ah, // 20
116 R_ch, // 21
117 R_dh, // 22
118 R_bh, // 23
119
120 R_spl, // 24
121 R_bpl, // 25
122 R_sil, // 26
123 R_dil, // 27
124
125 R_ip, // 28
126
127 R_es, // 29 // 0
128 R_cs, // 30 // 1
129 R_ss, // 31 // 2
130 R_ds, // 32 // 3
131 R_fs, // 33
132 R_gs, // 34
133
134 R_cf, // main cc's
138
139 R_pf, // additional cc's
144
145 R_efl, // eflags
146
147 // the following registers will be used in the disassembly
148 // starting from ida v5.7
149
150 R_st0, // floating point registers (not used in disassembly)
158 R_fpctrl,// fpu control register
159 R_fpstat,// fpu status register
160 R_fptags,// fpu tags register
161
162 R_mm0, // mmx registers
170
171 R_xmm0, // xmm registers
188
189 R_ymm0, // AVX 256-bit registers
205
206 R_bnd0, // MPX registers
210
211 R_xmm16, // AVX-512 extended XMM registers
227
228 R_ymm16, // AVX-512 extended YMM registers
244
245 R_zmm0, // AVX-512 ZMM registers
277
278 R_k0, // AVX-512 opmask registers
286
288};
289
291
292inline bool is_segreg(int r) { return r >= R_es && r <= R_gs; }
293inline bool is_fpureg(int r) { return r >= R_st0 && r <= R_st7; }
294inline bool is_mmxreg(int r) { return r >= R_mm0 && r <= R_mm7; }
295inline bool is_xmmreg(int r) { return r >= R_xmm0 && r <= R_xmm15 || r >= R_xmm16 && r <= R_xmm31; }
296inline bool is_ymmreg(int r) { return r >= R_ymm0 && r <= R_ymm15; }
297
298int cvt_to_wholereg(int _reg, bool allow_high_byte_regs); // byte reg -> whole reg
299int calc_dbg_reg_index(const char *name);
300
301//-------------------------------------------------------------------------
302// is conditional branch?
303inline bool insn_jcc(const insn_t &insn)
304{
305 switch ( insn.itype )
306 {
307 case NN_ja:
308 case NN_jae:
309 case NN_jb:
310 case NN_jbe:
311 case NN_jc:
312 case NN_je:
313 case NN_jg:
314 case NN_jge:
315 case NN_jl:
316 case NN_jle:
317 case NN_jna:
318 case NN_jnae:
319 case NN_jnb:
320 case NN_jnbe:
321 case NN_jnc:
322 case NN_jne:
323 case NN_jng:
324 case NN_jnge:
325 case NN_jnl:
326 case NN_jnle:
327 case NN_jno:
328 case NN_jnp:
329 case NN_jns:
330 case NN_jnz:
331 case NN_jo:
332 case NN_jp:
333 case NN_jpe:
334 case NN_jpo:
335 case NN_js:
336 case NN_jz:
337 return true;
338 }
339 return false;
340}
341
342//-------------------------------------------------------------------------
343inline bool insn_default_opsize_64(const insn_t &insn)
344{
345 if ( insn_jcc(insn) )
346 return true;
347 switch ( insn.itype )
348 {
349 // use ss
350 case NN_pop:
351 case NN_popf:
352 case NN_popfq:
353 case NN_push:
354 case NN_pushf:
355 case NN_pushfq:
356 case NN_retn:
357 case NN_retf:
358 case NN_retnq:
359 case NN_retfq:
360 case NN_call:
361 case NN_callfi:
362 case NN_callni:
363 case NN_enter:
364 case NN_enterq:
365 case NN_leave:
366 case NN_leaveq:
367
368 // near branches
369 case NN_jcxz:
370 case NN_jecxz:
371 case NN_jrcxz:
372 case NN_jmp:
373 case NN_jmpni:
374 case NN_jmpshort:
375 case NN_loop:
376 case NN_loopq:
377 case NN_loope:
378 case NN_loopqe:
379 case NN_loopne:
380 case NN_loopqne:
381 return true;
382 }
383 return false;
384}
385
386inline bool mode16(const insn_t &insn) { return (insn.auxpref & (aux_use32|aux_use64)) == 0; } // 16-bit mode?
387inline bool mode32(const insn_t &insn) { return (insn.auxpref & aux_use32) != 0; } // 32-bit mode?
388inline bool mode64(const insn_t &insn) { return (insn.auxpref & aux_use64) != 0; } // 64-bit mode?
389inline bool natad(const insn_t &insn) { return (insn.auxpref & aux_natad) != 0; } // natural address size (no prefixes)?
390inline bool natop(const insn_t &insn) { return (insn.auxpref & aux_natop) != 0; } // natural operand size (no prefixes)?
391inline bool vexpr(const insn_t &insn) { return (insn.auxpref & aux_vexpr) != 0; } // VEX encoding used
392inline bool evexpr(const insn_t &insn) { return (insn.auxpref & aux_evex) != 0; } // EVEX encoding used
393inline bool xopexpr(const insn_t &insn) { return (insn.auxpref & aux_xop) != 0; } // XOP encoding used
394
395inline bool ad16(const insn_t &insn) // is current addressing 16-bit?
396{
397 int p = insn.auxpref & (aux_use32|aux_use64|aux_natad);
398 return p == aux_natad || p == aux_use32;
399}
400
401inline bool ad32(const insn_t &insn) // is current addressing 32-bit?
402{
403 int p = insn.auxpref & (aux_use32|aux_use64|aux_natad);
404 return p == (aux_natad|aux_use32)
405 || p == 0
406 || p == aux_use64;
407}
408
409inline bool ad64(const insn_t &insn) // is current addressing 64-bit?
410{
411#ifdef __EA64__
412 int p = insn.auxpref & (aux_use32|aux_use64|aux_natad);
413 return p == (aux_natad|aux_use64);
414#else
415 qnotused(insn);
416 return false;
417#endif
418}
419
420inline bool op16(const insn_t &insn) // is current operand size 16-bit?
421{
422 int p = insn.auxpref & (aux_use32|aux_use64|aux_natop);
423 return p == aux_natop // 16-bit segment, no prefixes
424 || p == aux_use32 // 32-bit segment, 66h
425 || p == aux_use64 && (insn.rex & REX_W) == 0; // 64-bit segment, 66h, no rex.w
426}
427
428inline bool op32(const insn_t &insn) // is current operand size 32-bit?
429{
430 int p = insn.auxpref & (aux_use32|aux_use64|aux_natop);
431 return p == 0 // 16-bit segment, 66h
432 || p == (aux_use32|aux_natop) // 32-bit segment, no prefixes
433 || p == (aux_use64|aux_natop) && (insn.rex & REX_W) == 0; // 64-bit segment, 66h, no rex.w
434}
435
436inline bool op64(const insn_t &insn) // is current operand size 64-bit?
437{
438#ifdef __EA64__
439 return mode64(insn)
440 && ((insn.rex & REX_W) != 0
441 || natop(insn) && insn_default_opsize_64(insn)); // 64-bit segment, rex.w or insns-64
442#else
443 qnotused(insn);
444 return false;
445#endif
446}
447
448inline bool op256(const insn_t &insn) // is VEX.L == 1 or EVEX.L'L == 01?
449{
450 return (insn.rex & VEX_L) != 0
451 && (vexpr(insn)
452 || xopexpr(insn)
453 || evexpr(insn) && (insn.evex_flags & EVEX_L) == 0);
454}
455
456inline bool op512(const insn_t &insn) // is EVEX.L'L == 10?
457{
458 return evexpr(insn) && (insn.rex & VEX_L) == 0 && (insn.evex_flags & EVEX_L) != 0;
459}
460
461inline bool is_vsib(const insn_t &insn) // does instruction use VSIB variant of the sib byte?
462{
463 switch ( insn.itype )
464 {
465 case NN_vgatherdps:
466 case NN_vgatherdpd:
467 case NN_vgatherqps:
468 case NN_vgatherqpd:
469 case NN_vpgatherdd:
470 case NN_vpgatherdq:
471 case NN_vpgatherqd:
472 case NN_vpgatherqq:
473
474 case NN_vscatterdps:
475 case NN_vscatterdpd:
476 case NN_vscatterqps:
477 case NN_vscatterqpd:
478 case NN_vpscatterdd:
479 case NN_vpscatterdq:
480 case NN_vpscatterqd:
481 case NN_vpscatterqq:
482
483 case NN_vgatherpf0dps:
484 case NN_vgatherpf0qps:
485 case NN_vgatherpf0dpd:
486 case NN_vgatherpf0qpd:
487 case NN_vgatherpf1dps:
488 case NN_vgatherpf1qps:
489 case NN_vgatherpf1dpd:
490 case NN_vgatherpf1qpd:
491
500 return true;
501 }
502 return false;
503}
504
505inline regnum_t vsib_index_fixreg(const insn_t &insn, regnum_t index)
506{
507 switch ( insn.itype )
508 {
509 case NN_vscatterdps:
510 case NN_vscatterqps:
511 case NN_vscatterqpd:
512 case NN_vpscatterdd:
513 case NN_vpscatterqd:
514 case NN_vpscatterqq:
515
516 case NN_vpgatherdd:
517 case NN_vpgatherqd:
518 case NN_vpgatherqq:
519 case NN_vgatherdps:
520 case NN_vgatherqps:
521 case NN_vgatherqpd:
522 if ( index > 15 )
523 index += op512(insn) ? R_zmm0 : op256(insn) ? (R_ymm16 - 16) : (R_xmm16 - 16);
524 else
525 index += op512(insn) ? R_zmm0 : op256(insn) ? R_ymm0 : R_xmm0;
526 break;
527
528 case NN_vscatterdpd:
529 case NN_vpscatterdq:
530
531 case NN_vgatherdpd:
532 case NN_vpgatherdq:
533 if ( index > 15 )
534 index += op512(insn) ? (R_ymm16 - 16) : (R_xmm16 - 16);
535 else
536 index += op512(insn) ? R_ymm0 : R_xmm0;
537 break;
538
539 case NN_vgatherpf0dps:
540 case NN_vgatherpf0qps:
541 case NN_vgatherpf0qpd:
542 case NN_vgatherpf1dps:
543 case NN_vgatherpf1qps:
544 case NN_vgatherpf1qpd:
545
552 index += R_zmm0;
553 break;
554
555 case NN_vgatherpf0dpd:
556 case NN_vgatherpf1dpd:
559 if ( index > 15 )
560 index += R_ymm16 - 16;
561 else
562 index += R_ymm0;
563 break;
564 }
565 return index;
566}
567
568inline int sib_base(const insn_t &insn, const op_t &x) // get extended sib base
569{
570 int base = x.sib & 7;
571#ifdef __EA64__
572 if ( mode64(insn) && (insn.rex & REX_B) != 0 )
573 base |= 8;
574#else
575 qnotused(insn);
576#endif
577 return base;
578}
579
580inline regnum_t sib_index(const insn_t &insn, const op_t &x) // get extended sib index
581{
582 regnum_t index = regnum_t((x.sib >> 3) & 7);
583#ifdef __EA64__
584 if ( mode64(insn) && (insn.rex & REX_X) != 0 )
585 index |= 8;
586#endif
587 if ( is_vsib(insn) )
588 {
589 if ( (insn.evex_flags & EVEX_V) != 0 )
590 index |= 16;
591 index = vsib_index_fixreg(insn, index);
592 }
593 return index;
594}
595
596inline int sib_scale(const op_t &x)
597{
598 int scale = (x.sib >> 6) & 3;
599 return scale;
600}
601
602// get the base register of the operand with a displacement
603// NB: for 16-bit code, returns a phrase number
604// use x86_base_reg() if you need to handle 16-bit instructions
605inline int x86_base(const insn_t &insn, const op_t &x)
606{
607 return x.hasSIB ? sib_base(insn, x) : x.phrase;
608}
609
610// get the base register of the operand with a displacement
611// returns correct register for 16-bit code too
612inline int x86_base_reg(const insn_t &insn, const op_t &x)
613{
614 if ( x.hasSIB )
615 {
616 if ( x.type == o_mem )
617 return R_none;
618 return sib_base(insn, x); // base register is encoded in the SIB
619 }
620 else if ( !ad16(insn) )
621 {
622 return x.phrase; // 'phrase' contains the base register number
623 }
624 else if ( x.phrase == ushort(R_none) )
625 {
626 return R_sp;
627 }
628 switch ( x.phrase )
629 {
630 case 0: // [BX+SI]
631 case 1: // [BX+DI]
632 case 7: // [BX]
633 return R_bx;
634 case 2: // [BP+SI]
635 case 3: // [BP+DI]
636 case 6: // [BP]
637 return R_bp;
638 case 4: // [SI]
639 return R_si;
640 case 5: // [DI]
641 return R_di;
642 default:
643 INTERR(10259);
644 }
645}
646
647const int INDEX_NONE = 4; // no index register is present
648// get the index register of the operand with a displacement
649inline int x86_index(const insn_t &insn, const op_t &x)
650{
651 return x.hasSIB ? sib_index(insn, x) : INDEX_NONE;
652}
653
654inline int x86_index_reg(const insn_t &insn, const op_t &x)
655{
656 if ( x.hasSIB )
657 {
658 int idx = sib_index(insn, x);
659 if ( idx != INDEX_NONE )
660 return idx;
661 return R_none;
662 }
663 if ( !ad16(insn) )
664 return R_none;
665 switch ( x.phrase )
666 {
667 case 0: // [BX+SI]
668 case 2: // [BP+SI]
669 return R_si;
670 case 1: // [BX+DI]
671 case 3: // [BP+DI]
672 return R_di;
673 case 4: // [SI]
674 case 5: // [DI]
675 case 7: // [BX]
676 case 6: // [BP]
677 return R_none;
678 default:
679 INTERR(10260);
680 }
681}
682// get the scale factor of the operand with a displacement
683inline int x86_scale(const op_t &x)
684{
685 return x.hasSIB ? sib_scale(x) : 0;
686}
687
688// does the operand have a displacement?
689inline int has_displ(const op_t &x)
690{
691 return x.type == o_displ || x.type == o_mem && x.hasSIB;
692}
693
694// does the insn refer to the TLS variable?
695inline bool has_tls_segpref(const insn_t &insn)
696{
697 if ( insn.segpref == 0 )
698 return false;
699 return mode64(insn) && insn.segpref == R_fs
700 || mode32(insn) && insn.segpref == R_gs;
701}
702
703// should we treat the memory operand as a displacement?
704inline bool mem_as_displ(const insn_t &insn, const op_t &x)
705{
706 // the operand should be an offset and it should be the TLS variable
707 // or the second operand of "lea" instruction
708 // .text:08000000 mov eax, gs:(ti1 - static_TP)
709 // .text:08000E8F lea ecx, (_ZN4dmngL4sessE - _GLOBAL_OFFSET_TABLE_)
710 return (has_tls_segpref(insn) || insn.itype == NN_lea)
711 && is_off(get_flags(insn.ea), x.n);
712}
713
714// does the operand refer to stack? (sp or bp based)
715bool is_stack_ref(const insn_t &insn, const op_t &x, int breg);
716
717// return addressing width in form of dt_... constant
718inline op_dtype_t address_dtype(const insn_t &insn)
719{
720 return char(ad64(insn) ? dt_qword : ad32(insn) ? dt_dword : dt_word);
721}
722
723// return operand width in form of dt_... constant
724inline op_dtype_t operand_dtype(const insn_t &insn)
725{
726 return char(op64(insn) ? dt_qword : op32(insn) ? dt_dword : op16(insn) ? dt_word : dt_byte);
727}
728
729inline bool is_io_insn(const insn_t &insn)
730{
731 return insn.itype == NN_ins
732 || insn.itype == NN_outs
733 || insn.itype == NN_out
734 || insn.itype == NN_in;
735}
736
737//---------------------------------
738#define PROCMOD_NAME pc
739#define PROCMOD_NODE_NAME "$ vmm functions"
740#define IDPFLAGS_NODE_NAME "$ idpflags"
741#define EXC_NODE_NAME "$ ExceptionInfo $"
742#define BP_NODE_NAME "$ Bdsc $"
743#define WRONG_DECISIONS_NODE_NAME "$ handled wrong decisions"
744
745const char callee_tag = 'A';
746const char fbase_tag = 'b';
747const char frame_tag = 'f';
748const char purge_tag = 'p';
749const char ret_tag = 'r';
750const char pushinfo_tag = 's';
751const char is_ptr_tag = 'P';
752const char finally_tag = 'F';
753const char handler_tag = 'h';
754const char vxd_tag1 = 'V';
755const char vxd_tag2 = 'W';
756const char maybe_switch_tag = 'j';
757
758// fbase reg is a register used to access data for the current function
759// it is usually initialized by __i686_get_pc_thunk() function
760
762{
764 ea_t minea; // address where the fbase reg is defined
766};
767
768// the second operand of lea instruction should not be treated as memory reference
769// unless there is cs: prefix or the user has specified 'offset' flag
770// in other cases lea is used for arbirary calculations
771inline bool is_arith_lea(const insn_t &insn, const op_t &x)
772{
773 return insn.itype == NN_lea
774 && x.segrg != R_cs
775 && !is_off(get_flags(insn.ea), x.n);
776}
777
778inline bool is_push_ecx(uchar b)
779{
780 return b == 0x51; // push ecx
781}
782
783inline bool is_push_eax(uchar b)
784{
785 return b == 0x50; // push eax
786}
787
788inline bool is_push_edx(uchar b)
789{
790 return b == 0x52; // push edx
791}
792
793inline bool is_push_ebx(uchar b)
794{
795 return b == 0x53; // push ebx
796}
797
798inline bool is_volatile_reg(int r)
799{
800 return r != R_bx
801 && r != R_bp
802 && r != R_si
803 && r != R_di
804 && r != R_r12
805 && r != R_r13
806 && r != R_r14
807 && r != R_r15;
808}
809
810//------------------------------------------------------------------
812{
813 ea_t ea; // instruction ea
814 sval_t off; // offset from the frame top (sp delta)
815 sval_t width; // register width (or number of allocated bytes)
816 regnum_t reg; // register number (R_none means stack space allocation)
817 uint16 flags; // additional flags
818#define PRF_NONE 0x0000 // Entry describes a push or an allocation
819#define PRF_MOVE 0x0001 // Entry describes a register save by a move instruction
820#define PRF_SPILL 0x0002 // Indicates that entry is located before local stack region
821#define PRF_MASK (PRF_MOVE | PRF_SPILL)
822};
823
825{
826 enum { PUSHINFO_VERSION = 4 };
827 int flags;
828#define PINF_SEHCALL 0x0001 // call to SEH_prolog is present
829#define PINF_SEHMAN 0x0002 // Manual SEH setup
830#define PINF_COOKIE 0x0004 // Has security cookie
831#define PINF_ALIGNED 0x0008 // Lvars are align stred (visual studio)
832#define PINF_VARARG 0x0010 // Vararg prolog (currently used for gcc64)
833#define PINF_BPOFF 0x0020 // xmm_stkoff/reg_stkoff are from rbp (otherwise from rsp)
834#define PINF_HAVE_SSIZE 0x0040 // pushinfo_t structure contains its own size (field 'cb')
835#define PINF_PSI_FLAGS 0x0080 // pushreg_t structure contains flags field
836 qvector<pushreg_t> psi; // stack allocation instructions
837 ssize_t bpidx = -1; // index into psi
838 uint32 spoiled = 0; // bitmask of spoiled registers at the end of prolog
839
840 eavec_t prolog_insns; // additional prolog instruction addresses
841 // (in addition to instructions from psi)
842
844 pop_info_t pops; // pop insns for pushs (indexes shifted by one)
845 // in other words, this is epilog instructions
846 // index 0: epilog insns not linked to a push insn
847 // 1..psi.size(): epilog insns for each push insn
848 // usually there will be only one pop for each push.
849 // but there might be several pops for each push.
850 // (because the function has several returns)
851
852 int eh_type; // function has exception handling
853 // low 16 bits: type, high 16 bits: version
854#define EH_NONE 0 // no EH found
855#define EH_VCSEH 1 // SEH (__except_handlerN, __SEH_prologN)
856#define EH_VCCPPEH 2 // MSVC C++ EH (_EH_prolog[N])
858 {
859 if ( (eh_type & 0xFFFF) == EH_VCSEH )
860 return (eh_type >> 16) & 0xFFFF;
861 return 0;
862 }
863 int eh_ver()
864 {
865 if ( (eh_type & 0xFFFF) == EH_VCCPPEH )
866 return (eh_type >> 16) & 0xFFFF;
867 return 0;
868 }
869
870 ea_t eh_info = BADADDR; // for SEH: scopetable address, for C++ EH: __ehhandler address
871
872 // for gcc64 vararg (see PINF_VARARG):
873 sval_t xmm_stkoff = 0; // offset from ebp to xmm savearea
874 sval_t reg_stkoff = 0; // offset from ebp to gpreg savearea
875 // these 2 offsets are either from rsp or rbp
876 // see PINF_BPOFF for that
877 int xmm_nsaved = 0; // number of saved xmm regs
878 int reg_nsaved = 0; // number of saved general purpose regs
879
880 int cb = sizeof(pushinfo_t); // size of this structure
881
882 pushinfo_t(void) : flags(PINF_HAVE_SSIZE|PINF_PSI_FLAGS), eh_type(EH_NONE) {}
883 friend struct pushinfo_internal_t;
884};
885
898
899inline bool is_mingw_abi(void)
900{
901 if ( default_compiler() != COMP_MS )
902 return false; // "mingw" abi can be defined only for MSVC
903 qstring abiname;
904 get_abi_name(&abiname);
905 return abiname == "mingw";
906}
907
908inline bool is_msabi()
909{
910 comp_t comp = default_compiler();
911 return comp == COMP_MS || comp == COMP_UNK && inf_get_filetype() == f_PE;
912}
913
914inline bool is_msabi(callcnv_t cc)
915{
916 return cc == CM_CC_STDCALL || is_msabi();
917}
918
920{
921 return inf_is_64bit() && is_msabi(cc) ? 4 * 8 : 0;
922}
923
924struct regval_t;
925typedef const regval_t &idaapi getreg_t(const char *name, const regval_t *regvalues);
926
927// Structure where information about a mmx/xmm/ymm type is returned
929{
930 const char *name;
931 const type_t *type;
934};
935
936//----------------------------------------------------------------------
937// The following events are supported by the PC module in the processor_t::notify() function
938namespace pc_module_t
939{
941 {
943 // set AFIDP_DIFBASE flag
944 // in: int onoff
945 // Returns: nothing
946 ev_restore_pushinfo,// Restore function prolog info from the database
947 // in: pushinfo_t *pi
948 // ea_t func_start
949 // Returns: 1-ok, otherwise-failed
950 ev_save_pushinfo, // Save function prolog info to the database
951 // in: ea_t func_start
952 // pushinfo_t *pi
953 // Returns: 1-ok, otherwise-failed
954 ev_prolog_analyzed, // This event is generated by the PC module
955 // at the end of prolog analysis. Plugins may
956 // hook to it and improve the analysis.
957 // in: ea_t first_past_prolog_insn
958 // pushinfo_t *pi
959 // Returns: 1-ok, 2-ok but do not automatically verify epilog
960 ev_verify_epilog, // Verify function epilog
961 // in: int *answer
962 // pushinfo_t *pi
963 // const insn_t *insn
964 // 'insn' structure must be filled with the first epilog instruction
965 // number of verified epilog instructions will be in the 'answer'
966 // returns: 1-ok, otherwise-failed
967 obsolete_ev_find_reg_value, // not used anymore, use ev_find_reg_value
968 ev_dbgtools_path, // Returns the configuration value of the debugging tools path (from IDA.CFG)
969 // in: char *path
970 // size_t path_size
971 // returns: 1-if value is set, 0-if value not set in IDA.CFG
972 ev_is_get_pc_thunk, // Detect get_pc_thunk calls
973 // in: RegNo *p_reg,
974 // ea_t *p_end
975 // const insn_t *ins
976 // returns: 1-found, -1-not found, 0-not implemented
977
978 ev_vxd_loaded, // notification: a virtual device driver (Vxd) is loaded
979
981 // out: netnode *node
982 // returns: 1-found, -1-not found
984 // returns: nothing
985 ev_borland_template,// Applies Borland RTTI template for the given address
986 // in: ea_t ea,
987 // bool bp_mode if false - bc
988 // bool recursive
989 // returns: 1-created, -1-not created
990 ev_get_segval, // Get segment for the specified instruction operand
991 // in: ea_t *out,
992 // const insn_t *insn,
993 // const op_t *x
994 // returns: 1-success
995 ev_get_idpflags, // Get idpflags
996 // in: uint32 *idpflags
997 // returns: 1 success, fill IDPFLAGS
998 ev_get_ret_target, // Some 'ret' insns do not return from the function but are used for short jumps
999 // (for example: push off; ret). The following functions mark such 'ret' instructions.
1000 // in: ea_t ea
1001 // ea_t *target
1002 // returns: 1 success, fill TARGET
1003 ev_set_ret_target, // in: ea_t ea
1004 // ea_t target
1005 ev_del_ret_target, // in: ea_t ea
1006 };
1007
1009 {
1010 return processor_t::event_t(ev);
1011 }
1012
1013 inline void set_difbase(int onoff)
1014 {
1016 }
1017
1018 inline bool restore_pushinfo(pushinfo_t *pi, ea_t func_start)
1019 {
1020 return processor_t::notify(idp_ev(ev_restore_pushinfo), pi, func_start) == 1;
1021 }
1022
1023 inline bool save_pushinfo(ea_t func_start, pushinfo_t *pi)
1024 {
1025 return processor_t::notify(idp_ev(ev_save_pushinfo), func_start, pi) == 1;
1026 }
1027
1028 inline int prolog_analyzed(ea_t first_past_prolog_insn, pushinfo_t *pi)
1029 {
1030 return int(processor_t::notify(idp_ev(ev_prolog_analyzed), first_past_prolog_insn, pi));
1031 }
1032
1033 inline bool verify_epilog(int *answer, pushinfo_t *pi, const insn_t &insn)
1034 {
1035 return processor_t::notify(idp_ev(ev_verify_epilog), answer, pi, &insn) == 1;
1036 }
1037
1038 inline bool dbgtools_path(char *path, size_t path_size)
1039 {
1040 return processor_t::notify(idp_ev(ev_dbgtools_path), path, path_size) == 1;
1041 }
1042
1043 inline int is_get_pc_thunk(RegNo *p_reg, ea_t *p_end, const insn_t &insn)
1044 {
1045 return int(processor_t::notify(idp_ev(ev_is_get_pc_thunk), p_reg, p_end, &insn));
1046 }
1047
1048 inline int vxd_loaded()
1049 {
1051 }
1052
1054 {
1056 }
1057
1062
1063 inline bool borland_template(ea_t ea, bool bp_mode, bool recursive)
1064 {
1066 ea,
1067 bp_mode,
1068 recursive) > 0;
1069 }
1070
1071 inline ea_t get_segval(const insn_t &insn, const op_t &x)
1072 {
1073 ea_t ea = BADADDR;
1074 processor_t::notify(idp_ev(ev_get_segval), &ea, &insn, &x);
1075 return ea;
1076 }
1077
1079 {
1080 uint32 idpflags;
1082 return idpflags;
1083 }
1084
1085 inline bool get_ret_target(ea_t ea, ea_t *target)
1086 {
1087 return processor_t::notify(idp_ev(ev_get_ret_target), ea, target) == 1;
1088 }
1089
1090 inline void set_ret_target(ea_t ea, ea_t target)
1091 {
1093 }
1094
1095 inline void del_ret_target(ea_t ea)
1096 {
1098 }
1099
1100}
1101
1102//-------------------------------------------------------------------------
1103#define AFIDP_PUSH 0x0001 // push seg; push num; is converted to offset
1104#define AFIDP_NOP 0x0002 // db 90h after jmp is converted to nop
1105
1106#define AFIDP_MOVOFF 0x0004 // mov reg, numoff <- convert to offset
1107 // mov segreg, immseg
1108
1109#define AFIDP_MOVOFF2 0x0008 // mov z, numoff <- convert to offset
1110 // mov z, immseg
1111 // where z - o_mem, o_displ
1112#define AFIDP_ZEROINS 0x0010 // allow zero opcode instructions:
1113 // add [bx+si], al (16bit)
1114 // add [eax], al (32bit)
1115 // add [rax], al (64bit)
1116
1117#define AFIDP_BRTTI 0x0020 // Advanced analysis of Borlands RTTI
1118#define AFIDP_UNKRTTI 0x0040 // -"- with 'unknown_libname'
1119#define AFIDP_EXPFUNC 0x0080 // for PE? bc(ms?) - expanding
1120 // function (exception subblock)
1121#define AFIDP_DIFBASE 0x0100 // Allow references with different segment bases
1122#define AFIDP_NOPREF 0x0200 // Don't display superfluous prefixes
1123#define AFIDP_NOVXD 0x0400 // Don't interpret int 20 as VxDcall
1124#define AFIDP_NOFPEMU 0x0800 // Disable FPU emulation instructions
1125#define AFIDP_SHOWRIP 0x1000 // Explicit RIP-addressing
1126#define AFIDP_NOSEH 0x2000 // Disable SEH/EH analysis
1127#define AFIDP_INT3STOP 0x4000 // int 3 may stop code flow
1128 // call <func>
1129 // int 3 <- this is likely a no-return guard
1130#define AFIDP_NOAGGRJMPS 0x8000 // Don't aggressively convert jumps to thunk functions
1131 // 'NO' is used to simplify upgrading existing idbs
1132#define AFIDP_NO_USE_ANY_IND_OP 0x10000 // resolve indirect operands of 'jmpni/callni'
1133 // only for read-only memory
1134 // 'NO' is used to simplify upgrading existing idbs
1135
1136inline bool should_af_push(void) { return (pc_module_t::get_idpflags() & AFIDP_PUSH) != 0; }
1137inline bool should_af_nop(void) { return (pc_module_t::get_idpflags() & AFIDP_NOP) != 0; }
1138inline bool should_af_movoff(void) { return (pc_module_t::get_idpflags() & AFIDP_MOVOFF) != 0; }
1139inline bool should_af_movoff2(void) { return (pc_module_t::get_idpflags() & AFIDP_MOVOFF2) != 0; }
1140inline bool should_af_zeroins(void) { return (pc_module_t::get_idpflags() & AFIDP_ZEROINS) != 0; }
1141inline bool should_af_brtti(void) { return (pc_module_t::get_idpflags() & AFIDP_BRTTI) != 0; }
1142inline bool should_af_urtti(void) { return (pc_module_t::get_idpflags() & AFIDP_UNKRTTI) != 0; }
1143inline bool should_af_fexp(void) { return (pc_module_t::get_idpflags() & AFIDP_EXPFUNC) != 0; }
1144inline bool should_af_difbase(void) { return (pc_module_t::get_idpflags() & AFIDP_DIFBASE) != 0; }
1145inline bool should_af_nopref(void) { return (pc_module_t::get_idpflags() & AFIDP_NOPREF) != 0; }
1146inline bool should_af_vxd(void) { return (pc_module_t::get_idpflags() & AFIDP_NOVXD) == 0; }
1147inline bool should_af_fpemu(void) { return (pc_module_t::get_idpflags() & AFIDP_NOFPEMU) == 0; }
1148inline bool should_af_showrip(void) { return (pc_module_t::get_idpflags() & AFIDP_SHOWRIP) != 0; }
1149inline bool should_af_seh(void) { return (pc_module_t::get_idpflags() & AFIDP_NOSEH) == 0; }
1150inline bool should_af_int3stop(void) { return (pc_module_t::get_idpflags() & AFIDP_INT3STOP) != 0; }
1151inline bool should_af_aggrjmps(void) { return (pc_module_t::get_idpflags() & AFIDP_NOAGGRJMPS) == 0; }
1152inline bool should_af_use_any_ind_op(void) { return (pc_module_t::get_idpflags() & AFIDP_NO_USE_ANY_IND_OP) == 0; }
1153
1154//-------------------------------------------------------------------------
1155inline bool get_ret_target(ea_t ea, ea_t *target) { return pc_module_t::get_ret_target(ea, target); }
1156inline void set_ret_target(ea_t ea, ea_t target) { return pc_module_t::set_ret_target(ea, target); }
1157inline void del_ret_target(ea_t ea) { return pc_module_t::del_ret_target(ea); }
1158
1159//-------------------------------------------------------------------------
1160// Don't use the following define's with underscores at the start!
1161#define _PT_486p 0x00000001
1162#define _PT_486r 0x00000002
1163#define _PT_386p 0x00000004
1164#define _PT_386r 0x00000008
1165#define _PT_286p 0x00000010
1166#define _PT_286r 0x00000020
1167#define _PT_086 0x00000040
1168#define _PT_586p 0x00000080 // Pentium real mode
1169#define _PT_586r 0x00000100 // Pentium protected mode
1170#define _PT_686r 0x00000200 // Pentium Pro real
1171#define _PT_686p 0x00000400 // Pentium Pro protected
1172#define _PT_mmx 0x00000800 // MMX extensions
1173#define _PT_pii 0x00001000 // Pentium II
1174#define _PT_3d 0x00002000 // 3DNow! extensions
1175#define _PT_piii 0x00004000 // Pentium III
1176#define _PT_k7 0x00008000 // AMD K7
1177#define _PT_p4 0x00010000 // Pentium 4
1178#define _PT_sse3 0x00020000 // SSE3 + SSSE3
1179#define _PT_sse4 0x00040000 // SSE4.1 + SSE4.2
1180#define _PT_padlock 0x00080000 // PadLock VIA vendor extensions
1181
1182//
1183// The following values mean 'is XXX processor or better?'
1184//
1185
1186#define PT_sse4 _PT_sse4
1187#define PT_sse3 (_PT_sse3 | _PT_sse4 )
1188#define PT_p4 ( PT_sse3 | _PT_p4 )
1189#define PT_k7 ( PT_p4 | _PT_k7 )
1190#define PT_piii ( PT_k7 | _PT_piii )
1191#define PT_k62 ( PT_piii | _PT_3d )
1192#define PT_3d _PT_3d
1193#define PT_pii ( PT_piii | _PT_pii )
1194#define PT_mmx (_PT_mmx | _PT_3d )
1195#define PT_686p ( PT_pii | _PT_686p )
1196#define PT_686r ( PT_686p | _PT_686r )
1197#define PT_586p ( PT_686r | _PT_586p )
1198#define PT_586r ( PT_586p | _PT_586r )
1199#define PT_padlock _PT_padlock
1200#define PT_486p ( PT_586r | _PT_486p )
1201#define PT_486r ( PT_486p | _PT_486r )
1202#define PT_386p ( PT_486r | _PT_386p )
1203#define PT_386r ( PT_386p | _PT_386r )
1204#define PT_286p ( PT_386r | _PT_286p )
1205#define PT_286r ( PT_286p | _PT_286r )
1206#define PT_086 ( PT_286r | _PT_086 )
1207
1208//
1209// The following values mean 'is exactly XXX processor?'
1210//
1211
1212#define PT_ismmx (_PT_mmx )
1213#define PT_is686 (_PT_686r | _PT_686p)
1214#define PT_is586 (_PT_586r | _PT_586p)
1215#define PT_is486 (_PT_486r | _PT_486p)
1216#define PT_is386 (_PT_386r | _PT_386p)
1217#define PT_is286 (_PT_286r | _PT_286p)
1218#define PT_is086 (_PT_086)
1219
1220//---------------------------------------------------------------------
1222{
1223 return (type
1224 & (_PT_286p
1225 | _PT_386p
1226 | _PT_486p
1227 | _PT_586p
1228 | _PT_686p
1229 | _PT_pii)) != 0;
1230}
1231
1232inline bool isAMD(uint32 type) { return (type & PT_k7 ) != 0; }
1233inline bool isp4(uint32 type) { return (type & PT_p4 ) != 0; }
1234inline bool isp3(uint32 type) { return (type & PT_piii) != 0; }
1235inline bool is3dnow(uint32 type) { return (type & PT_3d ) != 0; }
1236inline bool ismmx(uint32 type) { return (type & PT_mmx ) != 0; }
1237inline bool isp2(uint32 type) { return (type & PT_pii ) != 0; }
1238inline bool is686(uint32 type) { return (type & PT_686r) != 0; }
1239inline bool is586(uint32 type) { return (type & PT_586r) != 0; }
1240inline bool is486(uint32 type) { return (type & PT_486r) != 0; }
1241inline bool is386(uint32 type) { return (type & PT_386r) != 0; } // is 386 or better ?
1242inline bool is286(uint32 type) { return (type & PT_286r) != 0; } // is 286 or better ?
1243
1244#endif // _INTEL_HPP
@ NN_jnc
Definition allins.hpp:79
@ NN_jnb
Definition allins.hpp:77
@ NN_vscatterdps
Definition allins.hpp:1593
@ NN_loopq
Definition allins.hpp:120
@ NN_vpgatherqd
Definition allins.hpp:1060
@ NN_jmp
Definition allins.hpp:95
@ NN_enterq
Definition allins.hpp:48
@ NN_pushfq
Definition allins.hpp:160
@ NN_vscatterpf1qps
Definition allins.hpp:1620
@ NN_jnae
Definition allins.hpp:76
@ NN_vscatterpf1qpd
Definition allins.hpp:1622
@ NN_jno
Definition allins.hpp:85
@ NN_retf
Definition allins.hpp:169
@ NN_vpscatterdq
Definition allins.hpp:1545
@ NN_leaveq
Definition allins.hpp:105
@ NN_jecxz
Definition allins.hpp:68
@ NN_jnbe
Definition allins.hpp:78
@ NN_jmpni
Definition allins.hpp:97
@ NN_pop
Definition allins.hpp:143
@ NN_jc
Definition allins.hpp:66
@ NN_jbe
Definition allins.hpp:65
@ NN_vgatherqps
Definition allins.hpp:952
@ NN_jne
Definition allins.hpp:80
@ NN_jnz
Definition allins.hpp:88
@ NN_jz
Definition allins.hpp:94
@ NN_out
Definition allins.hpp:141
@ NN_jae
Definition allins.hpp:63
@ NN_callfi
Definition allins.hpp:26
@ NN_jng
Definition allins.hpp:81
@ NN_jb
Definition allins.hpp:64
@ NN_call
Definition allins.hpp:25
@ NN_vpgatherqq
Definition allins.hpp:1061
@ NN_vgatherpf1qpd
Definition allins.hpp:1614
@ NN_vgatherpf0qpd
Definition allins.hpp:1610
@ NN_jge
Definition allins.hpp:72
@ NN_jo
Definition allins.hpp:89
@ NN_vpscatterqq
Definition allins.hpp:1547
@ NN_pushf
Definition allins.hpp:158
@ NN_jns
Definition allins.hpp:87
@ NN_loope
Definition allins.hpp:122
@ NN_jp
Definition allins.hpp:90
@ NN_jpo
Definition allins.hpp:92
@ NN_vscatterdpd
Definition allins.hpp:1594
@ NN_vscatterpf1dpd
Definition allins.hpp:1621
@ NN_loop
Definition allins.hpp:118
@ NN_in
Definition allins.hpp:52
@ NN_retn
Definition allins.hpp:168
@ NN_vscatterpf0dps
Definition allins.hpp:1615
@ NN_leave
Definition allins.hpp:103
@ NN_enter
Definition allins.hpp:46
@ NN_jna
Definition allins.hpp:75
@ NN_vscatterpf0qpd
Definition allins.hpp:1618
@ NN_vgatherdps
Definition allins.hpp:950
@ NN_retfq
Definition allins.hpp:803
@ NN_jpe
Definition allins.hpp:91
@ NN_popf
Definition allins.hpp:149
@ NN_jcxz
Definition allins.hpp:67
@ NN_vpscatterqd
Definition allins.hpp:1546
@ NN_ins
Definition allins.hpp:54
@ NN_jnle
Definition allins.hpp:84
@ NN_loopqne
Definition allins.hpp:128
@ NN_vscatterpf1dps
Definition allins.hpp:1619
@ NN_jnp
Definition allins.hpp:86
@ NN_loopne
Definition allins.hpp:126
@ NN_vscatterqpd
Definition allins.hpp:1596
@ NN_vscatterpf0qps
Definition allins.hpp:1616
@ NN_ja
Definition allins.hpp:62
@ NN_vgatherqpd
Definition allins.hpp:953
@ NN_vpscatterdd
Definition allins.hpp:1544
@ NN_lea
Definition allins.hpp:101
@ NN_outs
Definition allins.hpp:142
@ NN_vgatherpf0qps
Definition allins.hpp:1608
@ NN_jnge
Definition allins.hpp:82
@ NN_jl
Definition allins.hpp:73
@ NN_vgatherpf1dps
Definition allins.hpp:1611
@ NN_vscatterqps
Definition allins.hpp:1595
@ NN_vgatherdpd
Definition allins.hpp:951
@ NN_loopqe
Definition allins.hpp:124
@ NN_jmpshort
Definition allins.hpp:98
@ NN_jnl
Definition allins.hpp:83
@ NN_vscatterpf0dpd
Definition allins.hpp:1617
@ NN_js
Definition allins.hpp:93
@ NN_je
Definition allins.hpp:70
@ NN_callni
Definition allins.hpp:27
@ NN_vpgatherdq
Definition allins.hpp:1059
@ NN_vgatherpf0dpd
Definition allins.hpp:1609
@ NN_vgatherpf1dpd
Definition allins.hpp:1613
@ NN_jle
Definition allins.hpp:74
@ NN_popfq
Definition allins.hpp:151
@ NN_vpgatherdd
Definition allins.hpp:1058
@ NN_jrcxz
Definition allins.hpp:69
@ NN_vgatherpf1qps
Definition allins.hpp:1612
@ NN_vgatherpf0dps
Definition allins.hpp:1607
@ NN_retnq
Definition allins.hpp:800
@ NN_push
Definition allins.hpp:152
@ NN_jg
Definition allins.hpp:71
flags64_t idaapi get_flags(ea_t ea)
Get flags value for address 'ea'.
Definition bytes.hpp:282
Definition of the IDA database node.
Definition netnode.hpp:241
Operand of an instruction.
Definition ua.hpp:170
uchar n
Number of operand (0,1,2).
Definition ua.hpp:175
uint16 phrase
number of register phrase (o_phrase,o_displ).
Definition ua.hpp:257
optype_t type
Type of operand (see Operand types)
Definition ua.hpp:178
Reimplementation of vector class from STL.
Definition pro.h:2262
Primary mechanism for managing type information.
Definition typeinf.hpp:3077
idaman ssize_t ida_export get_abi_name(qstring *out)
Get ABI name.
comp_t default_compiler()
Get compiler specified by inf.cc.
Definition typeinf.hpp:1928
const callcnv_t CM_CC_STDCALL
stack, purged
Definition typeinf.hpp:888
const comp_t COMP_UNK
Unknown.
Definition typeinf.hpp:1881
const comp_t COMP_MS
Visual C++.
Definition typeinf.hpp:1882
idaman bool ida_export is_off(flags64_t F, int n)
is offset?
const optype_t o_mem
A direct memory reference to a data item.
Definition ua.hpp:84
const optype_t o_displ
An indirect memory reference that uses a register and has an immediate constant added to it: [reg+N] ...
Definition ua.hpp:89
const tinfo_t & type
Definition hexrays.hpp:7698
filetype_t inf_get_filetype()
Definition ida.hpp:694
@ f_PE
Portable Executable (PE)
Definition ida.hpp:48
uint32 callcnv_t
Definition ida.hpp:75
bool inf_is_64bit(void)
Definition ida.hpp:638
uchar comp_t
target compiler id
Definition ida.hpp:73
const int REX_R
Definition intel.hpp:84
bool should_af_use_any_ind_op(void)
Definition intel.hpp:1152
bool is_segreg(int r)
Definition intel.hpp:292
bool should_af_aggrjmps(void)
Definition intel.hpp:1151
int x86_index(const insn_t &insn, const op_t &x)
Definition intel.hpp:649
bool isAMD(uint32 type)
Definition intel.hpp:1232
CASSERT(PROC_MAXOP<=UA_MAXOP)
const regval_t &idaapi getreg_t(const char *name, const regval_t *regvalues)
Definition intel.hpp:925
bool insn_jcc(const insn_t &insn)
Definition intel.hpp:303
bool is_volatile_reg(int r)
Definition intel.hpp:798
bool should_af_push(void)
Definition intel.hpp:1136
bool is_ymmreg(int r)
Definition intel.hpp:296
bool should_af_vxd(void)
Definition intel.hpp:1146
void set_ret_target(ea_t ea, ea_t target)
Definition intel.hpp:1156
bool should_af_brtti(void)
Definition intel.hpp:1141
op_dtype_t address_dtype(const insn_t &insn)
Definition intel.hpp:718
const char maybe_switch_tag
Definition intel.hpp:756
bool isp2(uint32 type)
Definition intel.hpp:1237
bool mode32(const insn_t &insn)
Definition intel.hpp:387
bool is_mmxreg(int r)
Definition intel.hpp:294
bool evexpr(const insn_t &insn)
Definition intel.hpp:392
int has_displ(const op_t &x)
Definition intel.hpp:689
bool is_arith_lea(const insn_t &insn, const op_t &x)
Definition intel.hpp:771
bool should_af_nopref(void)
Definition intel.hpp:1145
const char purge_tag
Definition intel.hpp:748
const int EVEX_R
Definition intel.hpp:76
bool should_af_nop(void)
Definition intel.hpp:1137
RegNo
Definition intel.hpp:92
@ R_ymm28
Definition intel.hpp:240
@ R_ymm19
Definition intel.hpp:231
@ R_zmm29
Definition intel.hpp:274
@ R_xmm6
Definition intel.hpp:177
@ R_xmm31
Definition intel.hpp:226
@ R_xmm19
Definition intel.hpp:214
@ R_mm4
Definition intel.hpp:166
@ R_if
Definition intel.hpp:142
@ R_xmm16
Definition intel.hpp:211
@ R_fpstat
Definition intel.hpp:159
@ R_xmm25
Definition intel.hpp:220
@ R_mm6
Definition intel.hpp:168
@ R_ss
Definition intel.hpp:129
@ R_last
Definition intel.hpp:287
@ R_ymm31
Definition intel.hpp:243
@ R_st3
Definition intel.hpp:153
@ R_zmm0
Definition intel.hpp:245
@ R_bp
Definition intel.hpp:99
@ R_bnd3
Definition intel.hpp:209
@ R_fs
Definition intel.hpp:131
@ R_zmm17
Definition intel.hpp:262
@ R_xmm2
Definition intel.hpp:173
@ R_xmm29
Definition intel.hpp:224
@ R_ymm15
Definition intel.hpp:204
@ R_bnd1
Definition intel.hpp:207
@ R_xmm28
Definition intel.hpp:223
@ R_ymm25
Definition intel.hpp:237
@ R_gs
Definition intel.hpp:132
@ R_bx
Definition intel.hpp:97
@ R_r9
Definition intel.hpp:103
@ R_bpl
Definition intel.hpp:121
@ R_ymm0
Definition intel.hpp:189
@ R_k1
Definition intel.hpp:279
@ R_r13
Definition intel.hpp:107
@ R_dx
Definition intel.hpp:96
@ R_k0
Definition intel.hpp:278
@ R_zmm5
Definition intel.hpp:250
@ R_mm1
Definition intel.hpp:163
@ R_ymm14
Definition intel.hpp:203
@ R_sp
Definition intel.hpp:98
@ R_ymm3
Definition intel.hpp:192
@ R_cl
Definition intel.hpp:112
@ R_zmm21
Definition intel.hpp:266
@ R_st6
Definition intel.hpp:156
@ R_xmm23
Definition intel.hpp:218
@ R_ymm16
Definition intel.hpp:228
@ R_ymm10
Definition intel.hpp:199
@ R_ymm7
Definition intel.hpp:196
@ R_ymm18
Definition intel.hpp:230
@ R_xmm27
Definition intel.hpp:222
@ R_ip
Definition intel.hpp:125
@ R_k4
Definition intel.hpp:282
@ R_fpctrl
Definition intel.hpp:158
@ R_xmm7
Definition intel.hpp:178
@ R_zmm1
Definition intel.hpp:246
@ R_ymm20
Definition intel.hpp:232
@ R_zmm26
Definition intel.hpp:271
@ R_zmm20
Definition intel.hpp:265
@ R_ds
Definition intel.hpp:130
@ R_ymm13
Definition intel.hpp:202
@ R_xmm12
Definition intel.hpp:183
@ R_af
Definition intel.hpp:140
@ R_zmm11
Definition intel.hpp:256
@ R_zmm13
Definition intel.hpp:258
@ R_ymm23
Definition intel.hpp:235
@ R_r12
Definition intel.hpp:106
@ R_ch
Definition intel.hpp:116
@ R_zmm16
Definition intel.hpp:261
@ R_ax
Definition intel.hpp:94
@ R_ymm11
Definition intel.hpp:200
@ R_r15
Definition intel.hpp:109
@ R_mm5
Definition intel.hpp:167
@ R_ah
Definition intel.hpp:115
@ R_xmm3
Definition intel.hpp:174
@ R_k5
Definition intel.hpp:283
@ R_al
Definition intel.hpp:111
@ R_ymm27
Definition intel.hpp:239
@ R_dil
Definition intel.hpp:123
@ R_zmm24
Definition intel.hpp:269
@ R_ymm4
Definition intel.hpp:193
@ R_xmm5
Definition intel.hpp:176
@ R_ymm8
Definition intel.hpp:197
@ R_cf
Definition intel.hpp:134
@ R_ymm24
Definition intel.hpp:236
@ R_xmm8
Definition intel.hpp:179
@ R_zmm19
Definition intel.hpp:264
@ R_r10
Definition intel.hpp:104
@ R_zmm7
Definition intel.hpp:252
@ R_zmm25
Definition intel.hpp:270
@ R_spl
Definition intel.hpp:120
@ R_st0
Definition intel.hpp:150
@ R_ymm30
Definition intel.hpp:242
@ R_ymm1
Definition intel.hpp:190
@ R_xmm10
Definition intel.hpp:181
@ R_st7
Definition intel.hpp:157
@ R_zmm3
Definition intel.hpp:248
@ R_k6
Definition intel.hpp:284
@ R_zmm31
Definition intel.hpp:276
@ R_ymm17
Definition intel.hpp:229
@ R_xmm0
Definition intel.hpp:171
@ R_es
Definition intel.hpp:127
@ R_xmm20
Definition intel.hpp:215
@ R_xmm14
Definition intel.hpp:185
@ R_ymm5
Definition intel.hpp:194
@ R_xmm15
Definition intel.hpp:186
@ R_ymm12
Definition intel.hpp:201
@ R_of
Definition intel.hpp:137
@ R_mm3
Definition intel.hpp:165
@ R_xmm4
Definition intel.hpp:175
@ R_zmm27
Definition intel.hpp:272
@ R_di
Definition intel.hpp:101
@ R_k3
Definition intel.hpp:281
@ R_xmm11
Definition intel.hpp:182
@ R_zmm22
Definition intel.hpp:267
@ R_efl
Definition intel.hpp:145
@ R_st2
Definition intel.hpp:152
@ R_zmm23
Definition intel.hpp:268
@ R_zmm10
Definition intel.hpp:255
@ R_zmm6
Definition intel.hpp:251
@ R_xmm13
Definition intel.hpp:184
@ R_bh
Definition intel.hpp:118
@ R_zmm2
Definition intel.hpp:247
@ R_sf
Definition intel.hpp:136
@ R_tf
Definition intel.hpp:141
@ R_zmm4
Definition intel.hpp:249
@ R_dl
Definition intel.hpp:113
@ R_zmm28
Definition intel.hpp:273
@ R_xmm24
Definition intel.hpp:219
@ R_zmm18
Definition intel.hpp:263
@ R_si
Definition intel.hpp:100
@ R_bl
Definition intel.hpp:114
@ R_none
Definition intel.hpp:93
@ R_xmm21
Definition intel.hpp:216
@ R_ymm29
Definition intel.hpp:241
@ R_mm0
Definition intel.hpp:162
@ R_zmm30
Definition intel.hpp:275
@ R_ymm26
Definition intel.hpp:238
@ R_r11
Definition intel.hpp:105
@ R_xmm26
Definition intel.hpp:221
@ R_dh
Definition intel.hpp:117
@ R_ymm9
Definition intel.hpp:198
@ R_sil
Definition intel.hpp:122
@ R_k7
Definition intel.hpp:285
@ R_r8
Definition intel.hpp:102
@ R_zmm8
Definition intel.hpp:253
@ R_xmm30
Definition intel.hpp:225
@ R_k2
Definition intel.hpp:280
@ R_xmm22
Definition intel.hpp:217
@ R_xmm9
Definition intel.hpp:180
@ R_ymm21
Definition intel.hpp:233
@ R_mm7
Definition intel.hpp:169
@ R_zf
Definition intel.hpp:135
@ R_r14
Definition intel.hpp:108
@ R_ymm22
Definition intel.hpp:234
@ R_bnd0
Definition intel.hpp:206
@ R_zmm9
Definition intel.hpp:254
@ R_xmm1
Definition intel.hpp:172
@ R_xmm17
Definition intel.hpp:212
@ R_ymm6
Definition intel.hpp:195
@ R_zmm14
Definition intel.hpp:259
@ R_pf
Definition intel.hpp:139
@ R_zmm15
Definition intel.hpp:260
@ R_st1
Definition intel.hpp:151
@ R_st4
Definition intel.hpp:154
@ R_zmm12
Definition intel.hpp:257
@ R_xmm18
Definition intel.hpp:213
@ R_fptags
Definition intel.hpp:160
@ R_st5
Definition intel.hpp:155
@ R_cx
Definition intel.hpp:95
@ R_df
Definition intel.hpp:143
@ R_mxcsr
Definition intel.hpp:187
@ R_ymm2
Definition intel.hpp:191
@ R_mm2
Definition intel.hpp:164
@ R_cs
Definition intel.hpp:128
@ R_bnd2
Definition intel.hpp:208
bool is_vsib(const insn_t &insn)
Definition intel.hpp:461
bool xopexpr(const insn_t &insn)
Definition intel.hpp:393
const char handler_tag
Definition intel.hpp:753
int x86_base_reg(const insn_t &insn, const op_t &x)
Definition intel.hpp:612
op_dtype_t operand_dtype(const insn_t &insn)
Definition intel.hpp:724
bool isp4(uint32 type)
Definition intel.hpp:1233
const int INDEX_NONE
Definition intel.hpp:647
int sib_scale(const op_t &x)
Definition intel.hpp:596
const char vxd_tag2
Definition intel.hpp:755
int cvt_to_wholereg(int _reg, bool allow_high_byte_regs)
short regnum_t
Definition intel.hpp:89
const int REX_X
Definition intel.hpp:85
bool is_push_edx(uchar b)
Definition intel.hpp:788
bool op512(const insn_t &insn)
Definition intel.hpp:456
bool is486(uint32 type)
Definition intel.hpp:1240
bool is_io_insn(const insn_t &insn)
Definition intel.hpp:729
bool isProtected(uint32 type)
Definition intel.hpp:1221
bool is_push_ecx(uchar b)
Definition intel.hpp:778
bool is386(uint32 type)
Definition intel.hpp:1241
const int EVEX_z
Definition intel.hpp:78
const int EVEX_V
Definition intel.hpp:80
bool op32(const insn_t &insn)
Definition intel.hpp:428
bool ad16(const insn_t &insn)
Definition intel.hpp:395
int x86_base(const insn_t &insn, const op_t &x)
Definition intel.hpp:605
bool mem_as_displ(const insn_t &insn, const op_t &x)
Definition intel.hpp:704
bool is_xmmreg(int r)
Definition intel.hpp:295
int pc_shadow_area_size(callcnv_t cc)
Definition intel.hpp:919
const int VEX_L
Definition intel.hpp:87
spec_func_type_t
Definition intel.hpp:887
@ SF_ALLOCA
Definition intel.hpp:892
@ SF_NONE
Definition intel.hpp:888
@ SF_CHK
Definition intel.hpp:893
@ SF_EH_PROLOG
Definition intel.hpp:889
@ SF_SEH_PROLOG
Definition intel.hpp:890
@ SF_SEH_EPILOG
Definition intel.hpp:891
@ SF_LSTRCATN
Definition intel.hpp:896
@ SF_EH_EPILOG
Definition intel.hpp:895
@ SF_SYSINIT
Definition intel.hpp:894
bool should_af_showrip(void)
Definition intel.hpp:1148
bool is_fpureg(int r)
Definition intel.hpp:293
bool should_af_fexp(void)
Definition intel.hpp:1143
bool natad(const insn_t &insn)
Definition intel.hpp:389
bool natop(const insn_t &insn)
Definition intel.hpp:390
bool ismmx(uint32 type)
Definition intel.hpp:1236
const char is_ptr_tag
Definition intel.hpp:751
bool should_af_difbase(void)
Definition intel.hpp:1144
bool is_mingw_abi(void)
Definition intel.hpp:899
void del_ret_target(ea_t ea)
Definition intel.hpp:1157
const char vxd_tag1
Definition intel.hpp:754
regnum_t sib_index(const insn_t &insn, const op_t &x)
Definition intel.hpp:580
bool op256(const insn_t &insn)
Definition intel.hpp:448
const int REX_B
Definition intel.hpp:86
int calc_dbg_reg_index(const char *name)
bool should_af_urtti(void)
Definition intel.hpp:1142
bool isp3(uint32 type)
Definition intel.hpp:1234
bool is_push_eax(uchar b)
Definition intel.hpp:783
bool is3dnow(uint32 type)
Definition intel.hpp:1235
bool get_ret_target(ea_t ea, ea_t *target)
Definition intel.hpp:1155
const char callee_tag
Definition intel.hpp:745
bool mode16(const insn_t &insn)
Definition intel.hpp:386
const char ret_tag
Definition intel.hpp:749
bool should_af_int3stop(void)
Definition intel.hpp:1150
bool ad64(const insn_t &insn)
Definition intel.hpp:409
bool insn_default_opsize_64(const insn_t &insn)
Definition intel.hpp:343
bool has_tls_segpref(const insn_t &insn)
Definition intel.hpp:695
bool vexpr(const insn_t &insn)
Definition intel.hpp:391
bool ad32(const insn_t &insn)
Definition intel.hpp:401
const char fbase_tag
Definition intel.hpp:746
const int EVEX_L
Definition intel.hpp:77
bool should_af_fpemu(void)
Definition intel.hpp:1147
const char pushinfo_tag
Definition intel.hpp:750
const int EVEX_b
Definition intel.hpp:79
const char finally_tag
Definition intel.hpp:752
bool is586(uint32 type)
Definition intel.hpp:1239
bool should_af_zeroins(void)
Definition intel.hpp:1140
bool is_push_ebx(uchar b)
Definition intel.hpp:793
bool should_af_movoff2(void)
Definition intel.hpp:1139
bool op16(const insn_t &insn)
Definition intel.hpp:420
bool is286(uint32 type)
Definition intel.hpp:1242
bool is_stack_ref(const insn_t &insn, const op_t &x, int breg)
bool is686(uint32 type)
Definition intel.hpp:1238
bool should_af_seh(void)
Definition intel.hpp:1149
bool is_msabi()
Definition intel.hpp:908
bool should_af_movoff(void)
Definition intel.hpp:1138
bool op64(const insn_t &insn)
Definition intel.hpp:436
bool mode64(const insn_t &insn)
Definition intel.hpp:388
int x86_scale(const op_t &x)
Definition intel.hpp:683
regnum_t vsib_index_fixreg(const insn_t &insn, regnum_t index)
Definition intel.hpp:505
const int REX_W
Definition intel.hpp:83
const char frame_tag
Definition intel.hpp:747
int x86_index_reg(const insn_t &insn, const op_t &x)
Definition intel.hpp:654
int sib_base(const insn_t &insn, const op_t &x)
Definition intel.hpp:568
char * answer
Definition kernwin.hpp:8465
uchar type_t
In serialized form, a type is represented by a byte sequence.
Definition nalt.hpp:1312
Definition intel.hpp:939
int is_get_pc_thunk(RegNo *p_reg, ea_t *p_end, const insn_t &insn)
Definition intel.hpp:1043
bool borland_template(ea_t ea, bool bp_mode, bool recursive)
Definition intel.hpp:1063
void del_ret_target(ea_t ea)
Definition intel.hpp:1095
bool verify_epilog(int *answer, pushinfo_t *pi, const insn_t &insn)
Definition intel.hpp:1033
void set_ret_target(ea_t ea, ea_t target)
Definition intel.hpp:1090
bool dbgtools_path(char *path, size_t path_size)
Definition intel.hpp:1038
bool get_ret_target(ea_t ea, ea_t *target)
Definition intel.hpp:1085
processor_t::event_t idp_ev(event_codes_t ev)
Definition intel.hpp:1008
int prolog_analyzed(ea_t first_past_prolog_insn, pushinfo_t *pi)
Definition intel.hpp:1028
ea_t get_segval(const insn_t &insn, const op_t &x)
Definition intel.hpp:1071
bool get_borland_template_node(netnode *node)
Definition intel.hpp:1053
bool save_pushinfo(ea_t func_start, pushinfo_t *pi)
Definition intel.hpp:1023
bool restore_pushinfo(pushinfo_t *pi, ea_t func_start)
Definition intel.hpp:1018
void clear_borland_template_node(void)
Definition intel.hpp:1058
int vxd_loaded()
Definition intel.hpp:1048
void set_difbase(int onoff)
Definition intel.hpp:1013
event_codes_t
Definition intel.hpp:941
@ ev_set_ret_target
Definition intel.hpp:1003
@ ev_borland_template
Definition intel.hpp:985
@ ev_restore_pushinfo
Definition intel.hpp:946
@ ev_verify_epilog
Definition intel.hpp:960
@ ev_get_borland_template_node
Definition intel.hpp:980
@ obsolete_ev_find_reg_value
Definition intel.hpp:967
@ ev_prolog_analyzed
Definition intel.hpp:954
@ ev_set_difbase
Definition intel.hpp:942
@ ev_save_pushinfo
Definition intel.hpp:950
@ ev_del_ret_target
Definition intel.hpp:1005
@ ev_vxd_loaded
Definition intel.hpp:978
@ ev_clear_borland_template_node
Definition intel.hpp:983
@ ev_dbgtools_path
Definition intel.hpp:968
@ ev_is_get_pc_thunk
Definition intel.hpp:972
@ ev_get_idpflags
Definition intel.hpp:995
@ ev_get_segval
Definition intel.hpp:990
@ ev_get_ret_target
Definition intel.hpp:998
uint32 get_idpflags()
Definition intel.hpp:1078
unsigned short uint16
unsigned 16 bit value
Definition pro.h:350
unsigned int uint32
unsigned 32 bit value
Definition pro.h:352
uint8 op_dtype_t
Definition pro.h:464
adiff_t sval_t
signed value used by the processor.
Definition pro.h:450
short int16
signed 16 bit value
Definition pro.h:349
uint64 ea_t
Definition pro.h:425
unsigned char uchar
unsigned 8 bit value
Definition pro.h:341
qvector< ea_t > eavec_t
vector of addresses
Definition pro.h:2838
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:385
unsigned short ushort
unsigned 16 bit value
Definition pro.h:342
_qstring< char > qstring
regular string
Definition pro.h:3771
unsigned int
Definition pronet.h:99
Definition intel.hpp:762
ea_t minea
Definition intel.hpp:764
ea_t value
Definition intel.hpp:763
int16 reg
Definition intel.hpp:765
Definition intel.hpp:929
const type_t * type
Definition intel.hpp:931
const type_t * fields
Definition intel.hpp:932
tinfo_t tif
Definition intel.hpp:933
const char * name
Definition intel.hpp:930
event_t
Callback notification codes.
Definition idp.hpp:716
@ ev_loader
This code and higher ones are reserved for the loaders.
Definition idp.hpp:1919
static ssize_t notify(event_t event_code,...)
Definition idp.hpp:1927
Definition intel.hpp:825
@ PUSHINFO_VERSION
Definition intel.hpp:826
int xmm_nsaved
Definition intel.hpp:877
ea_t eh_info
Definition intel.hpp:870
qvector< eavec_t > pop_info_t
Definition intel.hpp:843
eavec_t prolog_insns
Definition intel.hpp:840
friend struct pushinfo_internal_t
Definition intel.hpp:883
int cb
Definition intel.hpp:880
ssize_t bpidx
Definition intel.hpp:837
sval_t reg_stkoff
Definition intel.hpp:874
int reg_nsaved
Definition intel.hpp:878
pushinfo_t(void)
Definition intel.hpp:882
pop_info_t pops
Definition intel.hpp:844
int seh_ver()
Definition intel.hpp:857
int flags
Definition intel.hpp:827
sval_t xmm_stkoff
Definition intel.hpp:873
int eh_type
Definition intel.hpp:852
qvector< pushreg_t > psi
Definition intel.hpp:836
int eh_ver()
Definition intel.hpp:863
uint32 spoiled
Definition intel.hpp:838
Definition intel.hpp:812
sval_t off
Definition intel.hpp:814
sval_t width
Definition intel.hpp:815
regnum_t reg
Definition intel.hpp:816
ea_t ea
Definition intel.hpp:813
uint16 flags
Definition intel.hpp:817
Structure to hold a register value.
Definition idd.hpp:563
Type information in IDA.
Functions that deal with the disassembling of program instructions.