¿Esto sería correcto?
Código PHP:
public unsafe byte[] DecryptAll(byte[] eData)
{
byte[] array = new byte[(int)eData.Length];
int* ptrInt1;
int* ptrInt2;
if (eData != null && (int)eData.Length !=0)
{
fixed (byte* ptrByte1 = &eData[0])
{
ptrInt1=(int*)ptrByte1;
}
}
else
{
fixed (byte* ptrByte1 = (byte[]) null)
{
ptrInt1=(int*)null;
}
}
byte[] array2;
if ((array2 = array) != null &&(int)array2.Length != 0)
{
fixed (byte* ptrByte2 = &array2[0])
{
ptrInt2=(int*)ptrByte2;
}
}
else
{
fixed (byte* ptrByte2 = (byte[])null)
{
ptrInt2=(int*)null;
}
}
for (int i = 0; i < (int)eData.Length >> 3;i += 1)
{
int num1 = ReverseDWORD(*ptrInt1);
ptrInt1++;
int num2 = ReverseDWORD(*ptrInt1);
ptrInt1++;
this.Desencriptar(ref num1, ref num2);
num1 = (*ptrInt2 = ReverseDWORD(num1));
ptrInt2++;
num2 = (*ptrInt2 = ReverseDWORD(num2));
ptrInt2++;
}
return array;
}
La idea es ir cogiendo del array eData 2 enteros y encriptarlos, voy incrementando los punteros para ir accediendo al siguiente lugar de la memoria donde estará el siguiente entero.