Changeset 125 for trunk/lib


Ignore:
Timestamp:
08/15/08 21:21:54 (16 years ago)
Author:
tim
Message:

added early version of class name parsing. additional work still needed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/regfi.c

    r124 r125  
    15831583  ret_val->values_off = IVAL(nk_header, 0x28);
    15841584  ret_val->sk_off = IVAL(nk_header, 0x2C);
    1585   /* XXX: currently we do nothing with class names.  Need to investigate. */
    15861585  ret_val->classname_off = IVAL(nk_header, 0x30);
    15871586
     
    15941593  ret_val->name_length = SVAL(nk_header, 0x48);
    15951594  ret_val->classname_length = SVAL(nk_header, 0x4A);
     1595
    15961596
    15971597  if(ret_val->name_length + REGFI_NK_MIN_LENGTH > ret_val->cell_size)
     
    16341634  }
    16351635  ret_val->keyname[ret_val->name_length] = '\0';
     1636
     1637
     1638  /***/
     1639 
     1640  if(ret_val->classname_length > 0
     1641     && ret_val->classname_off != REGF_OFFSET_NONE
     1642     && ret_val->classname_off == (ret_val->classname_off & 0xFFFFFFF8))
     1643  {
     1644    ret_val->classname = (char*)zalloc(ret_val->classname_length+1);
     1645    if(ret_val->classname != NULL)
     1646    {
     1647      if(!regfi_parse_cell(file->fd, ret_val->classname_off+REGF_BLOCKSIZE,
     1648                           (uint8*)ret_val->classname, ret_val->classname_length,
     1649                           &cell_length, &unalloc)
     1650         || (cell_length < ret_val->classname_length)
     1651         || (strict && unalloc))
     1652      {
     1653        /* Being careful not to reject the whole key here even when
     1654         * strict and things are obviously wrong, since it appears
     1655         * they're commonly obviously wrong.
     1656         */
     1657        free(ret_val->classname);
     1658        ret_val->classname = NULL;
     1659        return ret_val;
     1660      }
     1661
     1662      ret_val->classname[ret_val->classname_length] = '\0';
     1663      /*printf("==> cell_length=%d, classname_length=%d, max_bytes_subkeyclassname=%d\n", cell_length, ret_val->classname_length, ret_val->max_bytes_subkeyclassname);*/
     1664    }
     1665  }
     1666  /***/
     1667
    16361668
    16371669  return ret_val;
Note: See TracChangeset for help on using the changeset viewer.