Lines Matching refs:op
380 decode_a(struct ud* u, struct ud_operand *op) in decode_a() argument
384 op->type = UD_OP_PTR; in decode_a()
385 op->size = 32; in decode_a()
386 op->lval.ptr.off = inp_uint16(u); in decode_a()
387 op->lval.ptr.seg = inp_uint16(u); in decode_a()
390 op->type = UD_OP_PTR; in decode_a()
391 op->size = 48; in decode_a()
392 op->lval.ptr.off = inp_uint32(u); in decode_a()
393 op->lval.ptr.seg = inp_uint16(u); in decode_a()
472 decode_imm(struct ud* u, unsigned int size, struct ud_operand *op) in decode_imm() argument
474 op->size = resolve_operand_size(u, size); in decode_imm()
475 op->type = UD_OP_IMM; in decode_imm()
477 switch (op->size) { in decode_imm()
478 case 8: op->lval.sbyte = inp_uint8(u); break; in decode_imm()
479 case 16: op->lval.uword = inp_uint16(u); break; in decode_imm()
480 case 32: op->lval.udword = inp_uint32(u); break; in decode_imm()
481 case 64: op->lval.uqword = inp_uint64(u); break; in decode_imm()
493 decode_mem_disp(struct ud* u, unsigned int size, struct ud_operand *op) in decode_mem_disp() argument
497 op->offset = 8; in decode_mem_disp()
498 op->lval.ubyte = inp_uint8(u); in decode_mem_disp()
501 op->offset = 16; in decode_mem_disp()
502 op->lval.uword = inp_uint16(u); in decode_mem_disp()
505 op->offset = 32; in decode_mem_disp()
506 op->lval.udword = inp_uint32(u); in decode_mem_disp()
509 op->offset = 64; in decode_mem_disp()
510 op->lval.uqword = inp_uint64(u); in decode_mem_disp()
543 struct ud_operand *op, in decode_modrm_rm() argument
560 decode_reg(u, op, type, rm, size); in decode_modrm_rm()
567 op->type = UD_OP_MEM; in decode_modrm_rm()
568 op->size = resolve_operand_size(u, size); in decode_modrm_rm()
571 op->base = UD_R_RAX + rm; in decode_modrm_rm()
577 op->base = UD_R_RIP; in decode_modrm_rm()
588 op->base = UD_R_RAX + (SIB_B(inp_curr(u)) | (REX_B(u->_rex) << 3)); in decode_modrm_rm()
589 op->index = UD_R_RAX + (SIB_I(inp_curr(u)) | (REX_X(u->_rex) << 3)); in decode_modrm_rm()
591 if (op->index == UD_R_RSP) { in decode_modrm_rm()
592 op->index = UD_NONE; in decode_modrm_rm()
593 op->scale = UD_NONE; in decode_modrm_rm()
595 op->scale = (1 << SIB_S(inp_curr(u))) & ~1; in decode_modrm_rm()
598 if (op->base == UD_R_RBP || op->base == UD_R_R13) { in decode_modrm_rm()
600 op->base = UD_NONE; in decode_modrm_rm()
609 op->scale = UD_NONE; in decode_modrm_rm()
610 op->index = UD_NONE; in decode_modrm_rm()
613 op->base = UD_R_EAX + rm; in decode_modrm_rm()
619 op->base = UD_NONE; in decode_modrm_rm()
629 op->scale = (1 << SIB_S(inp_curr(u))) & ~1; in decode_modrm_rm()
630 op->index = UD_R_EAX + (SIB_I(inp_curr(u)) | (REX_X(u->pfx_rex) << 3)); in decode_modrm_rm()
631 op->base = UD_R_EAX + (SIB_B(inp_curr(u)) | (REX_B(u->pfx_rex) << 3)); in decode_modrm_rm()
633 if (op->index == UD_R_ESP) { in decode_modrm_rm()
634 op->index = UD_NONE; in decode_modrm_rm()
635 op->scale = UD_NONE; in decode_modrm_rm()
639 if (op->base == UD_R_EBP) { in decode_modrm_rm()
641 op->base = UD_NONE; in decode_modrm_rm()
650 op->scale = UD_NONE; in decode_modrm_rm()
651 op->index = UD_NONE; in decode_modrm_rm()
658 op->base = bases[rm & 7]; in decode_modrm_rm()
659 op->index = indices[rm & 7]; in decode_modrm_rm()
660 op->scale = UD_NONE; in decode_modrm_rm()
663 op->base = UD_NONE; in decode_modrm_rm()
672 decode_mem_disp(u, offset, op); in decode_modrm_rm()
674 op->offset = 0; in decode_modrm_rm()