Gears 5 b2container file

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
DJ Normality
Posts: 647
Joined: Tue Jul 24, 2018 8:52 am

Re: Gears 5 b2container file

Post by DJ Normality »

Thank you so much Spirit. But after running the script for several hours. All the assets I get are unreadable.
Image
I think it stops here and just hangs on this file too.
Image
Hopefully its only because the script discovery at the moment. But I cant seem to get anything readable.
Last edited by DJ Normality on Thu Dec 09, 2021 2:50 pm, edited 1 time in total.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Gears 5 b2container file

Post by spiritovod »

@DJ Normality: Please read my base post carefully, it's explained there why it may "hang" on some big files. The script is actually too complex, so it will rather crash than just hangs, but you can check this out by uncommenting certain section in the script to skip such files (though you will skip some big movie files as well).
And the game is not supported by umodel at the moment, it has noticeably different format inside the assets, except for main engine features. Unfortunately, Gildor don't have enough time to work of this due to real-life matters, complexity of the format and lack of freely debuggable exe. But he is aware of recent news (such as b2container format) and willing to support the game when it will be possible for him.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Gears 5 b2container file

Post by aluigi »

OT: Just a little tip when quickbms takes tons of memory or is very slow, use the -9 option from command-line. It disables a slow security feature and makes the tool working like any other normal software.
Simo311
Posts: 8
Joined: Sat Nov 21, 2020 10:22 pm

Re: Gears 5 b2container file

Post by Simo311 »

I found out where I was mistaken.
Basically I was using an outdated version of GearGame.b2index file!
Now the script works just fine!
DJ Normality
Posts: 647
Joined: Tue Jul 24, 2018 8:52 am

Re: Gears 5 b2container file

Post by DJ Normality »

spiritovod wrote:@DJ Normality: Please read my base post carefully, it's explained there why it may "hang" on some big files. The script is actually too complex, so it will rather crash than just hangs, but you can check this out by uncommenting certain section in the script to skip such files (though you will skip some big movie files as well).
And the game is not supported by umodel at the moment, it has noticeably different format inside the assets, except for main engine features. Unfortunately, Gildor don't have enough time to work of this due to real-life matters, complexity of the format and lack of freely debuggable exe. But he is aware of recent news (such as b2container format) and willing to support the game when it will be possible for him.



Understood. Thanks again for all your work. Ill just see what I can get from Model Researcher until the time comes.

aluigi wrote:OT: Just a little tip when quickbms takes tons of memory or is very slow, use the -9 option from command-line. It disables a slow security feature and makes the tool working like any other normal software.



I will most certainly do that next time. Thanks Aluigi!
sinnerclown380
Posts: 59
Joined: Tue Apr 07, 2020 10:34 am

Re: Gears 5 b2container file

Post by sinnerclown380 »

Hello, can we do localization on the game with this command and do you have any idea about which file the language files are in?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Gears 5 b2container file

Post by spiritovod »

Thanks for the tip, aluigi, but in this case there is no visible difference for extraction speed, 10-20sec for 10min interval is within error margin for every run. While using -Q for suppressing all "open file" messages will noticeably reduce extraction time, especially for raw extract version of the script. You may consider adding a feature for suppressing such messages separately in future releases, but it's not a big deal, because formats like that are very rare and appear one time in a decade.
I'm more interested, is that possible to pass various mem files for log command on a condition (for caching purposes). For example, if I need to cache latest 10 used mem files and re-use them on condition, like:
1) Store usage of latest mem files in array (file name, mem file)
2) Check if mem file for such file name is already exist - if not, add it to array or replace existing one, if array is already full
3) Pass that changing mem file to log command
Omitting part with array and checks, which is quite obvious, building variable for different mem files is questionable - somehow like [string MEM = "MEMORY_FILE" , string MEM + i, log MEM OFFSET SIZE]. It may sound dumb, but I didn't even test possibilities yet.

@sinnerclown380: I was already asked about it in PM, so I'll just quote myself: "Due to the format complexity, I'm almost sure there will not be any tool or script with reimport function not now, nor in the future. It has too many cross-references (probably for multi-threading purposes) and the script is parsing like 1/3 of of them. I can imagine only manual edit of files, which are one-file-in-single-chunk-in-single-block files, but there are very few of them actually."
Theoretically replacing files via hooking should work, but currently the game is using EAC because of multiplayer features, so general hooks will not work and moreover, it will be illegal and may lead to account ban.
sinnerclown380
Posts: 59
Joined: Tue Apr 07, 2020 10:34 am

Re: Gears 5 b2container file

Post by sinnerclown380 »

spiritovod wrote:Thanks for the tip, aluigi, but in this case there is no visible difference for extraction speed, 10-20sec for 10min interval is within error margin for every run. While using -Q for suppressing all "open file" messages will noticeably reduce extraction time, especially for raw extract version of the script. You may consider adding a feature for suppressing such messages separately in future releases, but it's not a big deal, because formats like that are very rare and appear one time in a decade.
I'm more interested, is that possible to pass various mem files for log command on a condition (for caching purposes). For example, if I need to cache latest 10 used mem files and re-use them on condition, like:
1) Store usage of latest mem files in array (file name, mem file)
2) Check if mem file for such file name is already exist - if not, add it to array or replace existing one, if array is already full
3) Pass that changing mem file to log command
Omitting part with array and checks, which is quite obvious, building variable for different mem files is questionable - somehow like [string MEM = "MEMORY_FILE" , string MEM + i, log MEM OFFSET SIZE]. It may sound dumb, but I didn't even test possibilities yet.

@sinnerclown380: I was already asked about it in PM, so I'll just quote myself: "Due to the format complexity, I'm almost sure there will not be any tool or script with reimport function not now, nor in the future. It has too many cross-references (probably for multi-threading purposes) and the script is parsing like 1/3 of of them. I can imagine only manual edit of files, which are one-file-in-single-chunk-in-single-block files, but there are very few of them actually."
Theoretically replacing files via hooking should work, but currently the game is using EAC because of multiplayer features, so general hooks will not work and moreover, it will be illegal and may lead to account ban.


Thanks for lighting up, spiritovod
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Gears 5 b2container file

Post by aluigi »

spiritovod wrote:Thanks for the tip, aluigi, but in this case there is no visible difference for extraction speed, 10-20sec for 10min interval is within error margin for every run. While using -Q for suppressing all "open file" messages will noticeably reduce extraction time, especially for raw extract version of the script. You may consider adding a feature for suppressing such messages separately in future releases

Minimizing the quickbms window usually improve the speed N times when there are many loaded/extracted files.
It's a limitation of the command-line dialog of Windows (cmd.exe) which has ever been incredibly slow since the old command.com on Win9x.

spiritovod wrote:1) Store usage of latest mem files in array (file name, mem file)
2) Check if mem file for such file name is already exist - if not, add it to array or replace existing one, if array is already full
3) Pass that changing mem file to log command
Omitting part with array and checks, which is quite obvious, building variable for different mem files is questionable - somehow like [string MEM = "MEMORY_FILE" , string MEM + i, log MEM OFFSET SIZE]. It may sound dumb, but I didn't even test possibilities yet.

I guess quickbms may not be the best solution in this case :(
GabrielProudmore
Posts: 13
Joined: Sun Apr 07, 2019 4:42 pm

Re: Gears 5 b2container file

Post by GabrielProudmore »

spiritovod wrote:@DJ Normality: Please read my base post carefully, it's explained there why it may "hang" on some big files. The script is actually too complex, so it will rather crash than just hangs, but you can check this out by uncommenting certain section in the script to skip such files (though you will skip some big movie files as well).
And the game is not supported by umodel at the moment, it has noticeably different format inside the assets, except for main engine features. Unfortunately, Gildor don't have enough time to work of this due to real-life matters, complexity of the format and lack of freely debuggable exe. But he is aware of recent news (such as b2container format) and willing to support the game when it will be possible for him.


I think someone already find out how extract models from Gears Tactics using the .bms for unpack the models. Sadly a NSFW creator that wouldn't mentioned how he manages to get the model.

Because umodel still doesn't recognize the format of the unpacked uasset
DJ Normality
Posts: 647
Joined: Tue Jul 24, 2018 8:52 am

Re: Gears 5 b2container file

Post by DJ Normality »

Error on .b2containers for SP Acts1,2,3,4 I can upload samples if needed.
Image
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Gears 5 b2container file

Post by spiritovod »

@DJ Normality: I can only suggest to use raw_extract version of the script for now, or limit maximum size of a single extracted file (there is comment in the script for this option).
DJ Normality
Posts: 647
Joined: Tue Jul 24, 2018 8:52 am

Re: Gears 5 b2container file

Post by DJ Normality »

ok ill try that thanks again
xGeoThumbs
Posts: 1
Joined: Wed Jan 19, 2022 3:17 pm

Re: Gears 5 b2container file

Post by xGeoThumbs »

Hi, I am completely out of my comfort zone here. I am trying the raw script in quickbms but I get this error when I try to open the index:

- error in src\cmd.c line 3820: CMD_Open_func()
Error: Permission denied

Last script line before the error or that produced the error:
56 open FDSE ARCHIVE_NAME B2 EXISTS
coverage file 0 0% 95 62687401 . offset 0000000000000087

Any help, I am trying to extract the prerendered Bink video files for a video project of mine.
kk27
Posts: 2
Joined: Thu Jan 05, 2023 2:39 am

Re: Gears 5 b2container file

Post by kk27 »

spiritovod wrote:It's strange that nobody didn't release anything for this format yet, it's not even encrypted and not obfuscated, like many other mixed formats. So, here is work-in-progress script for files extraction from b2 containers. Based on initial research from aluigi. Use it on GearGame.b2index.

Extraction of some big files (~800MB+) will take quite some time, since script is building them from 1MB chunks in memory - make sure you have enough free RAM and be patient, otherwise quickbms may stop with some error. Alternatively, you can uncomment certain section in the script to skip them.
Directory tree data looks similar to the one from latest utoc format, so it shouldn't be hard as well, but it's much easier to fix base stuff in raw format. The script is not errors-proof yet, so please report only major problems when you're certain about it.

P.S. In case if you're missing some b2containers (b2index is addressing them all regardless of their presence), it's better to comment out second "print" string in the script. If you want to extract some small container, aside from commenting out the mentioned string, you can also run quickbms with -Q option.

Update: Script fixed in v0.1a, now it can skip files from missing containers properly. Also, it would be nice if someone could check the script with Gears Tactics, since I don't have not free space, nor time to do this.

Update 2: Script updated to v0.2, now it can extract files with filenames, but without complete paths. Thus some overlaps are possible (in case of files with similar names from different folders), you can use "r" when asked to rename them. Also, you can now uncomment certain script section to skip big assets upon extraction (more than 800MB by default).

Update 3: Script with filenames is quite bugged when some b2containers are missing, so I've decided to attach both scripts, including previous version (for raw extraction without filenames). Raw extraction script works fine even if you're using it with only single b2container present (via b2index).

Update 4: Base script fixed in v0.2a, now it can handle files from missing containers properly. Though it works much slower than raw extraction script, especially when used with a single container (random test: 35 sec via raw extraction vs 10 min via base script). It probably will not be optimized until base features will be done.
hello i managed to extract all gears 5 files i wanted to try with gears tactics too but from this error
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Gears 5 b2container file

Post by spiritovod »

@kk27: I'll just copy my comment on current situation with the script from other place:
"I have no plans for looking into Tactics until initial script for Gears 5 will be complete, at least to a certain degree. Though development for b2container script was postponed due to low interest from users and increased priority for other things (and also because quickbms is not suitable for such formats due to its limitations). Maybe at some point it will be properly supported or someone else create a more appropriate solution, the format itself is not very complicated."