From f5f70c6c42e25cfc0b5d085a5f876a3ea0b70b38 Mon Sep 17 00:00:00 2001 From: Eren <66168591+Elpisdev@users.noreply.github.com> Date: Wed, 5 Feb 2025 14:06:13 +0900 Subject: [PATCH] exfat extraction fix --- unsegareborn/exfat.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/unsegareborn/exfat.h b/unsegareborn/exfat.h index e0d7ef1..40b2471 100644 --- a/unsegareborn/exfat.h +++ b/unsegareborn/exfat.h @@ -12,8 +12,8 @@ #define EXFAT_ENTRY_EOD 0x00 #define EXFAT_ENTRY_BITMAP 0x81 #define EXFAT_ENTRY_FILE 0x85 -#define EXFAT_ENTRY_STREAM 0xC0 -#define EXFAT_ENTRY_FILENAME 0xC1 +#define EXFAT_ENTRY_STREAM 0xC0 +#define EXFAT_ENTRY_FILENAME 0xC1 #pragma pack(push, 1) @@ -74,7 +74,7 @@ typedef struct { typedef struct { uint8_t entry_type; uint8_t flags; - uint16_t file_name[15]; + uint16_t file_name[15]; // please work } ExfatFileNameEntry; #pragma pack(pop) @@ -89,12 +89,16 @@ typedef struct { typedef struct { FILE* fp; ExfatBootSector boot_sector; + uint32_t bytes_per_sector; uint32_t bytes_per_cluster; uint32_t cluster_heap_offset_bytes; + uint32_t fat_offset_bytes; + uint32_t fat_length_bytes; + uint32_t* fat; } ExfatContext; bool exfat_init(ExfatContext* ctx, const char* filename); bool exfat_extract_all(ExfatContext* ctx, const char* output_dir); void exfat_close(ExfatContext* ctx); -#endif // EXFAT_H \ No newline at end of file +#endif // EXFAT_H