Lines Matching refs:context

44     ZydisFormatterBuffer* buffer, ZydisFormatterContext* context)  in ZydisFormatterATTFormatInstruction()  argument
48 ZYAN_ASSERT(context); in ZydisFormatterATTFormatInstruction()
49 ZYAN_ASSERT(context->instruction); in ZydisFormatterATTFormatInstruction()
50 ZYAN_ASSERT(context->operands); in ZydisFormatterATTFormatInstruction()
52 ZYAN_CHECK(formatter->func_print_prefixes(formatter, buffer, context)); in ZydisFormatterATTFormatInstruction()
53 ZYAN_CHECK(formatter->func_print_mnemonic(formatter, buffer, context)); in ZydisFormatterATTFormatInstruction()
58 const ZyanI8 c = (ZyanI8)context->instruction->operand_count_visible - 1; in ZydisFormatterATTFormatInstruction()
61 const ZydisDecodedOperand* const operand = &context->operands[i]; in ZydisFormatterATTFormatInstruction()
82 context->operand = operand; in ZydisFormatterATTFormatInstruction()
87 status = formatter->func_pre_operand(formatter, buffer, context); in ZydisFormatterATTFormatInstruction()
102 status = formatter->func_format_operand_reg(formatter, buffer, context); in ZydisFormatterATTFormatInstruction()
105 status = formatter->func_format_operand_mem(formatter, buffer, context); in ZydisFormatterATTFormatInstruction()
108 status = formatter->func_format_operand_ptr(formatter, buffer, context); in ZydisFormatterATTFormatInstruction()
111 status = formatter->func_format_operand_imm(formatter, buffer, context); in ZydisFormatterATTFormatInstruction()
128 status = formatter->func_post_operand(formatter, buffer, context); in ZydisFormatterATTFormatInstruction()
141 if ((context->instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) || in ZydisFormatterATTFormatInstruction()
142 (context->instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX)) in ZydisFormatterATTFormatInstruction()
145 (context->instruction->operand_count_visible > 1) && in ZydisFormatterATTFormatInstruction()
146 (context->operands[1].encoding == ZYDIS_OPERAND_ENCODING_MASK)) in ZydisFormatterATTFormatInstruction()
148 ZYAN_CHECK(formatter->func_print_decorator(formatter, buffer, context, in ZydisFormatterATTFormatInstruction()
153 ZYAN_CHECK(formatter->func_print_decorator(formatter, buffer, context, in ZydisFormatterATTFormatInstruction()
155 if (context->instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) in ZydisFormatterATTFormatInstruction()
157 ZYAN_CHECK(formatter->func_print_decorator(formatter, buffer, context, in ZydisFormatterATTFormatInstruction()
159 ZYAN_CHECK(formatter->func_print_decorator(formatter, buffer, context, in ZydisFormatterATTFormatInstruction()
165 if (i == (context->instruction->operand_count_visible - 1)) in ZydisFormatterATTFormatInstruction()
172 (context->instruction->operand_count_visible > (i + 1)) && in ZydisFormatterATTFormatInstruction()
173 ((context->operands[i + 1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE) || in ZydisFormatterATTFormatInstruction()
174 (context->operands[i + 1].visibility == ZYDIS_OPERAND_VISIBILITY_HIDDEN)); in ZydisFormatterATTFormatInstruction()
178 if (context->instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) in ZydisFormatterATTFormatInstruction()
180 ZYAN_CHECK(formatter->func_print_decorator(formatter, buffer, context, in ZydisFormatterATTFormatInstruction()
183 ZYAN_CHECK(formatter->func_print_decorator(formatter, buffer, context, in ZydisFormatterATTFormatInstruction()
185 ZYAN_CHECK(formatter->func_print_decorator(formatter, buffer, context, in ZydisFormatterATTFormatInstruction()
201 ZydisFormatterBuffer* buffer, ZydisFormatterContext* context) in ZydisFormatterATTFormatOperandMEM() argument
205 ZYAN_ASSERT(context); in ZydisFormatterATTFormatOperandMEM()
207 ZYAN_CHECK(formatter->func_print_segment(formatter, buffer, context)); in ZydisFormatterATTFormatOperandMEM()
210 (context->runtime_address != ZYDIS_RUNTIME_ADDRESS_NONE); in ZydisFormatterATTFormatOperandMEM()
211 if (absolute && context->operand->mem.disp.has_displacement && in ZydisFormatterATTFormatOperandMEM()
212 (context->operand->mem.index == ZYDIS_REGISTER_NONE) && in ZydisFormatterATTFormatOperandMEM()
213 ((context->operand->mem.base == ZYDIS_REGISTER_NONE) || in ZydisFormatterATTFormatOperandMEM()
214 (context->operand->mem.base == ZYDIS_REGISTER_EIP ) || in ZydisFormatterATTFormatOperandMEM()
215 (context->operand->mem.base == ZYDIS_REGISTER_RIP ))) in ZydisFormatterATTFormatOperandMEM()
218 ZYAN_CHECK(formatter->func_print_address_abs(formatter, buffer, context)); in ZydisFormatterATTFormatOperandMEM()
221 const ZyanBool should_print_reg = context->operand->mem.base != ZYDIS_REGISTER_NONE; in ZydisFormatterATTFormatOperandMEM()
222 const ZyanBool should_print_idx = context->operand->mem.index != ZYDIS_REGISTER_NONE; in ZydisFormatterATTFormatOperandMEM()
228 ZYAN_CHECK(formatter->func_print_address_abs(formatter, buffer, context)); in ZydisFormatterATTFormatOperandMEM()
229 } else if (context->operand->mem.disp.has_displacement && context->operand->mem.disp.value) in ZydisFormatterATTFormatOperandMEM()
231 ZYAN_CHECK(formatter->func_print_disp(formatter, buffer, context)); in ZydisFormatterATTFormatOperandMEM()
243 ZYAN_CHECK(formatter->func_print_register(formatter, buffer, context, in ZydisFormatterATTFormatOperandMEM()
244 context->operand->mem.base)); in ZydisFormatterATTFormatOperandMEM()
249 ZYAN_CHECK(formatter->func_print_register(formatter, buffer, context, in ZydisFormatterATTFormatOperandMEM()
250 context->operand->mem.index)); in ZydisFormatterATTFormatOperandMEM()
251 if (context->operand->mem.scale && in ZydisFormatterATTFormatOperandMEM()
252 (context->operand->mem.type != ZYDIS_MEMOP_TYPE_MIB) && in ZydisFormatterATTFormatOperandMEM()
253 ((context->operand->mem.scale > 1) || formatter->force_memory_scale)) in ZydisFormatterATTFormatOperandMEM()
258 ZYAN_CHECK(ZydisStringAppendDecU(&buffer->string, context->operand->mem.scale, 0, in ZydisFormatterATTFormatOperandMEM()
275 ZydisFormatterBuffer* buffer, ZydisFormatterContext* context) in ZydisFormatterATTPrintMnemonic() argument
279 ZYAN_ASSERT(context); in ZydisFormatterATTPrintMnemonic()
280 ZYAN_ASSERT(context->instruction); in ZydisFormatterATTPrintMnemonic()
281 ZYAN_ASSERT(context->operands); in ZydisFormatterATTPrintMnemonic()
284 context->instruction->mnemonic); in ZydisFormatterATTPrintMnemonic()
292 if (context->instruction->meta.branch_type == ZYDIS_BRANCH_TYPE_FAR) in ZydisFormatterATTPrintMnemonic()
301 for (ZyanU8 i = 0; i < context->instruction->operand_count_visible; ++i) in ZydisFormatterATTPrintMnemonic()
303 const ZydisDecodedOperand* const operand = &context->operands[i]; in ZydisFormatterATTPrintMnemonic()
308 size = ZydisFormatterHelperGetExplicitSize(formatter, context, operand); in ZydisFormatterATTPrintMnemonic()
328 switch (context->instruction->meta.branch_type) in ZydisFormatterATTPrintMnemonic()
347 ZydisFormatterBuffer* buffer, ZydisFormatterContext* context, ZydisRegister reg) in ZydisFormatterATTPrintRegister() argument
349 ZYAN_UNUSED(context); in ZydisFormatterATTPrintRegister()
353 ZYAN_ASSERT(context); in ZydisFormatterATTPrintRegister()
366 ZydisFormatterBuffer* buffer, ZydisFormatterContext* context) in ZydisFormatterATTPrintAddressABS() argument
370 ZYAN_ASSERT(context); in ZydisFormatterATTPrintAddressABS()
372 if ((context->instruction->meta.branch_type != ZYDIS_BRANCH_TYPE_NONE) && in ZydisFormatterATTPrintAddressABS()
373 (context->operand->type == ZYDIS_OPERAND_TYPE_MEMORY)) in ZydisFormatterATTPrintAddressABS()
378 return ZydisFormatterBasePrintAddressABS(formatter, buffer, context); in ZydisFormatterATTPrintAddressABS()
382 ZydisFormatterBuffer* buffer, ZydisFormatterContext* context) in ZydisFormatterATTPrintDISP() argument
386 ZYAN_ASSERT(context); in ZydisFormatterATTPrintDISP()
394 context->operand->mem.disp.value, formatter->disp_padding, in ZydisFormatterATTPrintDISP()
399 context->operand->mem.disp.value, formatter->disp_padding, in ZydisFormatterATTPrintDISP()
410 ZydisFormatterBuffer* buffer, ZydisFormatterContext* context) in ZydisFormatterATTPrintIMM() argument
414 ZYAN_ASSERT(context); in ZydisFormatterATTPrintIMM()
417 return ZydisFormatterBasePrintIMM(formatter, buffer, context); in ZydisFormatterATTPrintIMM()