| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
#include "global.h" |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
void detect_bfs(SECTION *section, int level) |
| 36 |
{ |
| 37 |
unsigned char *buf; |
| 38 |
char s[256]; |
| 39 |
int off, en; |
| 40 |
u4 blocksize; |
| 41 |
u8 blockcount; |
| 42 |
|
| 43 |
for (off = 0; off <= 512; off += 512) { |
| 44 |
if (get_buffer(section, off, 512, (void **)&buf) < 512) |
| 45 |
continue; |
| 46 |
|
| 47 |
for (en = 0; en < 2; en++) { |
| 48 |
if (get_ve_long(en, buf + 32) == 0x42465331 && |
| 49 |
get_ve_long(en, buf + 36) == 0x42494745 && |
| 50 |
get_ve_long(en, buf + 68) == 0xdd121031 && |
| 51 |
get_ve_long(en, buf + 112) == 0x15b6830e) { |
| 52 |
|
| 53 |
print_line(level, "BeOS BFS (BeFS) file system, %s placement, %s", |
| 54 |
(off == 0) ? "Apple" : "Intel", |
| 55 |
get_ve_name(en)); |
| 56 |
|
| 57 |
|
| 58 |
get_string(buf, 32, s); |
| 59 |
if (s[0]) |
| 60 |
print_line(level + 1, "Volume name \"%s\"", s); |
| 61 |
|
| 62 |
|
| 63 |
blocksize = get_ve_long(en, buf + 40); |
| 64 |
blockcount = get_ve_quad(en, buf + 48); |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
format_blocky_size(s, blockcount, blocksize, "blocks", NULL); |
| 72 |
print_line(level + 1, "Volume size %s", s); |
| 73 |
|
| 74 |
return; |
| 75 |
} |
| 76 |
} |
| 77 |
} |
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
void detect_beos_loader(SECTION *section, int level) |
| 85 |
{ |
| 86 |
unsigned char *buf; |
| 87 |
|
| 88 |
if (section->flags & FLAG_IN_DISKLABEL) |
| 89 |
return; |
| 90 |
|
| 91 |
if (get_buffer(section, 0, 512, (void **)&buf) < 512) |
| 92 |
return; |
| 93 |
|
| 94 |
if (find_memory(buf, 512, "Be Boot Loader", 14) >= 0) |
| 95 |
print_line(level, "BeOS boot loader"); |
| 96 |
if (find_memory(buf, 512, "yT Boot Loader", 14) >= 0) |
| 97 |
print_line(level, "ZETA/yellowTab boot loader"); |
| 98 |
if (find_memory(buf, 512, "\x04" "beos\x06" "system\x05" "zbeos", 18) >= 0) |
| 99 |
print_line(level, "Haiku boot loader"); |
| 100 |
} |
| 101 |
|
| 102 |
|