private static unsafe byte[] ReadOperand(byte *ptr, OperandType type) { int size = ILHelper.GetOperandSize(type); byte[] data; fixed(byte *b = data = new byte[size]) for (int i = 0; i < size; i++) { b[i] = ptr[i]; } return(data); }
public int WriteOperand(byte[] array, int index) { int before = index; short val = _op.Value; fixed(byte *a = array) { int size = ILHelper.GetOperandSize(_op.OperandType); for (int i = 0; i < size; i++) { a[index++] = _operand[i]; } } return(index - before); }