Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > .NET
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 01-01-2018
Avatar de aguml
aguml aguml is offline
Miembro
 
Registrado: may 2013
Posts: 885
Poder: 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 01:39:44.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Columna fixed LuisAlf:: Varios 4 07-09-2011 21:31:56


La franja horaria es GMT +2. Ahora son las 16:37:48.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi