#include <stdio.h>#include <string.h>#include "libdasm.h"#include "opcode_tables.h"
Functions | |
| __inline__ BYTE | FETCH8 (BYTE *addr) |
| __inline__ WORD | FETCH16 (BYTE *addr) |
| __inline__ DWORD | FETCH32 (BYTE *addr) |
| __inline__ enum Mode | MODE_CHECK_ADDR (enum Mode mode, int flags) |
| __inline__ enum Mode | MODE_CHECK_OPERAND (enum Mode mode, int flags) |
| int | get_real_instruction2 (BYTE *addr, int *flags) |
| int | get_real_instruction (BYTE *addr, int *index, int *flags) |
| int | get_operand (PINST inst, int oflags, PINSTRUCTION instruction, POPERAND op, BYTE *data, int offset, enum Mode mode, int iflags) |
| int | get_operand_string (INSTRUCTION *inst, OPERAND *op, enum Format format, DWORD offset, char *string, int length) |
| int | get_instruction (PINSTRUCTION inst, BYTE *addr, enum Mode mode) |
| int | get_mnemonic_string (INSTRUCTION *inst, enum Format format, char *string, int length) |
| int | get_operands_string (INSTRUCTION *inst, enum Format format, DWORD offset, char *string, int length) |
| int | get_instruction_string (INSTRUCTION *inst, enum Format format, DWORD offset, char *string, int length) |
| int | get_register_type (POPERAND op) |
| int | get_operand_type (POPERAND op) |
| int | get_operand_register (POPERAND op) |
| int | get_operand_basereg (POPERAND op) |
| int | get_operand_indexreg (POPERAND op) |
| int | get_operand_scale (POPERAND op) |
| int | get_operand_immediate (POPERAND op, DWORD *imm) |
| int | get_operand_displacement (POPERAND op, DWORD *disp) |
| POPERAND | get_source_operand (PINSTRUCTION inst) |
| POPERAND | get_destination_operand (PINSTRUCTION inst) |
References WORD.
Referenced by get_operand().
References DWORD.
Referenced by get_operand().
Referenced by get_operand().
| POPERAND get_destination_operand | ( | PINSTRUCTION | inst | ) |
References _INSTRUCTION::op1, OPERAND_TYPE_NONE, and _OPERAND::type.
| int get_instruction | ( | PINSTRUCTION | inst, | |
| BYTE * | addr, | |||
| enum Mode | mode | |||
| ) |
References _INSTRUCTION::dispbytes, EXT_CP, EXT_G7, EXT_GC, EXT_GD, EXT_GE, EXT_T2, _INSTRUCTION::extindex, _INSTRUCTION::flags, _INST::flags1, _INST::flags2, _INST::flags3, _INSTRUCTION::fpuindex, get_operand(), get_real_instruction(), get_real_instruction2(), _INSTRUCTION::immbytes, emu_cpu_instruction::index, inst_monitor, inst_mwait, inst_table1, inst_table2, inst_table3_66, inst_table3_f2, inst_table3_f3, inst_table4, inst_table_ext, inst_table_ext12, inst_table_ext12_66, inst_table_ext13, inst_table_ext13_66, inst_table_ext14, inst_table_ext14_66, inst_table_ext7, _INSTRUCTION::length, MASK_EXT, MASK_MODRM_MOD, MASK_MODRM_REG, MASK_MODRM_RM, MASK_PREFIX_G1, MASK_PREFIX_OPERAND, MASK_TYPE_FLAGS, MASK_TYPE_VALUE, _INST::mnemonic, _INSTRUCTION::mode, _INSTRUCTION::op1, _INSTRUCTION::op2, _INSTRUCTION::op3, _INSTRUCTION::opcode, _INSTRUCTION::ptr, _INSTRUCTION::type, _INST::type, and TYPE_3.
Referenced by dasm_print_instruction().

| int get_instruction_string | ( | INSTRUCTION * | inst, | |
| enum Format | format, | |||
| DWORD | offset, | |||
| char * | string, | |||
| int | length | |||
| ) |
References get_mnemonic_string(), and get_operands_string().
Referenced by dasm_print_instruction().

| int get_mnemonic_string | ( | INSTRUCTION * | inst, | |
| enum Format | format, | |||
| char * | string, | |||
| int | length | |||
| ) |
References AM_I, EXT_T2, _OPERAND::flags, _INSTRUCTION::flags, FORMAT_ATT, _OPERAND::immbytes, INSTRUCTION_TYPE_JMPC, INSTRUCTION_TYPE_POP, INSTRUCTION_TYPE_PUSH, MASK_AM, MASK_EXT, MASK_MODRM_MOD, MASK_OT, MASK_PREFIX_ADDR, MASK_PREFIX_G1, MASK_PREFIX_G2, MASK_PREFIX_OPERAND, _INST::mnemonic, _INSTRUCTION::mode, MODE_16, MODE_32, MODE_CHECK_OPERAND(), _INSTRUCTION::modrm, _INST::modrm, _INSTRUCTION::op1, _INSTRUCTION::op2, _INSTRUCTION::opcode, OPERAND_TYPE_IMMEDIATE, OPERAND_TYPE_MEMORY, OT_b, OT_d, OT_v, OT_w, _INSTRUCTION::ptr, REG_BRANCH, REG_SEGMENT, reg_table, rep_table, _INSTRUCTION::type, and _OPERAND::type.
Referenced by get_instruction_string().

| int get_operand | ( | PINST | inst, | |
| int | oflags, | |||
| PINSTRUCTION | instruction, | |||
| POPERAND | op, | |||
| BYTE * | data, | |||
| int | offset, | |||
| enum Mode | mode, | |||
| int | iflags | |||
| ) |
References AM_A, AM_C, AM_D, AM_E, AM_G, AM_I, AM_I1, AM_IND, AM_J, AM_M, AM_O, AM_P, AM_Q, AM_R, AM_REG, AM_S, AM_T, AM_V, AM_W, _OPERAND::basereg, _INSTRUCTION::dispbytes, _OPERAND::dispbytes, _OPERAND::displacement, _OPERAND::dispoffset, F_s, FETCH16(), FETCH32(), FETCH8(), _OPERAND::flags, FLAGS_NONE, _INSTRUCTION::immbytes, _OPERAND::immbytes, _OPERAND::immediate, _OPERAND::immoffset, emu_cpu_instruction::index, _OPERAND::indexreg, _INSTRUCTION::length, MASK_AM, MASK_FLAGS, MASK_MODRM_MOD, MASK_MODRM_REG, MASK_MODRM_RM, MASK_OT, MASK_REG, MASK_SIB_BASE, MASK_SIB_INDEX, MASK_SIB_SCALE, MODE_16, MODE_32, MODE_CHECK_ADDR(), MODE_CHECK_OPERAND(), _INSTRUCTION::modrm, _INST::modrm, OPERAND_TYPE_IMMEDIATE, OPERAND_TYPE_MEMORY, OPERAND_TYPE_NONE, OPERAND_TYPE_REGISTER, OT_b, OT_v, OT_w, _OPERAND::reg, emu_cpu_instruction::reg, REG_EBP, REG_EBX, REG_EDI, REG_ESI, REG_ESP, REG_NOP, _OPERAND::scale, emu_cpu_instruction::scale, _OPERAND::section, _INSTRUCTION::sectionbytes, _INSTRUCTION::sib, emu_cpu_instruction::sib, and _OPERAND::type.
Referenced by get_instruction().

| int get_operand_basereg | ( | POPERAND | op | ) |
References _OPERAND::basereg.
References _OPERAND::dispbytes, and _OPERAND::displacement.
References _OPERAND::immbytes, and _OPERAND::immediate.
| int get_operand_indexreg | ( | POPERAND | op | ) |
References _OPERAND::indexreg.
| int get_operand_register | ( | POPERAND | op | ) |
References _OPERAND::reg.
| int get_operand_scale | ( | POPERAND | op | ) |
References _OPERAND::scale.
| int get_operand_string | ( | INSTRUCTION * | inst, | |
| OPERAND * | op, | |||
| enum Format | format, | |||
| DWORD | offset, | |||
| char * | string, | |||
| int | length | |||
| ) |
References AM_A, AM_C, AM_D, AM_E, AM_G, AM_I, AM_I1, AM_J, AM_P, AM_Q, AM_R, AM_REG, AM_S, AM_T, AM_V, AM_W, _OPERAND::basereg, _INSTRUCTION::dispbytes, _OPERAND::dispbytes, _OPERAND::displacement, DWORD, F_f, F_r, _OPERAND::flags, _INSTRUCTION::flags, FORMAT_ATT, _OPERAND::immediate, _OPERAND::indexreg, _INSTRUCTION::length, MASK_AM, MASK_FLAGS, MASK_OT, MASK_PERMS, MASK_PREFIX_G2, _INSTRUCTION::mode, MODE_32, MODE_CHECK_ADDR(), MODE_CHECK_OPERAND(), OPERAND_TYPE_IMMEDIATE, OPERAND_TYPE_MEMORY, OPERAND_TYPE_REGISTER, OT_b, OT_d, OT_v, OT_w, P_x, _OPERAND::reg, REG_CONTROL, REG_DEBUG, REG_FPU, REG_GEN_BYTE, REG_GEN_DWORD, REG_GEN_WORD, REG_MMX, REG_NOP, REG_SEGMENT, reg_table, REG_TEST, REG_XMM, _OPERAND::scale, _OPERAND::section, and _OPERAND::type.
Referenced by get_operands_string().

| int get_operand_type | ( | POPERAND | op | ) |
References _OPERAND::type.
| int get_operands_string | ( | INSTRUCTION * | inst, | |
| enum Format | format, | |||
| DWORD | offset, | |||
| char * | string, | |||
| int | length | |||
| ) |
References FORMAT_ATT, FORMAT_INTEL, get_operand_string(), _INSTRUCTION::op1, _INSTRUCTION::op2, _INSTRUCTION::op3, OPERAND_TYPE_NONE, and _OPERAND::type.
Referenced by get_instruction_string().

| int get_real_instruction | ( | BYTE * | addr, | |
| int * | index, | |||
| int * | flags | |||
| ) |
References EXT_CP, EXT_G1_1, EXT_G1_2, EXT_G1_3, EXT_G2_1, EXT_G2_2, EXT_G2_3, EXT_G2_4, EXT_G2_5, EXT_G2_6, EXT_G3_1, EXT_G3_2, EXT_G4, EXT_G5, EXT_T2, PREFIX_ADDR_SIZE_OVERRIDE, PREFIX_CS_OVERRIDE, PREFIX_DS_OVERRIDE, PREFIX_ES_OVERRIDE, PREFIX_FS_OVERRIDE, PREFIX_GS_OVERRIDE, PREFIX_LOCK, PREFIX_OPERAND_SIZE_OVERRIDE, PREFIX_REP, PREFIX_REPNE, and PREFIX_SS_OVERRIDE.
Referenced by get_instruction().
| int get_real_instruction2 | ( | BYTE * | addr, | |
| int * | flags | |||
| ) |
| int get_register_type | ( | POPERAND | op | ) |
References AM_C, AM_D, AM_E, AM_G, AM_P, AM_Q, AM_R, AM_REG, AM_S, AM_T, AM_V, AM_W, F_f, F_r, _OPERAND::flags, MASK_AM, MASK_FLAGS, OPERAND_TYPE_REGISTER, REGISTER_TYPE_CONTROL, REGISTER_TYPE_DEBUG, REGISTER_TYPE_FPU, REGISTER_TYPE_GEN, REGISTER_TYPE_MMX, REGISTER_TYPE_SEGMENT, REGISTER_TYPE_TEST, REGISTER_TYPE_XMM, and _OPERAND::type.
| POPERAND get_source_operand | ( | PINSTRUCTION | inst | ) |
References _INSTRUCTION::op2, OPERAND_TYPE_NONE, and _OPERAND::type.
References MASK_PREFIX_ADDR, MODE_16, and MODE_32.
Referenced by get_operand(), and get_operand_string().
References MASK_PREFIX_OPERAND, MODE_16, and MODE_32.
Referenced by get_mnemonic_string(), get_operand(), and get_operand_string().
1.6.1