diff --git a/Handle/BNMediumLevelILFunction.cs b/Handle/BNMediumLevelILFunction.cs index b8b1f85..b25ad84 100644 --- a/Handle/BNMediumLevelILFunction.cs +++ b/Handle/BNMediumLevelILFunction.cs @@ -1580,18 +1580,7 @@ public ulong[] GetExpressionOperands( ulong operand ) { - IntPtr arrayPointer = NativeMethods.BNMediumLevelILGetOperandList( - this.handle , - expression , - operand , - out ulong arrayLength - ); - - return UnsafeUtils.TakeNumberArray( - arrayPointer , - arrayLength , - NativeMethods.BNMediumLevelILFreeOperandList - ); + return this.GetOperandList(expression, operand); } public MediumLevelILVariable[] GetExpressionVariables( diff --git a/HighLevelIL/HighLevelILOperandLists.cs b/HighLevelIL/HighLevelILOperandLists.cs new file mode 100644 index 0000000..6ab65a2 --- /dev/null +++ b/HighLevelIL/HighLevelILOperandLists.cs @@ -0,0 +1,26 @@ +using System; + +namespace BinaryNinja +{ + public sealed partial class HighLevelILFunction + { + /// + /// Gets the variable-length operand list stored at an expression operand. + /// + public ulong[] GetOperandList( + HighLevelILExpressionIndex expression, + ulong listOperand) + { + IntPtr arrayPointer = NativeMethods.BNHighLevelILGetOperandList( + this.handle, + expression, + listOperand, + out ulong arrayLength); + + return UnsafeUtils.TakeNumberArray( + arrayPointer, + arrayLength, + NativeMethods.BNHighLevelILFreeOperandList); + } + } +} diff --git a/LowLevelIL/LowLevelILOperandLists.cs b/LowLevelIL/LowLevelILOperandLists.cs new file mode 100644 index 0000000..4b05448 --- /dev/null +++ b/LowLevelIL/LowLevelILOperandLists.cs @@ -0,0 +1,26 @@ +using System; + +namespace BinaryNinja +{ + public sealed partial class LowLevelILFunction + { + /// + /// Gets the variable-length operand list stored at an expression operand. + /// + public ulong[] GetOperandList( + LowLevelILExpressionIndex expression, + ulong listOperand) + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.handle, + expression, + listOperand, + out ulong arrayLength); + + return UnsafeUtils.TakeNumberArray( + arrayPointer, + arrayLength, + NativeMethods.BNLowLevelILFreeOperandList); + } + } +} diff --git a/MediumLevelIL/MediumLevelILOperandLists.cs b/MediumLevelIL/MediumLevelILOperandLists.cs new file mode 100644 index 0000000..f0a3e47 --- /dev/null +++ b/MediumLevelIL/MediumLevelILOperandLists.cs @@ -0,0 +1,26 @@ +using System; + +namespace BinaryNinja +{ + public sealed partial class MediumLevelILFunction + { + /// + /// Gets the variable-length operand list stored at an expression operand. + /// + public ulong[] GetOperandList( + MediumLevelILExpressionIndex expression, + ulong listOperand) + { + IntPtr arrayPointer = NativeMethods.BNMediumLevelILGetOperandList( + this.handle, + expression, + listOperand, + out ulong arrayLength); + + return UnsafeUtils.TakeNumberArray( + arrayPointer, + arrayLength, + NativeMethods.BNMediumLevelILFreeOperandList); + } + } +}