ryan-rsm-mckenzie / bsa Goto Github PK
View Code? Open in Web Editor NEWC++ library for working with the Bethesda archive file format
License: MIT License
C++ library for working with the Bethesda archive file format
License: MIT License
I am able to reproduce this bug with this simple code
#include <bsa/fo4.hpp>
int main()
{
using namespace bsa::fo4;
file f;
f.read("textures/in.dds", format::directx);
f.write("textures/out.dds", format::directx);
}
This corrupts all tested textures. : Example
By looking at it in a hex editor, the header appears to be fine. The corruption starts at the end of the header, as soon as we enter the data section
The issue appears to be in write
. Creating a textures BSA, and extracting it with another tool seems to work
When iterating this archive (from WACCF) the file "textures\\weapons\\orcish\\orcisharrow.dds"
is listed twice.
This causes issues in multithreading with two threads trying to open the same file
This is due to how byte_container
is defined. By default, it creates an empty span
bsa/include/bsa/detail/common.hpp
Lines 568 to 572 in 938c6b5
std::data
of this empty span will return nullptr
.
By making data_owner
the first alternative, we could avoid this issue. Or maybe default construction should be a span to a static empty vector, for performance?
If this is by design, I suggest adding an assertion to make debugging easier.
With the introduction of the v2 and v3 variants of the .ba2
format in Starfield, the archive format
is no longer sufficient to discriminate between data format variants. Most functions now also require a compression_format
to handle compression properly, which means that configuring inputs to functions has become overly obnoxious. As a result, I have taken the liberty to convert many functions to take some form of *_param
. This offers users the flexibility to override only the fields they need, while leaving others untouched by leveraging designated initializers. Unfortunately, this has the undesired side effect of being the largest API break this library has had thus far. This issue stands as a forum for users to provide feedback on the new API changes: whether they like them/don't like them/think they could be better/etc.
For reference, the .ba2
format is described in detail here.
I am currently investigating, but haven't found anything yet
Reproducing:
Recap of what I found so far:
BitsPerPixel
should be always 8
.Flags
should be 0 or 1 if the texture is a cubemapA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.