From 9ee2722cd37c6586da24d85defa63dee7930e02d Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Tue, 6 Jan 2026 10:52:26 +0000 Subject: [PATCH] Add sector tag type conversion function --- tool/aaruformattool.h | 1 + tool/helpers.c | 53 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/tool/aaruformattool.h b/tool/aaruformattool.h index 33496dc..f45c740 100644 --- a/tool/aaruformattool.h +++ b/tool/aaruformattool.h @@ -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); diff --git a/tool/helpers.c b/tool/helpers.c index 59b4b2c..39a0174 100644 --- a/tool/helpers.c +++ b/tool/helpers.c @@ -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"; + } +}