Module ida_idp
[frames] | no frames]

Module ida_idp

IDA Plugin SDK API wrapper: idp

Classes
  asm_t
Proxy of C++ asm_t class
  reg_info_t
Proxy of C++ reg_info_t class
  IDP_Hooks
Proxy of C++ IDP_Hooks class
  processor_t
Base class for all processor module scripts
  IDB_Hooks
Proxy of C++ IDB_Hooks class
Functions
PyObject *
AssembleLine(ea, cs, ip, use32, nonnul_line)
Assemble an instruction to a string (display a warning if an error is found)
bool
has_cf_chg(feature, opnum)
bool
has_cf_use(feature, opnum)
bool
has_insn_feature(icode, bit)
bool
is_call_insn(insn)
bool
is_ret_insn(insn, strict=True)
bool
is_indirect_jump_insn(insn)
bool
is_basic_block_end(insn, call_insn_stops_block)
int
str2reg(p)
int
is_align_insn(ea)
ssize_t
get_reg_name(reg, width, reghi=-1)
char const *
get_reg_info(regname, bitrange)
int
compare(a, b)
compare(a, b) -> int compare(a, b) -> int compare(a, b) -> int
bool
parse_reg_name(ri, regname)
size_t
sizeof_ldbl()
bool
set_processor_type(procname, level)
char *
get_idp_name()
bool
set_target_assembler(asmnum)
bool
delay_slot_insn(ea, bexec, fexec)
char const *
cfg_get_cc_parm(compid, name)
char const *
cfg_get_cc_header_path(compid)
char const *
cfg_get_cc_predefined_macros(compid)
bool
assemble(ea, cs, ip, use32, line)
Assemble an instruction into the database (display a warning if an error is found)
size_t
ph_get_id()
Returns the 'ph.id' field
size_t
ph_get_version()
Returns the 'ph.version'
size_t
ph_get_flag()
Returns the 'ph.flag'
size_t
ph_get_cnbits()
Returns the 'ph.cnbits'
size_t
ph_get_dnbits()
Returns the 'ph.dnbits'
size_t
ph_get_reg_first_sreg()
Returns the 'ph.reg_first_sreg'
size_t
ph_get_reg_last_sreg()
Returns the 'ph.reg_last_sreg'
size_t
ph_get_segreg_size()
Returns the 'ph.segreg_size'
size_t
ph_get_reg_code_sreg()
Returns the 'ph.reg_code_sreg'
size_t
ph_get_reg_data_sreg()
Returns the 'ph.reg_data_sreg'
size_t
ph_get_icode_return()
Returns the 'ph.icode_return'
size_t
ph_get_instruc_start()
Returns the 'ph.instruc_start'
size_t
ph_get_instruc_end()
Returns the 'ph.instruc_end'
size_t
ph_get_tbyte_size()
Returns the 'ph.tbyte_size' field as defined in he processor module
PyObject *
ph_get_instruc()
Returns a list of tuples (instruction_name, instruction_feature) containing the instructions list as defined in he processor module
PyObject *
ph_get_regnames()
Returns the list of register names as defined in the processor module
PyObject *
ph_get_operand_info(ea, n)
Returns the operand information given an ea and operand number.
Variables
  IDP_INTERFACE_VERSION = 700
  AS_OFFST = 1
  AS_COLON = 2
  AS_UDATA = 4
  AS_2CHRE = 8
  AS_NCHRE = 16
  AS_N2CHR = 32
  AS_1TEXT = 64
  AS_NHIAS = 128
  AS_NCMAS = 256
  AS_HEXFM = 3584
  ASH_HEXF0 = 0
  ASH_HEXF1 = 512
  ASH_HEXF2 = 1024
  ASH_HEXF3 = 1536
  ASH_HEXF4 = 2048
  ASH_HEXF5 = 2560
  AS_DECFM = 12288
  ASD_DECF0 = 0
  ASD_DECF1 = 4096
  ASD_DECF2 = 8192
  ASD_DECF3 = 12288
  AS_OCTFM = 114688
  ASO_OCTF0 = 0
  ASO_OCTF1 = 16384
  ASO_OCTF2 = 32768
  ASO_OCTF3 = 49152
  ASO_OCTF4 = 65536
  ASO_OCTF5 = 81920
  ASO_OCTF6 = 98304
  ASO_OCTF7 = 114688
  AS_BINFM = 917504
  ASB_BINF0 = 0
  ASB_BINF1 = 131072
  ASB_BINF2 = 262144
  ASB_BINF3 = 393216
  ASB_BINF4 = 524288
  ASB_BINF5 = 655360
  AS_UNEQU = 1048576
  AS_ONEDUP = 2097152
  AS_NOXRF = 4194304
  AS_XTRNTYPE = 8388608
  AS_RELSUP = 16777216
  AS_LALIGN = 33554432
  AS_NOCODECLN = 67108864
  AS_NOSPACE = 268435456
  AS_ALIGN2 = 536870912
  AS_ASCIIC = 1073741824
  AS_ASCIIZ = 2147483648
  AS2_BRACE = 1
  AS2_STRINV = 2
  AS2_BYTE1CHAR = 4
  AS2_IDEALDSCR = 8
  AS2_TERSESTR = 16
  AS2_COLONSUF = 32
  AS2_YWORD = 64
  cvar = _ida_idp.cvar
  SETPROC_IDB = 0
  SETPROC_LOADER = 1
  SETPROC_LOADER_NON_FATAL = 2
  SETPROC_USER = 3
  closebase = 0
  savebase = 1
  upgraded = 2
  auto_empty = 3
  auto_empty_finally = 4
  determined_main = 5
  local_types_changed = 6
  extlang_changed = 7
  idasgn_loaded = 8
  kernel_config_loaded = 9
  loader_finished = 10
  flow_chart_created = 11
  compiler_changed = 12
  changing_ti = 13
  ti_changed = 14
  changing_op_ti = 15
  op_ti_changed = 16
  changing_op_type = 17
  op_type_changed = 18
  enum_created = 19
  deleting_enum = 20
  enum_deleted = 21
  renaming_enum = 22
  enum_renamed = 23
  changing_enum_bf = 24
  enum_bf_changed = 25
  changing_enum_cmt = 26
  enum_cmt_changed = 27
  enum_member_created = 28
  deleting_enum_member = 29
  enum_member_deleted = 30
  struc_created = 31
  deleting_struc = 32
  struc_deleted = 33
  changing_struc_align = 34
  struc_align_changed = 35
  renaming_struc = 36
  struc_renamed = 37
  expanding_struc = 38
  struc_expanded = 39
  struc_member_created = 40
  deleting_struc_member = 41
  struc_member_deleted = 42
  renaming_struc_member = 43
  struc_member_renamed = 44
  changing_struc_member = 45
  struc_member_changed = 46
  changing_struc_cmt = 47
  struc_cmt_changed = 48
  segm_added = 49
  deleting_segm = 50
  segm_deleted = 51
  changing_segm_start = 52
  segm_start_changed = 53
  changing_segm_end = 54
  segm_end_changed = 55
  changing_segm_name = 56
  segm_name_changed = 57
  changing_segm_class = 58
  segm_class_changed = 59
  segm_attrs_updated = 60
  segm_moved = 61
  allsegs_moved = 62
  func_added = 63
  func_updated = 64
  set_func_start = 65
  set_func_end = 66
  deleting_func = 67
  frame_deleted = 68
  thunk_func_created = 69
  func_tail_appended = 70
  deleting_func_tail = 71
  func_tail_deleted = 72
  tail_owner_changed = 73
  func_noret_changed = 74
  stkpnts_changed = 75
  updating_tryblks = 76
  tryblks_updated = 77
  deleting_tryblks = 78
  sgr_changed = 79
  make_code = 80
  make_data = 81
  destroyed_items = 82
  renamed = 83
  byte_patched = 84
  changing_cmt = 85
  cmt_changed = 86
  changing_range_cmt = 87
  range_cmt_changed = 88
  extra_cmt_changed = 89
  IDPOPT_CST = 6
  IDPOPT_PRI_DEFAULT = 1
  IDPOPT_PRI_HIGH = 2
  IDPOPT_NUM_INT = 0
  IDPOPT_NUM_CHAR = 16777216
  IDPOPT_NUM_SHORT = 33554432
  IDPOPT_NUM_RANGE = 67108864
  IDPOPT_NUM_UNS = 134217728
  IDPOPT_BIT_UINT = 0
  IDPOPT_BIT_UCHAR = 16777216
  IDPOPT_BIT_USHORT = 33554432
  IDPOPT_BIT_BOOL = 50331648
  IDPOPT_BIT_INVRES = 67108864
  IDPOPT_STR_QSTRING = 16777216
  IDPOPT_STR_LONG = 33554432
  IDPOPT_I64_RANGES = 16777216
  IDPOPT_I64_UNS = 33554432
  CUSTOM_INSN_ITYPE = 32768
  REG_SPOIL = 2147483648
  REAL_ERROR_FORMAT = -1
  REAL_ERROR_RANGE = -2
  REAL_ERROR_BADDATA = -3
  OP_FP_BASED = 0
  OP_SP_BASED = 1
  OP_SP_ADD = 0
  OP_SP_SUB = 2
  PLFM_386 = 0
  PLFM_Z80 = 1
  PLFM_I860 = 2
  PLFM_8051 = 3
  PLFM_TMS = 4
  PLFM_6502 = 5
  PLFM_PDP = 6
  PLFM_68K = 7
  PLFM_JAVA = 8
  PLFM_6800 = 9
  PLFM_ST7 = 10
  PLFM_MC6812 = 11
  PLFM_MIPS = 12
  PLFM_ARM = 13
  PLFM_TMSC6 = 14
  PLFM_PPC = 15
  PLFM_80196 = 16
  PLFM_Z8 = 17
  PLFM_SH = 18
  PLFM_NET = 19
  PLFM_AVR = 20
  PLFM_H8 = 21
  PLFM_PIC = 22
  PLFM_SPARC = 23
  PLFM_ALPHA = 24
  PLFM_HPPA = 25
  PLFM_H8500 = 26
  PLFM_TRICORE = 27
  PLFM_DSP56K = 28
  PLFM_C166 = 29
  PLFM_ST20 = 30
  PLFM_IA64 = 31
  PLFM_I960 = 32
  PLFM_F2MC = 33
  PLFM_TMS320C54 = 34
  PLFM_TMS320C55 = 35
  PLFM_TRIMEDIA = 36
  PLFM_M32R = 37
  PLFM_NEC_78K0 = 38
  PLFM_NEC_78K0S = 39
  PLFM_M740 = 40
  PLFM_M7700 = 41
  PLFM_ST9 = 42
  PLFM_FR = 43
  PLFM_MC6816 = 44
  PLFM_M7900 = 45
  PLFM_TMS320C3 = 46
  PLFM_KR1878 = 47
  PLFM_AD218X = 48
  PLFM_OAKDSP = 49
  PLFM_TLCS900 = 50
  PLFM_C39 = 51
  PLFM_CR16 = 52
  PLFM_MN102L00 = 53
  PLFM_TMS320C1X = 54
  PLFM_NEC_V850X = 55
  PLFM_SCR_ADPT = 56
  PLFM_EBC = 57
  PLFM_MSP430 = 58
  PLFM_SPU = 59
  PR_SEGS = 1
  PR_USE32 = 2
  PR_DEFSEG32 = 4
  PR_RNAMESOK = 8
  PR_ADJSEGS = 32
  PR_DEFNUM = 192
  PRN_HEX = 0
  PRN_OCT = 64
  PRN_DEC = 128
  PRN_BIN = 192
  PR_WORD_INS = 256
  PR_NOCHANGE = 512
  PR_ASSEMBLE = 1024
  PR_ALIGN = 2048
  PR_TYPEINFO = 4096
  PR_USE64 = 8192
  PR_SGROTHER = 16384
  PR_STACK_UP = 32768
  PR_BINMEM = 65536
  PR_SEGTRANS = 131072
  PR_CHK_XREF = 262144
  PR_NO_SEGMOVE = 524288
  PR_USE_ARG_TYPES = 2097152
  PR_SCALE_STKVARS = 4194304
  PR_DELAYED = 8388608
  PR_ALIGN_INSN = 16777216
  PR_PURGING = 33554432
  PR_CNDINSNS = 67108864
  PR_USE_TBYTE = 134217728
  PR_DEFSEG64 = 268435456
  CF_STOP = 1
  CF_CALL = 2
  CF_CHG1 = 4
  CF_CHG2 = 8
  CF_CHG3 = 16
  CF_CHG4 = 32
  CF_CHG5 = 64
  CF_CHG6 = 128
  CF_USE1 = 256
  CF_USE2 = 512
  CF_USE3 = 1024
  CF_USE4 = 2048
  CF_USE5 = 4096
  CF_USE6 = 8192
  CF_JUMP = 16384
  CF_SHFT = 32768
  CF_HLL = 65536
  IDPOPT_STR = 1
  IDPOPT_NUM = 2
  IDPOPT_BIT = 3
  IDPOPT_FLT = 4
  IDPOPT_I64 = 5
  IDPOPT_OK = 0
  IDPOPT_BADKEY = 1
  IDPOPT_BADTYPE = 2
  IDPOPT_BADVALUE = 3
  ph = <ida_idp.__ph object>
  __package__ = None
Function Details

AssembleLine(ea, cs, ip, use32, nonnul_line)

 

Assemble an instruction to a string (display a warning if an error is found)

Parameters:
  • ea - linear address of instruction
  • cs - cs of instruction
  • ip - ip of instruction
  • use32 - is 32bit segment
  • line - line to assemble
Returns: PyObject *
  • None on failure
  • or a string containing the assembled instruction

assemble(ea, cs, ip, use32, line)

 

Assemble an instruction into the database (display a warning if an error is found)

Parameters:
  • ea - linear address of instruction
  • cs - cs of instruction
  • ip - ip of instruction
  • use32 - is 32bit segment?
  • line - line to assemble
Returns: bool
Boolean. True on success.

ph_get_operand_info(ea, n)

 

Returns the operand information given an ea and operand number.

Parameters:
  • ea - address
  • n - operand number
Returns: PyObject *
Returns an idd_opinfo_t as a tuple: (modified, ea, reg_ival, regidx, value_size). Please refer to idd_opinfo_t structure in the SDK.