Changeset 97 for trunk/include
- Timestamp:
- 02/26/08 20:04:14 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/regfi.h
r84 r97 72 72 73 73 #define REGF_BLOCKSIZE 0x1000 74 #define REGF_ALLOC_BLOCK 0x1000 74 #define REGF_ALLOC_BLOCK 0x1000 /* Minimum allocation unit for hbins */ 75 75 #define REGF_MAX_DEPTH 512 76 76 77 77 /* header sizes for various records */ 78 78 79 #define REGF_ HDR_SIZE 480 #define HBIN_ HDR_SIZE 481 #define HBIN_HEADER_REC_SIZE 0x2 479 #define REGF_MAGIC_SIZE 4 80 #define HBIN_MAGIC_SIZE 4 81 #define HBIN_HEADER_REC_SIZE 0x20 82 82 #define REC_HDR_SIZE 2 83 83 … … 103 103 /* HBIN block */ 104 104 struct regf_hbin; 105 typedef struct regf_hbin { 105 typedef struct regf_hbin 106 { 106 107 struct regf_hbin* prev; 107 108 struct regf_hbin* next; 108 109 uint32 file_off; /* my offset in the registry file */ 109 uint32 free_off; /* offset to free space within the hbin record */110 uint32 free_size; /* amount of data left in the block */111 110 uint32 ref_count; /* how many active records are pointing to this 112 111 * block (not used currently) … … 114 113 115 114 uint32 first_hbin_off; /* offset from first hbin block */ 116 uint32 block_size; /* block size of this block is117 * usually a multiple of 4096Kb115 uint32 block_size; /* block size of this block 116 * Should be a multiple of 4096 (0x1000) 118 117 */ 119 uint8 header[HBIN_HDR_SIZE]; /* "hbin" */ 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. 122 */ 123 124 uint8 magic[HBIN_MAGIC_SIZE]; /* "hbin" */ 120 125 prs_struct ps; /* data */ 121 bool dirty; /* has this hbin block been modified? */122 126 } REGF_HBIN; 123 127 124 /* ??? List -- list of key offsets and hashed names for consistency */ 125 typedef struct { 128 129 /* Hash List -- list of key offsets and hashed names for consistency */ 130 typedef struct 131 { 126 132 uint32 nk_off; 127 uint8 keycheck[ sizeof(uint32)];133 uint8 keycheck[4]; 128 134 } REGF_HASH_REC; 129 135 130 typedef struct { 136 137 typedef struct 138 { 131 139 REGF_HBIN* hbin; /* pointer to HBIN record (in memory) containing 132 140 * this nk record … … 140 148 } REGF_LF_REC; 141 149 150 142 151 /* Key Value */ 143 144 typedef struct{152 typedef struct 153 { 145 154 REGF_HBIN* hbin; /* pointer to HBIN record (in memory) containing 146 155 * this nk record … … 163 172 struct _regf_sk_rec; 164 173 165 typedef struct _regf_sk_rec { 174 typedef struct _regf_sk_rec 175 { 166 176 struct _regf_sk_rec* next; 167 177 struct _regf_sk_rec* prev; … … 186 196 187 197 /* Key Name */ 188 typedef struct { 198 typedef struct 199 { 189 200 uint32 hbin_off; /* offset from beginning of this hbin block */ 190 201 uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ … … 221 232 uint32 num_values; 222 233 uint32 values_off; /* value lists which point to VK records */ 223 uint32 sk_off; /* offset to SK record */ 224 234 uint32 sk_off; /* offset to SK record */ 225 235 } REGF_NK_REC; 226 236 227 237 238 228 239 /* REGF block */ 229 typedef struct { 240 typedef struct 241 { 230 242 /* run time information */ 231 243 int fd; /* file descriptor */ 232 int open_flags; /* flags passed to the open() call */ 244 /* For sanity checking (not part of the registry header) */ 245 uint32 file_length; 233 246 void* mem_ctx; /* memory context for run-time file access information */ 234 247 REGF_HBIN* block_list; /* list of open hbin blocks */ … … 239 252 */ 240 253 241 uint8 header[REGF_HDR_SIZE];/* "regf" */254 uint8 magic[REGF_MAGIC_SIZE];/* "regf" */ 242 255 NTTIME mtime; 243 256 uint32 data_offset; /* offset to record in the first (or any?) … … 245 258 */ 246 259 uint32 last_block; /* offset to last hbin block in file */ 247 uint32 checksum; /* XOR of bytes 0x0000 - 0x01FB */ 248 249 /* unknowns */ 260 261 uint32 checksum; /* Stored checksum. */ 262 uint32 computed_checksum; /* Our own calculation of the checksum. 263 * (XOR of bytes 0x0000 - 0x01FB) 264 */ 265 266 /* unknown data structure values */ 250 267 uint32 unknown1; 251 268 uint32 unknown2; … … 254 271 uint32 unknown5; 255 272 uint32 unknown6; 273 uint32 unknown7; 256 274 } REGF_FILE; 257 275 258 276 259 typedef struct { 277 278 typedef struct 279 { 260 280 REGF_FILE* f; 261 281 void_stack* key_positions; … … 266 286 267 287 268 typedef struct { 288 typedef struct 289 { 269 290 REGF_NK_REC* nk; 270 291 uint32 cur_subkey; … … 316 337 317 338 339 340 /****************/ 341 /* Experimental */ 342 /****************/ 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); 362 318 363 #endif /* _REGFI_H */
Note: See TracChangeset
for help on using the changeset viewer.