elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


  Mostrar Mensajes
Páginas: 1 [2]
11  Programación / ASM / Re: Help, porfa: [Linker error] undefined reference to '....... en: 2 Octubre 2009, 23:48 pm
Oks.  Gracias Idol por la respuesta.  :) Pues he probado a definir el array justo a continuacion de su definicion, he compilado y sigue dando error de linker.

Aprovecho para añadir algo de info, por si puede ser de ayuda....

unsigned char    tablasci2[ TABLE_NUM ][ TABLE_SIZE ] = { {0,0} , {0,0} };

//===================================
#ifndef INLINE_ASM
...........
...........
...........

El programa comienza con una llamada a " encript_buffer(..... ) " así:
     
    // Get a new expand key with 256 bits
        strcpy( newkey, key );
        encript_buffer( newkey, 16, "K#ç=+xnNX~Nx6544", 16, 0 );

  for ( j=0; j<TABLE_NUM; j++ ){
       for ( i=0; i<TABLE_SIZE; i++ ) ascii=i;
       for ( i=0; i<TABLE_SIZE; i++ ){
             tablasci2[j][ ascii ] = i;
......
.....
.....

Por cierto, tengo entendido que esta sintaxis del asm es para linux, mientras yo uso
el windows.
Talvez en el Dev-C++ hay que activar alguna opcion para que compile el asm??
 Lo que pasa es que debería dar error en todo y no solo en la ref de link tabla.

Buwaaa....   :-( a ver como salgo de esta?   :)

12  Programación / ASM / Help, porfa: [Linker error] undefined reference to '....... en: 2 Octubre 2009, 21:33 pm
Hola a todos,

A ver si me podeis hechar una mano, porfa.  :)

Estoy haciendo un code en c++ (lenguaje que conozco) y necesito usar puntalmente esta rutina en asm (lenguaje que no domino), que he encontrado y me vendría de maravilla.

La rutina es esta:

unsigned char    tablasci2[ TABLE_NUM ][ TABLE_SIZE ];

//===================================
#ifndef INLINE_ASM
unsigned char change( unsigned char byte, unsigned int num )
{ num &= 0x7;  return tablasci1[num][byte]; }
#endif
//===================================
char *encript_buffer( char *buffer, int len, char *key, int keylen, int pos )
{
        #ifdef INLINE_ASM
        // esi - buffer        edi - key       ecx - i        ebx - j        edx - k      pos
       asm (
        "movl   %3, %%edi;\n"   // edi contains keylen
        "cmp    $16, %%edi;\n" // if ( keylen > MAX_KEY_LEN )
        "jle    _skip_if1;\n"
        "mov    $16, %%edi;\n" // keylen = MAX_KEY_LEN;
        "_skip_if1:\n"
         "movb   (%%edi,%%ebx),%%al;\n" //al contain key[j]
        "addb   %%bl,%%al;\n"   // key[j]+j in eax
        "movl   %4, %%edx;\n"   // pos in edx
        "addl   %%ecx, %%edx;\n"// (i + pos) in edx
        "andl   $7, %%edx;\n" // edx &= 7
        "sall   $8, %%edx;\n" // edx *= 256
        "addl   %%edx, %%eax;\n"
        "addl   $tablasci2, %%eax;\n" // eax += tablasci2    :o

 ........ etc.. etc...

        #else 
       
       int  i,  j,  k;

        if ( keylen > MAX_KEY_LEN ) keylen = MAX_KEY_LEN;
  ...... etc... etc....
}

Pues, cuano lo compilo, me da este error:
  [Linker error] undefined reference to `tablasci2'

Me podeis hechar una mano esplicandome porqué da este error y como puedo solucionarlo, porfa? Estoy ya en las ultimas....
Uso el Dev-C++ y el micro es un Intel

Gracias  :)

Páginas: 1 [2]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines