|
IDA C++ SDK 9.2
|
High level functions that deal with the generation of the disassembled text lines. More...
Go to the source code of this file.
Classes | |
| struct | user_defined_prefix_t |
| Class to generate user-defined prefixes in the disassembly listing. More... | |
Functions | |
| THREAD_SAFE bool | requires_color_esc (char c) |
| Is the given char a color escape character? | |
| idaman THREAD_SAFE void ida_export | tag_addr (qstring *buf, ea_t ea, bool ins=false) |
| Insert an address mark into a string. | |
| idaman THREAD_SAFE const char *ida_export | tag_advance (const char *line, int cnt) |
| Move pointer to a 'line' to 'cnt' positions right. | |
| idaman THREAD_SAFE const char *ida_export | tag_skipcodes (const char *line) |
| Move the pointer past all color codes. | |
| idaman THREAD_SAFE const char *ida_export | tag_skipcode (const char *line) |
| Skip one color code. | |
| idaman THREAD_SAFE ssize_t ida_export | tag_strlen (const char *line) |
| Calculate length of a colored string This function computes the length in unicode codepoints of a line. | |
| idaman THREAD_SAFE ssize_t ida_export | tag_remove (qstring *buf, const char *str, int init_level=0) |
| Remove color escape sequences from a string. | |
| THREAD_SAFE ssize_t idaapi | tag_remove (qstring *buf, const qstring &str, int init_level=0) |
| THREAD_SAFE ssize_t idaapi | tag_remove (qstring *buf, int init_level=0) |
| idaman color_t ida_export | calc_prefix_color (ea_t ea) |
| Get prefix color for line at 'ea'. | |
| idaman bgcolor_t ida_export | calc_bg_color (ea_t ea) |
| Get background color for line at 'ea'. | |
Source files | |
IDA can keep information about source files used to create the program. Each source file is represented by a range of addresses. A source file may contain several address ranges. | |
| idaman bool ida_export | add_sourcefile (ea_t ea1, ea_t ea2, const char *filename) |
| Mark a range of address as belonging to a source file. | |
| idaman const char *ida_export | get_sourcefile (ea_t ea, range_t *bounds=nullptr) |
| Get name of source file occupying the given address. | |
| idaman bool ida_export | del_sourcefile (ea_t ea) |
| Delete information about the source file. | |
Generation of disassembled text | |
| idaman bool ida_export | install_user_defined_prefix (size_t prefix_len, struct user_defined_prefix_t *udp, const void *owner) |
| User-defined line-prefixes are displayed just after the autogenerated line prefixes in the disassembly listing. | |
Variables | |
| const color_t | COLOR_DEFAULT = 0x01 |
| Default. | |
| const color_t | COLOR_REGCMT = 0x02 |
| Regular comment. | |
| const color_t | COLOR_RPTCMT = 0x03 |
| Repeatable comment (comment defined somewhere else) | |
| const color_t | COLOR_AUTOCMT = 0x04 |
| Automatic comment. | |
| const color_t | COLOR_INSN = 0x05 |
| Instruction. | |
| const color_t | COLOR_DATNAME = 0x06 |
| Dummy Data Name. | |
| const color_t | COLOR_DNAME = 0x07 |
| Regular Data Name. | |
| const color_t | COLOR_DEMNAME = 0x08 |
| Demangled Name. | |
| const color_t | COLOR_SYMBOL = 0x09 |
| Punctuation. | |
| const color_t | COLOR_CHAR = 0x0A |
| Char constant in instruction. | |
| const color_t | COLOR_STRING = 0x0B |
| String constant in instruction. | |
| const color_t | COLOR_NUMBER = 0x0C |
| Numeric constant in instruction. | |
| const color_t | COLOR_VOIDOP = 0x0D |
| Void operand. | |
| const color_t | COLOR_CREF = 0x0E |
| Code reference. | |
| const color_t | COLOR_DREF = 0x0F |
| Data reference. | |
| const color_t | COLOR_CREFTAIL = 0x10 |
| Code reference to tail byte. | |
| const color_t | COLOR_DREFTAIL = 0x11 |
| Data reference to tail byte. | |
| const color_t | COLOR_ERROR = 0x12 |
| Error or problem. | |
| const color_t | COLOR_PREFIX = 0x13 |
| Line prefix. | |
| const color_t | COLOR_BINPREF = 0x14 |
| Binary line prefix bytes. | |
| const color_t | COLOR_EXTRA = 0x15 |
| Extra line. | |
| const color_t | COLOR_ALTOP = 0x16 |
| Alternative operand. | |
| const color_t | COLOR_HIDNAME = 0x17 |
| Hidden name. | |
| const color_t | COLOR_LIBNAME = 0x18 |
| Library function name. | |
| const color_t | COLOR_LOCNAME = 0x19 |
| Local variable name. | |
| const color_t | COLOR_CODNAME = 0x1A |
| Dummy code name. | |
| const color_t | COLOR_ASMDIR = 0x1B |
| Assembler directive. | |
| const color_t | COLOR_MACRO = 0x1C |
| Macro. | |
| const color_t | COLOR_DSTR = 0x1D |
| String constant in data directive. | |
| const color_t | COLOR_DCHAR = 0x1E |
| Char constant in data directive. | |
| const color_t | COLOR_DNUM = 0x1F |
| Numeric constant in data directive. | |
| const color_t | COLOR_KEYWORD = 0x20 |
| Keywords. | |
| const color_t | COLOR_REG = 0x21 |
| Register name. | |
| const color_t | COLOR_IMPNAME = 0x22 |
| Imported name. | |
| const color_t | COLOR_SEGNAME = 0x23 |
| Segment name. | |
| const color_t | COLOR_UNKNAME = 0x24 |
| Dummy unknown name. | |
| const color_t | COLOR_CNAME = 0x25 |
| Regular code name. | |
| const color_t | COLOR_UNAME = 0x26 |
| Regular unknown name. | |
| const color_t | COLOR_COLLAPSED = 0x27 |
| Collapsed line. | |
| const color_t | COLOR_FG_MAX = 0x28 |
| Max color number. | |
| const color_t | COLOR_ADDR = COLOR_FG_MAX |
| Hidden address marks. | |
| const color_t | COLOR_OPND1 = COLOR_ADDR+1 |
| Instruction operand 1. | |
| const color_t | COLOR_OPND2 = COLOR_ADDR+2 |
| Instruction operand 2. | |
| const color_t | COLOR_OPND3 = COLOR_ADDR+3 |
| Instruction operand 3. | |
| const color_t | COLOR_OPND4 = COLOR_ADDR+4 |
| Instruction operand 4. | |
| const color_t | COLOR_OPND5 = COLOR_ADDR+5 |
| Instruction operand 5. | |
| const color_t | COLOR_OPND6 = COLOR_ADDR+6 |
| Instruction operand 6. | |
| const color_t | COLOR_OPND7 = COLOR_ADDR+7 |
| Instruction operand 7. | |
| const color_t | COLOR_OPND8 = COLOR_ADDR+8 |
| Instruction operand 8. | |
| const color_t | COLOR_RESERVED1 = COLOR_ADDR+11 |
| This tag is reserved for internal IDA use. | |
| const color_t | COLOR_LUMINA = COLOR_ADDR+12 |
| Lumina-related, only for the navigation band. | |
Anterior/Posterior lines | |
| idaman int | vel_flags = (isprev ? 0 : VEL_POST) |
| idaman int const char * | format |
| idaman int const char va_list | va |
| bool | isprev |
| bool | ok = vadd_extra_line(ea, vel_flags, format, va) |
| idaman | AS_PRINTF (3, 0) bool ida_export vadd_extra_line(ea_t ea |
| See higher level functions below. | |
| AS_PRINTF (3, 4) inline bool add_extra_line(ea_t ea | |
| Add anterior/posterior non-comment line(s). | |
| bool const char | va_start (va, format) |
| va_end (va) | |
| AS_PRINTF (1, 2) inline bool add_pgm_cmt(const char *format | |
| Add anterior comment line(s) at the start of program. | |
High level functions that deal with the generation of the disassembled text lines.
This file also contains definitions for the syntax highlighting.
Finally there are functions that deal with anterior/posterior user-defined lines.
Get prefix color for line at 'ea'.
Get background color for line at 'ea'.
Mark a range of address as belonging to a source file.
An address range may belong only to one source file. A source file may be represented by several address ranges.
| ea1 | linear address of start of the address range |
| ea2 | linear address of end of the address range (excluded) |
| filename | name of source file. |
Get name of source file occupying the given address.
| ea | linear address |
| bounds | pointer to the output buffer with the address range for the current file. May be nullptr. |
Delete information about the source file.
| ea | linear address |
| idaman bool ida_export install_user_defined_prefix | ( | size_t | prefix_len, |
| struct user_defined_prefix_t * | udp, | ||
| const void * | owner ) |
User-defined line-prefixes are displayed just after the autogenerated line prefixes in the disassembly listing.
There is no need to call this function explicitly. Use the user_defined_prefix_t class.
| prefix_len | prefixed length. if 0, then uninstall UDP |
| udp | object to generate user-defined prefix |
| owner | pointer to the plugin_t that owns UDP if non-nullptr, then the object will be uninstalled and destroyed when the plugin gets unloaded |
| idaman AS_PRINTF | ( | 3 | , |
| 0 | ) |
See higher level functions below.
| AS_PRINTF | ( | 3 | , |
| 4 | ) |
Add anterior/posterior non-comment line(s).
Add anterior/posterior comment line(s).
| ea | linear address |
| isprev | do we add anterior lines? (0-no, posterior) |
| format | printf() style format string. may contain \n to denote new lines. |
| ea | linear address |
| isprev | do we add anterior lines? (0-no, posterior) |
| format | printf() style format string. may contain \n to denote new lines. The resulting string should not contain comment characters (;), the kernel will add them automatically. |
| va_end | ( | va | ) |
| AS_PRINTF | ( | 1 | , |
| 2 | ) const |
Add anterior comment line(s) at the start of program.
| format | printf() style format string. may contain \n to denote new lines. The resulting string should not contain comment characters (;), the kernel will add them automatically. |
| int vel_flags = (isprev ? 0 : VEL_POST) |
| bool const char* format |
| idaman int const char va_list va |
| bool isprev |