hx_UserDefinedCall
Description
Decompile as call. This commands configures a function call the current instruction should be replaced by in the pseudocode output.
Special names can be used to access operands of the current instructions: __OP1, __OP2, ... for first, second, etc. operands. Each function argument having a name like that will be replaced in the call by the value of the corresponding operand of the instruction. Also if the function name has this format, a call to the location pointed by the corresponding operand will be generated. Other arguments and the return value will be placed into locations derived from the function prototype according to the current compiler, calling convention, argument and return types. You can use IDA-specific __usercall calling convention to specify arbitrary locations independently of platform and argument/return types (read IDA help pages about the user defined calling conventions for more info).
Examples
We could ask to replace the following instruction:
out 2b, axby specifying the following prototype:void OUT(unsigned int8 __OP1, int16 __OP2)which would lead to the following decompiler output:OUT(0x2b, v1);where v1 is mapped to ax.The following prototype:
int __usercall syscall@<R0;>(int code@<R12;>, void *a1@<R0;>, void *a2@<R1;>)applied to the second instruction in the following piece of code:mov r12, #0x148svc 0x801will generate the following pseudocode:v3 = syscall(328, v1, v2);where v1, v2, v3 are mapped to R0, R1, R2 respectively.
Last updated
Was this helpful?
