Skip to content

Commit

Permalink
Added exfat support in detect.c and dos.c
Browse files Browse the repository at this point in the history
  • Loading branch information
kamwoods committed Nov 9, 2014
1 parent 43e67e4 commit 8ec7c6e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void detect_atari_partmap(SECTION *section, int level);
void detect_dos_partmap(SECTION *section, int level);
void detect_gpt_partmap(SECTION *section, int level);
void detect_fat(SECTION *section, int level);
void detect_exfat(SECTION *section, int level);
void detect_ntfs(SECTION *section, int level);
void detect_hpfs(SECTION *section, int level);
void detect_dos_loader(SECTION *section, int level);
Expand Down Expand Up @@ -131,6 +132,7 @@ DETECTOR detectors[] = {
detect_amiga_fs,
detect_apple_volume,
detect_fat,
detect_exfat,
detect_ntfs,
detect_hpfs,
detect_udf,
Expand Down
21 changes: 21 additions & 0 deletions src/dos.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ void detect_fat(SECTION *section, int level)
/* since the above is also present on NTFS, make sure it's not NTFS... */
if (memcmp(buf + 3, "NTFS ", 8) == 0)
return;
if (memcmp(buf + 3, "EXFAT ", 8) == 0)
return;

/* next, some soft tests, taking score */
score = 0;
Expand Down Expand Up @@ -515,6 +517,25 @@ void detect_fat(SECTION *section, int level)
}
}

/*
* exFAT file system
*/

void detect_exfat(SECTION *section, int level)
{
unsigned char *buf;

if (get_buffer(section, 0, 512, (void **)&buf) < 512)
return;

/* check signatures */
if (memcmp(buf + 3, "EXFAT ", 8) != 0)
return;

/* tell the user */
print_line(level, "exFAT file system");
}

/*
* NTFS file system
*/
Expand Down

0 comments on commit 8ec7c6e

Please sign in to comment.