MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / intrinsic

Method intrinsic

python/lowlevelil.py:5371–5406  ·  view source on GitHub ↗

``intrinsic`` return an intrinsic expression. :param ILSourceLocation loc: location of returned expression :return: an intrinsic expression. :rtype: ExpressionIndex

(
	    self, outputs: List[Union[ILRegisterType, ILFlag, 'architecture.RegisterInfo']], intrinsic: 'architecture.IntrinsicType',
	    params: List[ExpressionIndex], flags: Optional['architecture.FlagType'] = None, loc: Optional['ILSourceLocation'] = None
	)

Source from the content-addressed store, hash-verified

5369 return self.expr(LowLevelILOperation.LLIL_SYSCALL, source_location=loc)
5370
5371 def intrinsic(
5372 self, outputs: List[Union[ILRegisterType, ILFlag, 'architecture.RegisterInfo']], intrinsic: 'architecture.IntrinsicType',
5373 params: List[ExpressionIndex], flags: Optional['architecture.FlagType'] = None, loc: Optional['ILSourceLocation'] = None
5374 ):
5375 """
5376 ``intrinsic`` return an intrinsic expression.
5377
5378 :param ILSourceLocation loc: location of returned expression
5379 :return: an intrinsic expression.
5380 :rtype: ExpressionIndex
5381 """
5382 output_list = []
5383 for output in outputs:
5384 if isinstance(output, str):
5385 if architecture.RegisterName(output) in self.arch.regs:
5386 output_list.append(self.arch.regs[architecture.RegisterName(output)].index)
5387 elif architecture.FlagName(output) in self.arch.flags:
5388 output_list.append((1 << 32) | self.arch.get_flag_by_name(architecture.FlagName(output)))
5389 else:
5390 raise Exception("Invalid register or flag name")
5391 elif isinstance(output, architecture.RegisterInfo):
5392 output_list.append(output.index)
5393 elif isinstance(output, ILRegister):
5394 output_list.append(output.index)
5395 elif isinstance(output, ILFlag):
5396 output_list.append((1 << 32) | output.index)
5397 else:
5398 output_list.append(output)
5399 param_list = []
5400 for param in params:
5401 param_list.append(param)
5402 call_param = self.expr(LowLevelILOperation.LLIL_CALL_PARAM, len(params), self.add_operand_list(param_list))
5403 return self.expr(
5404 LowLevelILOperation.LLIL_INTRINSIC, len(outputs), self.add_operand_list(output_list),
5405 self.arch.get_intrinsic_index(intrinsic), call_param, flags=flags, source_location=loc
5406 )
5407
5408 def breakpoint(self, loc: Optional['ILSourceLocation'] = None) -> ExpressionIndex:
5409 """

Callers 1

copy_expr_toMethod · 0.45

Calls 5

exprMethod · 0.95
add_operand_listMethod · 0.95
get_flag_by_nameMethod · 0.80
get_intrinsic_indexMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected