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

Function GetOperandIndexForOperandUsages

highlevelilinstruction.cpp:202–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201
202static unordered_map<BNHighLevelILOperation, unordered_map<HighLevelILOperandUsage, size_t>>
203 GetOperandIndexForOperandUsages()
204{
205 unordered_map<BNHighLevelILOperation, unordered_map<HighLevelILOperandUsage, size_t>> result;
206 result.reserve(HighLevelILInstructionBase::operationOperandUsage.size());
207 for (auto& operation : HighLevelILInstructionBase::operationOperandUsage)
208 {
209 result[operation.first] = unordered_map<HighLevelILOperandUsage, size_t>();
210 result[operation.first].reserve(operation.second.size());
211 size_t operand = 0;
212 for (auto usage : operation.second)
213 {
214 result[operation.first][usage] = operand;
215 switch (HighLevelILInstructionBase::operandTypeForUsage[usage])
216 {
217 case SSAVariableHighLevelOperand:
218 case SSAVariableListHighLevelOperand:
219 case ExprListHighLevelOperand:
220 case IndexListHighLevelOperand:
221 // SSA variables and lists take two operand slots
222 operand += 2;
223 break;
224 default:
225 operand++;
226 break;
227 }
228 }
229 }
230 return result;
231}
232
233
234unordered_map<BNHighLevelILOperation, unordered_map<HighLevelILOperandUsage, size_t>>

Callers 1

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected