Changeset 178 for trunk/include
- Timestamp:
- 03/13/10 12:56:36 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/regfi.h
r172 r178 93 93 94 94 #define REGFI_NUM_ENCODINGS 3 95 96 /* Windows is lame */97 #ifdef O_BINARY98 #define REGFI_OPEN_FLAGS O_RDONLY|O_BINARY99 #else100 #define REGFI_OPEN_FLAGS O_RDONLY101 #endif102 95 103 96 /* Registry data types */ … … 162 155 /* Minimum time is Jan 1, 1990 00:00:00 */ 163 156 #define REGFI_MTIME_MIN_HIGH 0x01B41E6D 164 #define REGFI_MTIME_MIN_LOW 0x26F98000 157 165 158 /* Maximum time is Jan 1, 2290 00:00:00 166 159 * (We hope no one is using Windows by then...) 167 160 */ 168 161 #define REGFI_MTIME_MAX_HIGH 0x03047543 169 #define REGFI_MTIME_MAX_LOW 0xC80A4000170 162 171 163 … … 649 641 650 642 643 typedef struct _regfi_raw_file 644 { 645 off_t (* seek)(); /* (REGFI_RAW_FILE* self, off_t offset, int whence) */ 646 ssize_t (* read)(); /* (REGFI_RAW_FILE* self, void* buf, size_t count) */ 647 648 uint64_t cur_off; 649 uint64_t size; 650 void* state; 651 } REGFI_RAW_FILE; 652 651 653 652 654 /** Registry hive file data structure … … 665 667 * @ingroup regfiBase 666 668 */ 667 typedef struct 669 typedef struct _regfi_file 668 670 { 669 671 /* Run-time information */ 670 672 /************************/ 671 /* file descriptor*/672 int fd;673 /* Functions for accessing the file */ 674 REGFI_RAW_FILE* cb; 673 675 674 676 /* For sanity checking (not part of the registry header) */ … … 798 800 /******************************************************************************/ 799 801 800 /** Attempts to open a registry hive and allocate related data structures.801 *802 * @param filename A string containing the relative or absolute path of the803 * registry hive to be opened.804 *805 * @return A reference to a newly allocated REGFI_FILE structure,806 * if successful; NULL on error.807 *808 * @ingroup regfiBase809 */810 REGFI_FILE* regfi_open(const char* filename);811 812 813 802 /** Parses file headers of an already open registry hive file and 814 803 * allocates related structures for further parsing. … … 824 813 825 814 826 /** Closes and frees an open registry hive. 827 * 828 * @param file The registry structure to close. 829 * 830 * @return 0 on success, -1 on failure with errno set. 831 * errno codes are similar to those of close(2). 815 /** Parses file headers returned by supplied callback functions. 816 * 817 * This interface is useful if you have a registry hive in memory 818 * or have some other reason to emulate a real file. 819 * 820 * @param file_cb A structure defining the callback functions needed to access the file. 821 * 822 * @return A reference to a newly allocated REGFI_FILE structure, if successful; 823 * NULL on error. 832 824 * 833 825 * @ingroup regfiBase 834 826 */ 835 int regfi_close(REGFI_FILE* file);827 REGFI_FILE* regfi_alloc_cb(REGFI_RAW_FILE* file_cb); 836 828 837 829 … … 1298 1290 /******************************************************************************/ 1299 1291 1300 REGFI_FILE* regfi_parse_regf( int fd, bool strict);1292 REGFI_FILE* regfi_parse_regf(REGFI_RAW_FILE* file_cb, bool strict); 1301 1293 REGFI_HBIN* regfi_parse_hbin(REGFI_FILE* file, uint32_t offset, 1302 1294 bool strict); … … 1367 1359 * @ingroup regfiParseLayer 1368 1360 */ 1369 bool regfi_parse_cell( int fd, uint32_t offset,1361 bool regfi_parse_cell(REGFI_RAW_FILE* file_cb, uint32_t offset, 1370 1362 uint8_t* hdr, uint32_t hdr_len, 1371 1363 uint32_t* cell_length, bool* unalloc); … … 1410 1402 REGFI_ENCODING output_encoding); 1411 1403 void regfi_subkeylist_free(REGFI_SUBKEY_LIST* list); 1412 uint32_t regfi_read(int fd, uint8_t* buf, uint32_t* length); 1404 1405 off_t regfi_raw_seek(REGFI_RAW_FILE* self, 1406 off_t offset, int whence); 1407 ssize_t regfi_raw_read(REGFI_RAW_FILE* self, 1408 void* buf, size_t count); 1409 off_t regfi_seek(REGFI_RAW_FILE* file_cb, 1410 off_t offset, int whence); 1411 uint32_t regfi_read(REGFI_RAW_FILE* file_cb, 1412 uint8_t* buf, uint32_t* length); 1413 1413 1414 1414 const char* regfi_type_val2str(unsigned int val);
Note: See TracChangeset
for help on using the changeset viewer.