From b32385a0afeb105c464586b81816dfe1a2db1dac Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Fri, 26 Apr 2024 10:31:44 +0300 Subject: [PATCH] Fix BA2 signature check --- components/bsa/ba2dx10file.cpp | 4 ++-- components/bsa/ba2gnrlfile.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/bsa/ba2dx10file.cpp b/components/bsa/ba2dx10file.cpp index b056f6faca..7246703504 100644 --- a/components/bsa/ba2dx10file.cpp +++ b/components/bsa/ba2dx10file.cpp @@ -113,8 +113,8 @@ namespace Bsa input.read(reinterpret_cast(header), 16); input.read(reinterpret_cast(&fileTableOffset), 8); - if (header[0] == 0x00415342) /*"BSA\x00"*/ - fail("Unrecognized compressed BSA format"); + if (header[0] != ESM::fourCC("BTDX")) + fail("Unrecognized BA2 signature"); mVersion = header[1]; switch (static_cast(mVersion)) { diff --git a/components/bsa/ba2gnrlfile.cpp b/components/bsa/ba2gnrlfile.cpp index 3e4cd1be83..f4d04e9bd3 100644 --- a/components/bsa/ba2gnrlfile.cpp +++ b/components/bsa/ba2gnrlfile.cpp @@ -107,8 +107,8 @@ namespace Bsa input.read(reinterpret_cast(header), 16); input.read(reinterpret_cast(&fileTableOffset), 8); - if (header[0] == 0x00415342) /*"BSA\x00"*/ - fail("Unrecognized compressed BSA format"); + if (header[0] != ESM::fourCC("BTDX")) + fail("Unrecognized BA2 signature"); mVersion = header[1]; switch (static_cast(mVersion)) {