Changeset 99 for trunk/include
- Timestamp:
- 03/03/08 19:38:48 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/regfi.h
r97 r99 48 48 #include "smb_deps.h" 49 49 #include "void_stack.h" 50 #include "range_list.h" 50 51 51 52 /******************************************************************************/ … … 83 84 84 85 #define REGF_OFFSET_NONE 0xffffffff 86 #define REGFI_NK_MIN_LENGTH 0x50 85 87 86 88 /* Flags for the vk records */ … … 116 118 * Should be a multiple of 4096 (0x1000) 117 119 */ 118 uint32 next_block; /* relative offset to next block. Should be 119 * exactly the same as block_size. Stored just 120 * in case this is found to be different in the 121 * future. 120 uint32 next_block; /* relative offset to next block. 121 * NOTE: This value may be unreliable! 122 122 */ 123 123 … … 142 142 REGF_HASH_REC* hashes; 143 143 uint32 hbin_off; /* offset from beginning of this hbin block */ 144 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */144 uint32 cell_size; /* ((start_offset - end_offset) & 0xfffffff8) */ 145 145 146 146 uint8 header[REC_HDR_SIZE]; … … 158 158 uint8* data; 159 159 uint32 hbin_off; /* offset from beginning of this hbin block */ 160 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */160 uint32 cell_size; /* ((start_offset - end_offset) & 0xfffffff8) */ 161 161 uint32 rec_off; /* offset stored in the value list */ 162 162 … … 181 181 SEC_DESC* sec_desc; 182 182 uint32 hbin_off; /* offset from beginning of this hbin block */ 183 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */183 uint32 cell_size; /* ((start_offset - end_offset) & 0xfffffff8) */ 184 184 185 185 uint32 sk_off; /* offset parsed from NK record used as a key … … 198 198 typedef struct 199 199 { 200 uint32 hbin_off; /* offset from beginning of this hbin block*/201 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */202 REGF_HBIN *hbin; /* pointer to HBIN record (in memory) containing203 * this nk record */200 uint32 offset; /* Real offset of this record's cell in the file */ 201 uint32 cell_size; /* Actual or estimated length of the cell. 202 * Always in multiples of 8. 203 */ 204 204 205 205 /* link in the other records here */ … … 213 213 uint8 header[REC_HDR_SIZE]; 214 214 NTTIME mtime; 215 uint16 name_length; 216 uint16 classname_length; 215 217 char* classname; 216 218 char* keyname; … … 225 227 226 228 /* unknowns */ 229 uint32 unknown1; 230 uint32 unknown2; 231 uint32 unknown3; 227 232 uint32 unk_index; /* nigel says run time index ? */ 228 233 … … 246 251 void* mem_ctx; /* memory context for run-time file access information */ 247 252 REGF_HBIN* block_list; /* list of open hbin blocks */ 248 253 254 /* Experimental hbin lists */ 255 range_list* hbins; 256 range_list* unalloc_cells; 257 249 258 /* file format information */ 250 259 REGF_SK_REC* sec_desc_list; /* list of security descriptors referenced … … 298 307 /******************************************************************************/ 299 308 /* Function Declarations */ 300 309 /* Main API */ 301 310 const char* regfi_type_val2str(unsigned int val); 302 311 int regfi_type_str2val(const char* str); … … 331 340 const REGF_VK_REC* regfi_iterator_next_value(REGFI_ITERATOR* i); 332 341 342 /************************************/ 343 /* Low-layer data structure access */ 344 /************************************/ 345 REGF_FILE* regfi_parse_regf(int fd, bool strict); 346 REGF_HBIN* regfi_parse_hbin(REGF_FILE* file, uint32 offset, 347 bool strict, bool save_unalloc); 348 349 350 /* regfi_parse_nk: Parses an NK record. 351 * 352 * Arguments: 353 * f -- the registry file structure 354 * offset -- the offset of the cell (not the record) to be parsed. 355 * max_size -- the maximum size the NK cell could be. (for validation) 356 * strict -- if true, rejects any malformed records. Otherwise, 357 * tries to minimally validate integrity. 358 * Returns: 359 * A newly allocated NK record structure, or NULL on failure. 360 */ 361 REGF_NK_REC* regfi_parse_nk(REGF_FILE* file, uint32 offset, 362 uint32 max_size, bool strict); 363 333 364 334 365 /* Private Functions */ 335 366 REGF_NK_REC* regfi_rootkey(REGF_FILE* file); 336 367 void regfi_key_free(REGF_NK_REC* nk); 368 uint32 regfi_read(int fd, uint8* buf, uint32* length); 337 369 338 370 … … 341 373 /* Experimental */ 342 374 /****************/ 343 typedef struct 344 { 345 uint32 offset; 346 uint32 size; 347 } REGFI_CELL_INFO; 348 349 typedef struct 350 { 351 uint32 count; 352 REGFI_CELL_INFO** cells; 353 } REGFI_CELL_LIST; 354 355 356 REGF_FILE* regfi_parse_regf(int fd, bool strict); 357 REGFI_CELL_LIST* regfi_get_unallocated_cells(REGF_FILE* file); 358 REGF_HBIN* regfi_parse_hbin(REGF_FILE* file, uint32 offset, 359 bool strict, bool save_unalloc); 360 REGF_NK_REC* regfi_parse_nk(REGF_FILE* f, uint32); 361 uint32 regfi_read(int fd, uint8* buf, uint32* length); 375 362 376 363 377 #endif /* _REGFI_H */
Note: See TracChangeset
for help on using the changeset viewer.