Page 3 of 6

Re: StarWars Battlefront unpacker / audio decoder

Posted: Wed Dec 09, 2015 8:19 pm
by elementofprgress
I have a working dumper script that includes the new patched cas.cat format. I got something like 132k audio files with it. Can't remember if any chunks are cas dependent so if it makes a difference for not. For ebx and res files it certainly does.

I'll post it once I clean it up a little. Right now it is kinda messy and super...not optimized because I was trying to break it down to figure out why the data I get is different then what is experienced in the game/patch notes.


As for the changes with textures. I have only taken a quick peak but it looks like the chunk files need some xor love and then will be good to go.
https://gyazo.com/f24d71c98c46cf95e9ebca991b225030

Re: StarWars Battlefront unpacker / audio decoder

Posted: Thu Dec 10, 2015 8:10 am
by kkhaial
elementofprgress if you can get textures to work that would be awesome

Re: StarWars Battlefront unpacker / audio decoder

Posted: Thu Dec 10, 2015 9:18 pm
by daemon1
I thought somebody already did the textures convertor. I'm not an expert, but nothing is xored here. Sample output:

Image

And here's the version of "dainazinas" tool I made that at least unpacks most of the diffuse textures. Just need some time to find codes for normal maps.

http://www60.zippyshare.com/v/90AbbsOu/file.html

Re: StarWars Battlefront unpacker / audio decoder

Posted: Fri Dec 11, 2015 6:31 am
by JakeGreen
daemon1 wrote:I thought somebody already did the textures convertor. I'm not an expert, but nothing is xored here. Sample output:

Image
Awesome worked perfectly, even some of the normal maps worked like the ones that are blue.

Next all we need is for someone to edit his 3ds max script and we got everything working.

EDIT: I found a lot of Diffuse Textures not working still so what you wanna do is this.

Open up the non-working C or CS texture into your hex editor of choice and highlight the first 9 rows of hex, the last line should have a "c" (no quotes) in it and you wanna make sure you get the very last dot in the 9th line and hold it there.

Once you do that open up a texture in your hex editor that has a G in place of the C and copy all 9 lines to the last dot and go back to your main texture that isn't working and make sure you still have it all selected and hit paste and save an it should be good to go.\

Also from what i'm looking at this is BC7 without SRGB so if you wanna add back the SRGB find a diffuse texture that works and do the same above and it wont make the texture so bright. I used a MSR texture to do this so that's why it's only BC7.

Also lastly if you want the textures to work i found loading them into VS 2013 and save it as PNG then load it into a program like Xnview and just save it as DDS and it should be great.

Or you can take and on the 9th line change the 63 to 48 and it will be good to go.

Not working.
Image

Working.
Image

Re: StarWars Battlefront unpacker / audio decoder

Posted: Fri Dec 11, 2015 5:00 pm
by daemon1
JakeGreen wrote:EDIT: I found a lot of Diffuse Textures not working still
This is because I only had a little time to find 3 most used compression types: bc1, bc3 & bc7. Also I understand that 62 should be used, not 63?

Anyway, I only have a very few textures unpacked from the files you sent me, so if you know which codes I need to use for which texture types (byte 12 in "unknownres" file), let me know and I will correct the tool.

I'm currently setting it to
63 (bc7) for 42
47 (bc1) for 36
4D (bc3) for 3C
and 63 for all other types.

Also I can remove the picture from it, so it will be small to upload here on xentax directly.

Re: StarWars Battlefront unpacker / audio decoder

Posted: Fri Dec 11, 2015 8:35 pm
by JakeGreen
daemon1 wrote:
JakeGreen wrote:EDIT: I found a lot of Diffuse Textures not working still
This is because I only had a little time to find 3 most used compression types: bc1, bc3 & bc7. Also I understand that 62 should be used, not 63?

Anyway, I only have a very few textures unpacked from the files you sent me, so if you know which codes I need to use for which texture types (byte 12 in "unknownres" file), let me know and I will correct the tool.

I'm currently setting it to
63 (bc7) for 42
47 (bc1) for 36
4D (bc3) for 3C
and 63 for all other types.

Also I can remove the picture from it, so it will be small to upload here on xentax directly.
Yep those are all the ones i've found, kinda odd cause some of the textures that was BC7_SRGB in the alpha and beta are now BC1_SRGB.

Re: StarWars Battlefront unpacker / audio decoder

Posted: Sat Dec 12, 2015 9:25 am
by daemon1
Proceeding with types. The skyes are in BC6, 8192x2048

Image

Re: StarWars Battlefront unpacker / audio decoder

Posted: Sat Dec 12, 2015 4:43 pm
by daemon1
About the Frostbite restypes: they are just a hash of their real names, as expected, and

6bde20ba = "Texture",

5C4954A6 = "DxTexture",
2D47A5FF is not "gfx", but "SwfMovie",
49B156D4 is not "mesh", but "meshset", so on.

Re: StarWars Battlefront unpacker / audio decoder

Posted: Sat Dec 12, 2015 7:04 pm
by elementofprgress
daemon1 wrote:About the Frostbite restypes: they are just a hash of their real names, as expected, and

6bde20ba = "Texture",

5C4954A6 = "DxTexture",
2D47A5FF is not "gfx", but "SwfMovie",
49B156D4 is not "mesh", but "meshset", so on.
A few months ago I got a resTypes list for BF4 from Frankelstner, who got it from Kiwidog or NoFate...I forget. anyways, you probably already have it all figured out but figure I'd post it so it is out there for everyone.
http://pastebin.com/sQE1Rmh2

What I'm currently using for my SWBF
http://pastebin.com/hifAvG4f
If you have any updated resTypes or something is wrong, let me know. I've only barely looked into it.

daemon1 wrote:I thought somebody already did the textures converter. I'm not an expert, but nothing is xored here.
Awesome!, I remember when the beta came out things changed. I was never sure if it was some compression or xor or some sort or if they just jumped to dx10 textures....which I know absolutely zero about lol

I remember seeing dainazinas texture batch converter and it not working after the beta and failing miserably at tinkering with the source.

Re: StarWars Battlefront unpacker / audio decoder

Posted: Sat Dec 12, 2015 7:41 pm
by daemon1
elementofprgress wrote:If you have any updated resTypes or something is wrong, let me know.
Sure:

0xf04f0c81:".Dx11ShaderProgramDatabase",
    0x9C4FAA17:".HeightfieldDecal"
0x957C32B1:".AtlasTexture",
0xC6CD3286:".EnlightenStaticDatabase",
0xA23E75DB:".TerrainLayerCombinations",
0xE36F0D59:".HavokClothPhysicsData",
    0x6BDE20BA:".Texture",
0x9D00966A:".UITtfFontFile",
0xC611F34A:".MeshEmitterResource",

Here's all your unknown types, if you have something else unknown, let me know.

Re: StarWars Battlefront unpacker / audio decoder

Posted: Sat Dec 12, 2015 10:11 pm
by elementofprgress
daemon1 wrote:
elementofprgress wrote:If you have any updated resTypes or something is wrong, let me know.
Sure:

0xf04f0c81:".Dx11ShaderProgramDatabase",
    0x9C4FAA17:".HeightfieldDecal"
0x957C32B1:".AtlasTexture",
0xC6CD3286:".EnlightenStaticDatabase",
0xA23E75DB:".TerrainLayerCombinations",
0xE36F0D59:".HavokClothPhysicsData",
    0x6BDE20BA:".Texture",
0x9D00966A:".UITtfFontFile",
0xC611F34A:".MeshEmitterResource",

Here's all your unknown types, if you have something else unknown, let me know.
Thank you, I just wanted to make sure that the resType list I use for the extraction scripts I write for symthic match with the resTypes your tools use.

I'm hoping I'll be able to share the file extraction script I've been working on. I know I'm able to pull all the EBX files(as they were my main concern), but those are all cas entries. I'm putting it though its paces to see if there are any noncas res/chunks or if any changes are need to get at them. As well has scanning for any more unknown res types that exist.

Re: StarWars Battlefront unpacker / audio decoder

Posted: Sun Dec 13, 2015 11:06 am
by daemon1
elementofprgress wrote:I'm hoping I'll be able to share the file extraction script I've been working on.
What's the purpose of your script? How is it different from Frank's script that I posted here in this thread?

Re: StarWars Battlefront unpacker / audio decoder

Posted: Sun Dec 13, 2015 1:04 pm
by daemon1
Texture conversion tool updated!

Included in the first post. Now it must convert all types including normals. It makes DDS in dx10 format, it can be viewed with PicoPixel viewer recommended by dainazinas. Even that tool is not working with height maps, and some other types, for those use something else. Only first side extracted for cubemaps, but I doubt anyone needs that.

Dumper script updated with res types. Textures will now have ".Texture" extension.

Re: StarWars Battlefront unpacker / audio decoder

Posted: Sun Dec 13, 2015 3:55 pm
by elementofprgress
daemon1 wrote:
elementofprgress wrote:I'm hoping I'll be able to share the file extraction script I've been working on.
What's the purpose of your script? How is it different from Frank's script that I posted here in this thread?
It is built off of Frankelstner's script. It is mostly small tweaks. Lots of cleaning. A lot of the main script isn't used/needed anymore. Though other areas are much messier to compensate. There are no flags labeling what is cas, noncas, a delta patch, etc anymore.

but the really big difference is that your script is only pulling files from the Data folder which is the patched folder(the base files). Which i'm sure you know from playing with the scripts and files but for the sake of anyone who doesn't the files in the Patch folder are the files the game mostly relies on. Though the patch folder is where things get tricky. A different format for the cat file. Yay delta patching and sha1 entries -.- The sb/tocs just throw everything at you with no way to identify whats a duplicate, what is gonna be patching something. You kinda just have to run it all though and see what sticks. Then the Update folder(which the patch folder used to be in) adds all the stuff from Jakku DLC but is also subject to patching from the patch files.


However, I haven't look into the chunks all that much(mainly because there are WAY to many) so I'm not sure how big of a difference getting patch files will make when it comes to audio and textures other then DLC stuff. How many audio files total have you been able to pull with just info from the data folder?

Re: StarWars Battlefront unpacker / audio decoder

Posted: Sun Dec 13, 2015 6:36 pm
by daemon1
elementofprgress wrote:There are no flags labeling what is cas, noncas, a delta patch, etc anymore.
As far as I can see, there's no noncas chunks or resources in this game. Everything is in CAS files.
elementofprgress wrote:How many audio files total have you been able to pull with just info from the data folder?
I don't have the game, so I don't know.

I have all small files (sb/toc, etc) and only the first cas_01.cas files from the whole set. But considering the size of chunks extracted from these, everything is extracted. The script goes through all sb/toc files, including the patch folder.

Also, by simple logic, since the whole patch folder is so small, it just can't hold any significant amount of chunk data (sounds or textures, or anything). The patch probably changes levels or some other game properties, but not the original audio/visual content.

At least thats how it was in other games that I had full size (Dragon age, Battlefield HL)