Module ida_lines
[frames] | no frames]

Module ida_lines

IDA Plugin SDK API wrapper: lines

Classes
  bgcolors_t
Proxy of C++ bgcolors_t class
Functions
ssize_t
tag_strlen(line)
color_t
calc_prefix_color(ea)
bgcolor_t
calc_bg_color(ea)
bool
add_sourcefile(ea1, ea2, filename)
char const *
get_sourcefile(ea, bounds=None)
bool
del_sourcefile(ea)
bool
add_extra_line(ea, isprev, format)
bool
add_extra_cmt(ea, isprev, format)
bool
add_pgm_cmt(format)
bool
generate_disasm_line(ea, flags=0)
int
get_first_free_extra_cmtidx(ea, start)
 
update_extra_cmt(ea, what, str)
 
del_extra_cmt(ea, what)
ssize_t
get_extra_cmt(ea, what)
 
delete_extra_cmts(ea, cmtidx)
PyObject *
tag_remove(nonnul_instr)
Remove color escape sequences from a string
PyObject *
set_user_defined_prefix(width, pycb)
User-defined line-prefixes are displayed just after the autogenerated line prefixes.
PyObject *
tag_addr(ea)
int
tag_skipcode(line)
int
tag_skipcodes(line)
int
tag_advance(line, cnt)
PyObject *
generate_disassembly(ea, max_lines, as_stack, notags)
Generate disassembly lines (many lines) and put them into a buffer
 
requires_color_esc(c)
Checks if the given character requires escaping
 
COLSTR(str, tag)
Utility function to create a colored line
Variables
  COLOR_ON = '\x01'
  COLOR_OFF = '\x02'
  COLOR_ESC = '\x03'
  COLOR_INV = '\x04'
  SCOLOR_ON = '\x01'
  SCOLOR_OFF = '\x02'
  SCOLOR_ESC = '\x03'
  SCOLOR_INV = '\x04'
  SCOLOR_DEFAULT = '\x01'
  SCOLOR_REGCMT = '\x02'
  SCOLOR_RPTCMT = '\x03'
  SCOLOR_AUTOCMT = '\x04'
  SCOLOR_INSN = '\x05'
  SCOLOR_DATNAME = '\x06'
  SCOLOR_DNAME = '\x07'
  SCOLOR_DEMNAME = '\x08'
  SCOLOR_SYMBOL = '\t'
  SCOLOR_CHAR = '\n'
  SCOLOR_STRING = '\x0b'
  SCOLOR_NUMBER = '\x0c'
  SCOLOR_VOIDOP = '\r'
  SCOLOR_CREF = '\x0e'
  SCOLOR_DREF = '\x0f'
  SCOLOR_CREFTAIL = '\x10'
  SCOLOR_DREFTAIL = '\x11'
  SCOLOR_ERROR = '\x12'
  SCOLOR_PREFIX = '\x13'
  SCOLOR_BINPREF = '\x14'
  SCOLOR_EXTRA = '\x15'
  SCOLOR_ALTOP = '\x16'
  SCOLOR_HIDNAME = '\x17'
  SCOLOR_LIBNAME = '\x18'
  SCOLOR_LOCNAME = '\x19'
  SCOLOR_CODNAME = '\x1a'
  SCOLOR_ASMDIR = '\x1b'
  SCOLOR_MACRO = '\x1c'
  SCOLOR_DSTR = '\x1d'
  SCOLOR_DCHAR = '\x1e'
  SCOLOR_DNUM = '\x1f'
  SCOLOR_KEYWORD = ' '
  SCOLOR_REG = '!'
  SCOLOR_IMPNAME = '"'
  SCOLOR_SEGNAME = '#'
  SCOLOR_UNKNAME = '$'
  SCOLOR_CNAME = '%'
  SCOLOR_UNAME = '&'
  SCOLOR_COLLAPSED = '\''
  SCOLOR_ADDR = '('
  COLOR_SELECTED = 2
  COLOR_LIBFUNC = 3
  COLOR_REGFUNC = 4
  COLOR_CODE = 5
  COLOR_DATA = 6
  COLOR_UNKNOWN = 7
  COLOR_EXTERN = 8
  COLOR_CURITEM = 9
  COLOR_CURLINE = 10
  COLOR_HIDLINE = 11
  COLOR_BG_MAX = 12
  cvar = _ida_lines.cvar
  COLOR_DEFAULT = 1
  COLOR_REGCMT = 2
  COLOR_RPTCMT = 3
  COLOR_AUTOCMT = 4
  COLOR_INSN = 5
  COLOR_DATNAME = 6
  COLOR_DNAME = 7
  COLOR_DEMNAME = 8
  COLOR_SYMBOL = 9
  COLOR_CHAR = 10
  COLOR_STRING = 11
  COLOR_NUMBER = 12
  COLOR_VOIDOP = 13
  COLOR_CREF = 14
  COLOR_DREF = 15
  COLOR_CREFTAIL = 16
  COLOR_DREFTAIL = 17
  COLOR_ERROR = 18
  COLOR_PREFIX = 19
  COLOR_BINPREF = 20
  COLOR_EXTRA = 21
  COLOR_ALTOP = 22
  COLOR_HIDNAME = 23
  COLOR_LIBNAME = 24
  COLOR_LOCNAME = 25
  COLOR_CODNAME = 26
  COLOR_ASMDIR = 27
  COLOR_MACRO = 28
  COLOR_DSTR = 29
  COLOR_DCHAR = 30
  COLOR_DNUM = 31
  COLOR_KEYWORD = 32
  COLOR_REG = 33
  COLOR_IMPNAME = 34
  COLOR_SEGNAME = 35
  COLOR_UNKNAME = 36
  COLOR_CNAME = 37
  COLOR_UNAME = 38
  COLOR_COLLAPSED = 39
  COLOR_FG_MAX = 40
  COLOR_ADDR = 40
  COLOR_OPND1 = 41
  COLOR_OPND2 = 42
  COLOR_OPND3 = 43
  COLOR_OPND4 = 44
  COLOR_OPND5 = 45
  COLOR_OPND6 = 46
  COLOR_OPND7 = 47
  COLOR_OPND8 = 48
  COLOR_RESERVED1 = 51
  VEL_POST = 1
  VEL_CMT = 2
  GENDSM_FORCE_CODE = 1
  GENDSM_MULTI_LINE = 2
  GENDSM_REMOVE_TAGS = 4
  COLOR_ADDR_SIZE = 8
  SCOLOR_FG_MAX = '('
  SCOLOR_OPND1 = ')'
  SCOLOR_OPND2 = '*'
  SCOLOR_OPND3 = '+'
  SCOLOR_OPND4 = ','
  SCOLOR_OPND5 = '-'
  SCOLOR_OPND6 = '.'
  SCOLOR_UTF8 = '2'
  PALETTE_SIZE = 52
  E_PREV = 1000
  E_NEXT = 2000
  __package__ = None
Function Details

tag_remove(nonnul_instr)

 

Remove color escape sequences from a string

Parameters:
  • colstr - the colored string with embedded tags
Returns: PyObject *
a new string w/o the tags

set_user_defined_prefix(width, pycb)

 
User-defined line-prefixes are displayed just after the autogenerated
line prefixes. In order to use them, the plugin should call the
following function to specify its width and contents.
@param width: the width of the user-defined prefix
@param callback: a get_user_defined_prefix callback to get the contents of the prefix.
    Its arguments:
      ea     - linear address
      lnnum  - line number
      indent - indent of the line contents (-1 means the default instruction)
               indent and is used for instruction itself. see explanations for printf_line()
      line   - the line to be generated. the line usually contains color tags this argument
               can be examined to decide whether to generated the prefix
    It returns a buffer of size < bufsize

In order to remove the callback before unloading the plugin, specify the width = 0 or the callback = None

Returns: PyObject *

generate_disassembly(ea, max_lines, as_stack, notags)

 

Generate disassembly lines (many lines) and put them into a buffer

Parameters:
  • ea - address to generate disassembly for
  • max_lines - how many lines max to generate
  • as_stack - Display undefined items as 2/4/8 bytes
Returns: PyObject *
  • None on failure
  • tuple(most_important_line_number, tuple(lines)) : Returns a tuple containing the most important line number and a tuple of generated lines

requires_color_esc(c)

 

Checks if the given character requires escaping

Parameters:
  • c - character (string of one char)
Returns:
Boolean

COLSTR(str, tag)

 

Utility function to create a colored line

Parameters:
  • str - The string
  • tag - Color tag constant. One of SCOLOR_XXXX