Changeset 159 for trunk/include
- Timestamp:
- 12/06/09 15:09:01 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/regfi.h
r158 r159 45 45 #include <unistd.h> 46 46 #include <assert.h> 47 #include <iconv.h> 47 48 48 49 #include "talloc.h" … … 250 251 251 252 253 typedef struct _regfi_data 254 { 255 uint32 type; 256 257 /* Length of the raw data. */ 258 uint32 size; 259 260 /* This is always present, representing the raw data cell contents. */ 261 uint8* raw; 262 263 /* Represents the length of the interpreted value. Meaning is type-specific.*/ 264 uint32 interpreted_size; 265 266 /* These items represent interpreted versions of the raw attribute above. 267 * Only use the appropriate member according to the type field. 268 * In the event of an unknown type, use only the raw field. 269 */ 270 union _regfi_data_interpreted 271 { 272 uint8* none; /* */ 273 uint8* string; 274 uint8* expand_string; 275 uint8* binary; /* */ 276 uint32 dword; 277 uint32 dword_be; 278 uint8* link; 279 uint8** multiple_string; 280 uint64 qword; 281 282 /* The following are treated as binary currently, but this may change in 283 * the future as the formats become better understood. 284 */ 285 uint8* resource_list; 286 uint8* full_resource_descriptor; 287 uint8* resource_requirements_list; 288 } interpreted; 289 } REGFI_DATA; 290 291 252 292 /* Value record */ 253 293 typedef struct … … 256 296 uint32 cell_size; /* ((start_offset - end_offset) & 0xfffffff8) */ 257 297 258 uint8* data; 298 REGFI_DATA* data; /* XXX: deprecated */ 299 259 300 char* valuename; 260 301 uint16 name_length; 261 302 uint32 hbin_off; /* offset from beginning of this hbin block */ 262 303 263 uint32 data_size; 264 uint32 data_off; /* offset of data cell (virtual) */ 304 uint32 data_size; /* As reported in the VK record. May be different than 305 * That obtained while parsing the data cell itself. */ 306 uint32 data_off; /* Offset of data cell (virtual) */ 265 307 uint32 type; 266 308 uint8 magic[REGFI_CELL_MAGIC_SIZE]; … … 423 465 void_stack* key_positions; 424 466 REGFI_NK_REC* cur_key; 467 const char* string_encoding; 425 468 uint32 cur_subkey; 426 469 uint32 cur_value; … … 446 489 447 490 491 448 492 /******************************************************************************/ 449 493 /* Main iterator API */ … … 462 506 */ 463 507 char* regfi_get_messages(REGFI_FILE* file); 508 464 509 void regfi_set_message_mask(REGFI_FILE* file, uint16 mask); 465 510 466 REGFI_ITERATOR* regfi_iterator_new(REGFI_FILE* fh); 511 512 /* regfi_iterator_new: Creates a new iterator for the provided registry file. 513 * 514 * Arguments: 515 * file -- The opened registry file the iterator should be 516 * created for. 517 * output_encoding -- An integer representing the output string encoding. 518 * These integers currently map to a specific set of 519 * iconv(3) encodings. 520 * The following values are currently accepted: 521 * 0 - default (currently US-ASCII//TRANSLIT) 522 * 1 - US-ASCII//TRANSLIT 523 * 2 - UTF-8//TRANSLIT 524 * 525 * XXX: This encoding only applies to specific data 526 * strings currently, but should apply to key 527 * names and value names in the future. 528 * 529 * Returns: 530 * A newly allocated REGFI_ITERATOR. Must be free()d with regfi_iterator_free. 531 */ 532 REGFI_ITERATOR* regfi_iterator_new(REGFI_FILE* file, 533 uint32 output_encoding); 467 534 void regfi_iterator_free(REGFI_ITERATOR* i); 468 535 bool regfi_iterator_down(REGFI_ITERATOR* i); … … 487 554 const char* value_name); 488 555 489 REGFI_DATA* regfi_iterator_cur_data(REGFI_ITERATOR* i); 556 REGFI_DATA* regfi_iterator_fetch_data(REGFI_ITERATOR* i, 557 const REGFI_VK_REC* value); 490 558 491 559 … … 512 580 range_list* used_ranges, 513 581 bool strict); 582 bool regfi_interpret_data(REGFI_FILE* file, 583 const char* string_encoding, 584 uint32 type, REGFI_DATA* data); 585 void regfi_free_data(REGFI_DATA* data); 514 586 515 587 /* These are cached so return values don't need to be freed. */ … … 599 671 REGFI_VK_REC* regfi_copy_vk(const REGFI_VK_REC* vk); 600 672 int32 regfi_calc_maxsize(REGFI_FILE* file, uint32 offset); 673 int32 regfi_conv_charset(const char* output_charset, 674 uint8* input, char* output, 675 uint32 input_len, uint32 output_max); 676 REGFI_DATA* regfi_buffer_to_data(REGFI_BUFFER raw_data); 601 677 602 678 #endif /* _REGFI_H */
Note: See TracChangeset
for help on using the changeset viewer.