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