Add sector tag type conversion function

This commit is contained in:
2026-01-06 10:52:26 +00:00
parent 13d54526f3
commit 9ee2722cd3
2 changed files with 54 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ int info(const char *path);
char *byte_array_to_hex_string(const unsigned char *array, int array_size);
const char *media_type_to_string(MediaType type);
const char *media_tag_type_to_string(int32_t type);
const char *sector_tag_type_to_string(int32_t type);
const char *data_type_to_string(uint16_t type);
int read_sector(unsigned long long sector_no, const char *path);
int printhex(unsigned char *array, unsigned int length, int width, bool color);

View File

@@ -1534,3 +1534,56 @@ const char *media_type_to_string(MediaType type)
return "Unknown Media Type";
}
}
const char *sector_tag_type_to_string(int32_t type)
{
switch(type)
{
case AppleSonyTagAaru:
return "Apple Sony Tag";
case CdSectorSync:
return "CD Sector Sync";
case CdSectorHeader:
return "CD Sector Header";
case CdSectorSubHeader:
return "CD Sector Sub-Header";
case CdSectorEdc:
return "CD Sector EDC";
case CdSectorEccP:
return "CD Sector ECC P";
case CdSectorEccQ:
return "CD Sector ECC Q";
case CdSectorEcc:
return "CD Sector ECC (P+Q)";
case CdSectorSubchannelAaru:
return "CD Sector Subchannel";
case CdTrackIsrc:
return "CD Track ISRC";
case CdTrackText:
return "CD Track Text";
case CdTrackFlags:
return "CD Track Flags";
case DvdCmi:
return "DVD Copyright Management Information";
case FloppyAddressMark:
return "Floppy Address Mark";
case DvdSectorTitleKey:
return "DVD Sector Title Key";
case DvdTitleKeyDecrypted:
return "DVD Title Key (Decrypted)";
case DvdSectorInformation:
return "DVD Sector Information";
case DvdSectorNumber:
return "DVD Sector Number";
case DvdSectorIedAaru:
return "DVD Sector IED";
case DvdSectorEdcAaru:
return "DVD Sector EDC";
case AppleProfileTagAaru:
return "Apple Profile Tag";
case PriamDataTowerTagAaru:
return "Priam DataTower Tag";
default:
return "Unknown Sector Tag";
}
}