Changeset 468

Show
Ignore:
Timestamp:
04/04/06 02:34:50 (3 years ago)
Author:
common
Message:

shellcode-signature
- fixes the inverse order of value mapping
- adds the first element to the mapping again
- ugly as hell, we should think about it

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/modules/shellcode-signatures/parser.y

    r466 r468  
    5959        : identifier SC_LBR statements SC_RBR SC_SEMI 
    6060        { 
    61 /*               
     61 
     62      int mapinverse[MAP_MAX]; 
     63      int i,j; 
     64 
     65                for( i = 0, j=shellcodes->map_items-1; i < shellcodes->map_items; i++,j-- ) 
     66                { 
     67//         printf(" i = %i j = %i value %i\n",i,j,shellcodes->map[i]); 
     68         mapinverse[j] = shellcodes->map[i]; 
     69      } 
     70 
     71      for( i = 0 ; i < shellcodes->map_items; i++) 
     72                { 
     73         shellcodes->map[i] = mapinverse[i]; 
     74      } 
     75 
     76 
     77/* 
    6278                printf("shellcode:\n"); 
    6379 
     
    6884                printf("\tmap                                    "); 
    6985 
    70       int i; 
     86       
    7187                for( i = 0; i < shellcodes->map_items; i++ ) 
    7288                { 
     
    180196map_values 
    181197        : map_value map_value_comma_list 
    182         ; 
     198        { 
     199                shellcodes->map[shellcodes->map_items++] = $1; 
     200        } 
     201   ; 
    183202 
    184203map_value_comma_list