|
| 1 | +namespace BinaryNinja |
| 2 | +{ |
| 3 | + public sealed partial class MediumLevelILFunction |
| 4 | + { |
| 5 | + public MediumLevelILExpressionIndex EmitCallOutputSSA( |
| 6 | + MediumLevelILSSAVariable[] outputs, |
| 7 | + ulong destinationMemoryVersion, |
| 8 | + SourceLocation? location = null) |
| 9 | + { |
| 10 | + return this.AddExpression( |
| 11 | + MediumLevelILOperation.MLIL_CALL_OUTPUT_SSA, |
| 12 | + location, |
| 13 | + 0, |
| 14 | + destinationMemoryVersion, |
| 15 | + (ulong)outputs.Length * 2, |
| 16 | + (ulong)this.AddSSAVariableList(outputs)); |
| 17 | + } |
| 18 | + |
| 19 | + public MediumLevelILExpressionIndex EmitCallParamSSA( |
| 20 | + MediumLevelILExpressionIndex[] parameters, |
| 21 | + ulong sourceMemoryVersion, |
| 22 | + SourceLocation? location = null) |
| 23 | + { |
| 24 | + return this.AddExpression( |
| 25 | + MediumLevelILOperation.MLIL_CALL_PARAM_SSA, |
| 26 | + location, |
| 27 | + 0, |
| 28 | + sourceMemoryVersion, |
| 29 | + (ulong)parameters.Length, |
| 30 | + (ulong)this.AddOperandList(parameters)); |
| 31 | + } |
| 32 | + |
| 33 | + public MediumLevelILExpressionIndex EmitCallSSA( |
| 34 | + MediumLevelILSSAVariable[] outputs, |
| 35 | + MediumLevelILExpressionIndex destination, |
| 36 | + MediumLevelILExpressionIndex[] parameters, |
| 37 | + ulong newMemoryVersion, |
| 38 | + ulong previousMemoryVersion, |
| 39 | + SourceLocation? location = null) |
| 40 | + { |
| 41 | + return this.AddExpression( |
| 42 | + MediumLevelILOperation.MLIL_CALL_SSA, |
| 43 | + location, |
| 44 | + 0, |
| 45 | + (ulong)this.EmitCallOutputSSA(outputs, newMemoryVersion, location), |
| 46 | + (ulong)destination, |
| 47 | + (ulong)parameters.Length, |
| 48 | + (ulong)this.AddOperandList(parameters), |
| 49 | + previousMemoryVersion); |
| 50 | + } |
| 51 | + |
| 52 | + public MediumLevelILExpressionIndex EmitCallUntypedSSA( |
| 53 | + MediumLevelILSSAVariable[] outputs, |
| 54 | + MediumLevelILExpressionIndex destination, |
| 55 | + MediumLevelILExpressionIndex[] parameters, |
| 56 | + ulong newMemoryVersion, |
| 57 | + ulong previousMemoryVersion, |
| 58 | + MediumLevelILExpressionIndex stack, |
| 59 | + SourceLocation? location = null) |
| 60 | + { |
| 61 | + return this.AddExpression( |
| 62 | + MediumLevelILOperation.MLIL_CALL_UNTYPED_SSA, |
| 63 | + location, |
| 64 | + 0, |
| 65 | + (ulong)this.EmitCallOutputSSA(outputs, newMemoryVersion, location), |
| 66 | + (ulong)destination, |
| 67 | + (ulong)this.EmitCallParamSSA(parameters, previousMemoryVersion, location), |
| 68 | + (ulong)stack); |
| 69 | + } |
| 70 | + |
| 71 | + public MediumLevelILExpressionIndex EmitSysCallSSA( |
| 72 | + MediumLevelILSSAVariable[] outputs, |
| 73 | + MediumLevelILExpressionIndex[] parameters, |
| 74 | + ulong newMemoryVersion, |
| 75 | + ulong previousMemoryVersion, |
| 76 | + SourceLocation? location = null) |
| 77 | + { |
| 78 | + return this.AddExpression( |
| 79 | + MediumLevelILOperation.MLIL_SYSCALL_SSA, |
| 80 | + location, |
| 81 | + 0, |
| 82 | + (ulong)this.EmitCallOutputSSA(outputs, newMemoryVersion, location), |
| 83 | + (ulong)parameters.Length, |
| 84 | + (ulong)this.AddOperandList(parameters), |
| 85 | + previousMemoryVersion); |
| 86 | + } |
| 87 | + |
| 88 | + public MediumLevelILExpressionIndex EmitSysCallUntypedSSA( |
| 89 | + MediumLevelILSSAVariable[] outputs, |
| 90 | + MediumLevelILExpressionIndex[] parameters, |
| 91 | + ulong newMemoryVersion, |
| 92 | + ulong previousMemoryVersion, |
| 93 | + MediumLevelILExpressionIndex stack, |
| 94 | + SourceLocation? location = null) |
| 95 | + { |
| 96 | + return this.AddExpression( |
| 97 | + MediumLevelILOperation.MLIL_SYSCALL_UNTYPED_SSA, |
| 98 | + location, |
| 99 | + 0, |
| 100 | + (ulong)this.EmitCallOutputSSA(outputs, newMemoryVersion, location), |
| 101 | + (ulong)this.EmitCallParamSSA(parameters, previousMemoryVersion, location), |
| 102 | + (ulong)stack); |
| 103 | + } |
| 104 | + |
| 105 | + public MediumLevelILExpressionIndex EmitTailCallSSA( |
| 106 | + MediumLevelILSSAVariable[] outputs, |
| 107 | + MediumLevelILExpressionIndex destination, |
| 108 | + MediumLevelILExpressionIndex[] parameters, |
| 109 | + ulong newMemoryVersion, |
| 110 | + ulong previousMemoryVersion, |
| 111 | + SourceLocation? location = null) |
| 112 | + { |
| 113 | + return this.AddExpression( |
| 114 | + MediumLevelILOperation.MLIL_TAILCALL_SSA, |
| 115 | + location, |
| 116 | + 0, |
| 117 | + (ulong)this.EmitCallOutputSSA(outputs, newMemoryVersion, location), |
| 118 | + (ulong)destination, |
| 119 | + (ulong)parameters.Length, |
| 120 | + (ulong)this.AddOperandList(parameters), |
| 121 | + previousMemoryVersion); |
| 122 | + } |
| 123 | + |
| 124 | + public MediumLevelILExpressionIndex EmitTailCallUntypedSSA( |
| 125 | + MediumLevelILSSAVariable[] outputs, |
| 126 | + MediumLevelILExpressionIndex destination, |
| 127 | + MediumLevelILExpressionIndex[] parameters, |
| 128 | + ulong newMemoryVersion, |
| 129 | + ulong previousMemoryVersion, |
| 130 | + MediumLevelILExpressionIndex stack, |
| 131 | + SourceLocation? location = null) |
| 132 | + { |
| 133 | + return this.AddExpression( |
| 134 | + MediumLevelILOperation.MLIL_TAILCALL_UNTYPED_SSA, |
| 135 | + location, |
| 136 | + 0, |
| 137 | + (ulong)this.EmitCallOutputSSA(outputs, newMemoryVersion, location), |
| 138 | + (ulong)destination, |
| 139 | + (ulong)this.EmitCallParamSSA(parameters, previousMemoryVersion, location), |
| 140 | + (ulong)stack); |
| 141 | + } |
| 142 | + |
| 143 | + public MediumLevelILExpressionIndex EmitIntrinsicSSA( |
| 144 | + MediumLevelILSSAVariable[] outputs, |
| 145 | + IntrinsicIndex intrinsic, |
| 146 | + MediumLevelILExpressionIndex[] parameters, |
| 147 | + SourceLocation? location = null) |
| 148 | + { |
| 149 | + return this.AddExpression( |
| 150 | + MediumLevelILOperation.MLIL_INTRINSIC_SSA, |
| 151 | + location, |
| 152 | + 0, |
| 153 | + (ulong)outputs.Length * 2, |
| 154 | + (ulong)this.AddSSAVariableList(outputs), |
| 155 | + (ulong)intrinsic, |
| 156 | + (ulong)parameters.Length, |
| 157 | + (ulong)this.AddOperandList(parameters)); |
| 158 | + } |
| 159 | + |
| 160 | + public MediumLevelILExpressionIndex EmitMemoryIntrinsicOutputSSA( |
| 161 | + MediumLevelILSSAVariable[] outputs, |
| 162 | + ulong destinationMemoryVersion, |
| 163 | + SourceLocation? location = null) |
| 164 | + { |
| 165 | + return this.AddExpression( |
| 166 | + MediumLevelILOperation.MLIL_MEMORY_INTRINSIC_OUTPUT_SSA, |
| 167 | + location, |
| 168 | + 0, |
| 169 | + destinationMemoryVersion, |
| 170 | + (ulong)outputs.Length * 2, |
| 171 | + (ulong)this.AddSSAVariableList(outputs)); |
| 172 | + } |
| 173 | + |
| 174 | + public MediumLevelILExpressionIndex EmitMemoryIntrinsicSSA( |
| 175 | + MediumLevelILSSAVariable[] outputs, |
| 176 | + IntrinsicIndex intrinsic, |
| 177 | + MediumLevelILExpressionIndex[] parameters, |
| 178 | + ulong newMemoryVersion, |
| 179 | + ulong previousMemoryVersion, |
| 180 | + SourceLocation? location = null) |
| 181 | + { |
| 182 | + return this.AddExpression( |
| 183 | + MediumLevelILOperation.MLIL_MEMORY_INTRINSIC_SSA, |
| 184 | + location, |
| 185 | + 0, |
| 186 | + (ulong)this.EmitMemoryIntrinsicOutputSSA(outputs, newMemoryVersion, location), |
| 187 | + (ulong)intrinsic, |
| 188 | + (ulong)parameters.Length, |
| 189 | + (ulong)this.AddOperandList(parameters), |
| 190 | + previousMemoryVersion); |
| 191 | + } |
| 192 | + } |
| 193 | +} |
0 commit comments