Lines Matching refs:entry
398 struct SII { /* this is an image of an $SII index entry */
416 struct SDH { /* this is an image of an $SDH index entry */
4855 * Check whether a SDS entry is valid
4877 printf("** Extra data appended to entry (expected size %ld)\n",
4930 * Check whether a SDS entry is consistent with other known data
4945 printf("Valid entry at 0x%lx for key 0x%lx\n",
5121 * Check whether a SII entry is sane
5124 static BOOL valid_sii(const char *entry, u32 prevkey)
5130 key = get4l(entry,16);
5138 if (get2l(entry,0) != 20) {
5139 printf("** offset %d (instead of 20)\n",(int)get2l(entry,0));
5143 if (get2l(entry,2) != 20) {
5144 printf("** size %d (instead of 20)\n",(int)get2l(entry,2));
5148 if (get4l(entry,4) != 0) {
5149 printf("** fill1 %d (instead of 0)\n",(int)get4l(entry,4));
5153 if (get2l(entry,12) & 1) {
5154 if (get2l(entry,8) != 48) {
5155 printf("** index size %d (instead of 48)\n",(int)get2l(entry,8));
5160 if (get2l(entry,8) != 40) {
5161 printf("** index size %d (instead of 40)\n",(int)get2l(entry,8));
5165 if (get2l(entry,10) != 4) {
5166 printf("** index key size %d (instead of 4)\n",(int)get2l(entry,10));
5170 if ((get2l(entry,12) & ~3) != 0) {
5171 printf("** flags 0x%x (instead of < 4)\n",(int)get2l(entry,12));
5175 if (get2l(entry,14) != 0) {
5176 printf("** fill2 %d (instead of 0)\n",(int)get2l(entry,14));
5180 if (get4l(entry,24) != key) {
5182 (int)get4l(entry,24),(int)key);
5190 * Check whether a SII entry is consistent with other known data
5193 static int consist_sii(const char *entry)
5200 key = get4l(entry,16);
5202 printf("Valid entry for key 0x%lx\n",(long)key);
5209 if ((u32)get4l(entry,20) != psecurdata->hash) {
5211 (unsigned int)get4l(entry,20),
5215 if (get8l(entry,28) != psecurdata->offset) {
5217 (long long)get8l(entry,28),
5221 if (get4l(entry,36) != psecurdata->length) {
5223 (long)get4l(entry,36),
5230 psecurdata->hash = get4l(entry,20);
5231 psecurdata->offset = get8l(entry,28);
5232 psecurdata->length = get4l(entry,36);
5255 char *entry;
5265 entry = (char*)NULL;
5269 entry = (char*)ntfs_read_sii(ntfs_context,(INDEX_ENTRY*)entry);
5270 if (entry) {
5271 valid = valid_sii(entry,prevkey);
5274 errcnt += consist_sii(entry);
5275 prevkey = get4l(entry,16);
5281 } while (entry && !done);
5290 * Check whether a SII entry is sane
5293 static BOOL valid_sdh(const char *entry, u32 prevkey, u32 prevhash)
5300 currhash = get4l(entry,16);
5301 key = get4l(entry,20);
5313 if (get2l(entry,0) != 24) {
5314 printf("** offset %d (instead of 24)\n",(int)get2l(entry,0));
5318 if (get2l(entry,2) != 20) {
5319 printf("** size %d (instead of 20)\n",(int)get2l(entry,2));
5323 if (get4l(entry,4) != 0) {
5324 printf("** fill1 %d (instead of 0)\n",(int)get4l(entry,4));
5328 if (get2l(entry,12) & 1) {
5329 if (get2l(entry,8) != 56) {
5330 printf("** index size %d (instead of 56)\n",(int)get2l(entry,8));
5335 if (get2l(entry,8) != 48) {
5336 printf("** index size %d (instead of 48)\n",(int)get2l(entry,8));
5340 if (get2l(entry,10) != 8) {
5341 printf("** index key size %d (instead of 8)\n",(int)get2l(entry,10));
5345 if ((get2l(entry,12) & ~3) != 0) {
5346 printf("** flags 0x%x (instead of < 4)\n",(int)get2l(entry,12));
5350 if (get2l(entry,14) != 0) {
5351 printf("** fill2 %d (instead of 0)\n",(int)get2l(entry,14));
5355 if ((u32)get4l(entry,24) != currhash) {
5357 (unsigned int)get4l(entry,24),(unsigned int)currhash);
5361 if (get4l(entry,28) != key) {
5363 (int)get4l(entry,28),(int)key);
5367 if (get4l(entry,44)
5368 && (get4l(entry,44) != 0x490049)) {
5370 (long)get4l(entry,44));
5378 * Check whether a SDH entry is consistent with other known data
5381 static int consist_sdh(const char *entry)
5388 key = get4l(entry,20);
5390 printf("Valid entry for key 0x%lx\n",(long)key);
5397 if ((u32)get4l(entry,24) != psecurdata->hash) {
5399 (unsigned int)get4l(entry,24),
5403 if (get8l(entry,32) != psecurdata->offset) {
5405 (long long)get8l(entry,32),
5409 if (get4l(entry,40) != psecurdata->length) {
5411 (long)get4l(entry,40),
5418 psecurdata->hash = get4l(entry,24);
5419 psecurdata->offset = get8l(entry,32);
5420 psecurdata->length = get4l(entry,40);
5441 char *entry;
5454 entry = (char*)NULL;
5457 entry = (char*)ntfs_read_sdh(ntfs_context,(INDEX_ENTRY*)entry);
5458 if (entry) {
5459 valid = valid_sdh(entry,prevkey,prevhash);
5462 errcnt += consist_sdh(entry);
5463 prevhash = get4l(entry,16);
5464 prevkey = get4l(entry,20);
5470 } while (entry && !done);