Function report |
Source Code:arch\x86\lib\insn.c |
Create Date:2022-07-28 07:25:02 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:sn_get_prefixes - scan x86 instruction prefix bytes*@insn: &struct insn containing instruction* Populates the @insn->prefixes bitmap, and updates @insn->next_byte* to point to the (first) opcode. No effect if @insn->prefixes.got* is already set.
Proto:void insn_get_prefixes(struct insn *insn)
Type:void
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct insn * | insn |
| 108 | If !0 if we've run insn_get_xxx() for this field Then Return |
| 113 | nb = 0 |
| 114 | lb = 0 |
| 115 | b = peek_next(insn_byte_t, insn) |
| 116 | attr = Attribute search APIs |
| 117 | When Attribute checking functions cycle |
| 121 | Go to found |
| 122 | If nb == 4 Then Break |
| 126 | If inat_is_address_size_prefix(attr) Then |
| 128 | If x86_64 Then addr_bytes ^= 12 |
| 130 | Else addr_bytes ^= 6 |
| 132 | Else if inat_is_operand_size_prefix(attr) Then |
| 134 | opnd_bytes ^= 6 |
| 136 | found : |
| 137 | nbytes++ |
| 138 | next_byte++ |
| 140 | b = peek_next(insn_byte_t, insn) |
| 141 | attr = Attribute search APIs |
| 145 | If Value for the false possibility is greater at compile time(bytes[3]) Then |
| 156 | If x86_64 Then |
| 157 | b = peek_next(insn_byte_t, insn) |
| 158 | attr = Attribute search APIs |
| 159 | If inat_is_rex_prefix(attr) Then |
| 171 | b = peek_next(insn_byte_t, insn) |
| 172 | attr = Attribute search APIs |
| 173 | If inat_is_vex_prefix(attr) Then |
| 174 | b2 = peek_nbyte_next(insn_byte_t, insn, 1) |
| 175 | If Not x86_64 Then |
| 181 | If X86_MODRM_MOD(b2) != 3 Then Go to vex_end |
| 186 | If inat_is_evex_prefix(attr) Then |
| 187 | b2 = peek_nbyte_next(insn_byte_t, insn, 2) |
| 189 | b2 = peek_nbyte_next(insn_byte_t, insn, 3) |
| 191 | nbytes = 4 |
| 192 | next_byte += 4 |
| 193 | If x86_64 && VEX3 Byte2 (b2) Then opnd_bytes = 8 |
| 196 | Else if inat_is_vex3_prefix(attr) Then |
| 197 | b2 = peek_nbyte_next(insn_byte_t, insn, 2) |
| 199 | nbytes = 3 |
| 200 | next_byte += 3 |
| 201 | If x86_64 && VEX3 Byte2 (b2) Then opnd_bytes = 8 |
| 204 | Else |
| 215 | vex_end : |
| 220 | err_out : |
| 221 | Return |
| Name | Describe |
|---|---|
| insn_get_opcode | sn_get_opcode - collect opcode(s)*@insn: &struct insn containing instruction* Populates @insn->opcode, updates @insn->next_byte to point past the* opcode byte(s), and set @insn->attr (except for groups). |
| get_seg_reg_override_idx | get_seg_reg_override_idx() - obtain segment register override index*@insn: Valid instruction with segment override prefixes* Inspect the instruction prefixes in @insn and find segment overrides, if any |
| insn_is_avx | |
| insn_is_evex |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |