04-25-2021, 07:15 AM
(02-04-2021, 03:10 AM)Grasterizer Wrote: alright
after looking at several .bars files for animal crossing new horizons, i come up with a few conclusions:
the .bars file structure is just the same, with a few interesting points:
Quote:A list of offsets of pointing AMTA and BWAV is exist. Finding them is actually easy. Start from offset 0x10 where there's a collection of AMTA hashes (they're in "DWORD" so it'll be "the amount of AMTA it has, multiplied by 4" [4 refers to "DWORD"]). The end of the offsets list is when AMTA (41 4D 54 41) is declared. you can have a look at this picture as an example, taken from Doubutsugo_Base.bars
As you can see, the black lined is the AMTA's hashes, and the red lined is the offsets.
Let's take an example of one offset:
Code:28 00 00 00 00 01 00 00
The first 4 numbers (28 00 00 00) represents an offset of AMTA, and the last 4 numbers (00 01 00 00) represents offset of BWAV. and both of them is read in reverse, in this case, the offset of AMTA will be at 0x28, and the offset of BWAV will be 0x100. This is handy when there's a case where the amount of AMTA is more than the number of BWAV the .bars file has. Want an example? get Doubutsugo_Ghost.bars (it has 36 AMTAs and 5 BWAVs [you need an update 1.4.0+ because that file was added in update 1.4.0]).
Quote:Have a look at this picture for an AMTA v5 example:
The version of AMTA is 5, so the structure is pretty much different from previous versions. To get the filename within AMTA v5, refer to the value on offset 0x24. in this case, it's 0x32, and therefore it's 0x24 + 0x32, equals 0x56. And therefore, starting from 0x56, that's where you get the filename for a BWAV pointed from the offsets in that .bars file
And so, to elaborate with both points, the filename from an AMTA specified on the offset is for the BWAV specified on the offset itself.
so from the code here: (28 00 00 00 00 01 00 00, taken from Doubutsugo_Base.bars), the filename from AMTA on offset 0x28 is for the BWAV file on offset 0x100
i'm terribly sorry if i'm bad at explaining...
Hi,
A couple of months ago I made this. Maybe it will come in handy.
https://github.com/McSpazzy/BarsExtract
It is strictly for ACNH bars files, most likely wont work with any other. It makes a lot of assumptions to keep the code complexity down, and to make it speedy.