Ver Mensaje Individual
  #2  
Antiguo 01-01-2018
Avatar de aguml
aguml aguml is offline
Miembro
 
Registrado: may 2013
Posts: 885
Reputación: 11
aguml Va por buen camino
Esta función ¿sería válida así?
Código PHP:
public unsafe byte[] DecryptAll(byte[] eData)
{
    
byte[] array = new byte[(int)eData.Length];
    
intptrInt1;
    
intptrInt2;
    
    if (
eData != null && (int)eData.Length !=0)
    {
        
fixed (byteptrByte1 = &eData[0])
        {
            
ptrInt1=(int*)ptrByte1;
        }
    }
    else
    {
        
fixed (byteptrByte1 = (byte[]) null)
        {
            
ptrInt1=(int*)null;
        }
    }
    
byte[] array2;
 
    if ((
array2 = array) != null &&(int)array2.Length != 0)
    {
        
fixed (byteptrByte2 = &array2[0])
        {
             
ptrInt2=(int*)ptrByte2;
        }
    }
    else
    {
        
fixed (byteptrByte2 = (byte[])null)
        {
            
ptrInt2=(int*)null;
        }
    }
    for (
int i 0< (int)eData.Length >> 3;+= 1)
    {
        
int num1 ReverseDWORD(*ptrInt1);
        
ptrInt1++;
        
int num2 ReverseDWORD(*ptrInt1);
        
ptrInt1++;
        
this.Desencriptar(ref num1ref num2);
        
num1 = (*ptrInt2 ReverseDWORD(num1));
        
ptrInt2++;
        
num2 = (*ptrInt2 ReverseDWORD(num2));
        
ptrInt2++;
    }
    return array;

La idea es ir cogiendo del array byte[] eData 2 enteros y encriptarlos, voy incrementando los punteros para ir accediendo al siguiente lugar de la memoria donde estará el siguiente entero.

Última edición por aguml fecha: 01-01-2018 a las 02:39:44.
Responder Con Cita