Changeset 139 for trunk/include


Ignore:
Timestamp:
02/08/09 22:06:16 (16 years ago)
Author:
tim
Message:

rewrote subkey list parsing code to include more organized recursion and parsing as well as improved sanity checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/regfi.h

    r138 r139  
    8282#define REGFI_OFFSET_NONE          0xffffffff
    8383
     84/* XXX: This is totally arbitrary right now. */
     85#define REGFI_MAX_SUBKEY_DEPTH     255   
     86
    8487/* Header sizes and magic number lengths for various records */
    8588#define REGFI_REGF_MAGIC_SIZE      4
     
    171174typedef struct
    172175{
    173   uint32 nk_off;
     176  /* Virtual offset of NK record or additional subkey list,
     177   * depending on this list's type.
     178   */
     179  uint32 offset;
     180
    174181  uint32 hash;
    175182} REGFI_SUBKEY_LIST_ELEM;
     
    178185typedef struct
    179186{
    180   uint32 offset;        /* Real offset of this record's cell in the file */
    181   uint32 cell_size;      /* ((start_offset - end_offset) & 0xfffffff8) */
    182   uint32 num_keys;
     187  /* Real offset of this record's cell in the file */
     188  uint32 offset;
     189
     190  uint32 cell_size;
     191 
     192  /* Number of immediate children */
     193  uint32 num_children; 
     194
     195  /* Total number of keys referenced by this list and it's children */
     196  uint32 num_keys;     
     197
    183198  REGFI_SUBKEY_LIST_ELEM* elements;
    184  
    185199  uint8 magic[REGFI_CELL_MAGIC_SIZE];
     200
     201  /* Set if the magic indicates this subkey list points to child subkey lists */
     202  bool recursive_type; 
    186203} REGFI_SUBKEY_LIST;
    187204
     
    427444                                     uint32 max_size, bool strict);
    428445
     446REGFI_SUBKEY_LIST*    regfi_parse_subkeylist(REGFI_FILE* file, uint32 offset,
     447                                             uint32 max_size, bool strict);
     448
    429449REGFI_VK_REC*         regfi_parse_vk(REGFI_FILE* file, uint32 offset,
    430450                                     uint32 max_size, bool strict);
     
    467487                                              REGFI_SUBKEY_LIST** lists,
    468488                                              bool strict);
     489REGFI_SUBKEY_LIST*    regfi_load_subkeylist_aux(REGFI_FILE* file, uint32 offset,
     490                                                uint32 max_size, bool strict,
     491                                                uint8 depth_left);
    469492void                  regfi_add_message(REGFI_FILE* file, uint16 msg_type,
    470493                                        const char* fmt, ...);
Note: See TracChangeset for help on using the changeset viewer.