decompiler-cpp: Open sla files as 'binary'

Compressed files need to be opened as binaries when reading. Fixes
opening sla files on Windows.
This commit is contained in:
Eric Kilmer 2024-03-30 18:26:27 -04:00
parent 2a7897c366
commit e18b424b02
No known key found for this signature in database
GPG key ID: 504CA431CF70054B

View file

@ -560,7 +560,7 @@ void Sleigh::initialize(DocumentStorage &store)
if (el == (const Element *)0)
throw LowlevelError("Could not find sleigh tag");
sla::FormatDecode decoder(this);
ifstream s(el->getContent());
ifstream s(el->getContent(), std::ios_base::binary);
if (!s)
throw LowlevelError("Could not open .sla file: " + el->getContent());
decoder.ingestStream(s);