• Announcements

    • Detrux

      Site Relaunched   10/13/2016

      Welcome back to BFEditor.org! We've upgraded the forum software, removed the spammers, and improved security. Apologies for the downtime! Det
Sign in to follow this  
Followers 0
Frankelstner

Cascat-Based File Tweaker

44 posts in this topic

Update: A patch released around November or December adds RSA signatures to the archives. When having modified content, it is not possible to join a game on a PB protected server anymore. As a side effect, it's not possible to play with modified files on unprotected or unranked servers either. Even the singleplayer gives back the same error message when modified files are detected. Due to that, there's no point in adjusting the tool to work with the new archives (that's the easy part), it's impossible fake the signatures and thus the game cannot be modded anymore unless you modify the exe.

The tweaker is up again. Make sure to read the instructions at the bottom of the post too. http://www.gamefront.com/files/22382214/bf3+tweaker.exe

I have not written most my statement in Mordor. It's being edited by mods all over the place. These are not my words. But the words here are.

Due to the heavy focus on the client in bf3 compared to bf2, modifying weapon damage among other things actually increases the damage dealt in multiplayer games (compared to bf2 where it does exactly nothing at all; make sure you understand this, modifying damage on your client is NOT meant to have any effect in online play in any game with decent netcode). bf3 (like bc2) also does not check for modified content making it possible to join ranked games with pb enabled. I have decided to reupload the tool as it is simply a mod tool after all (a very limited one to be honest). As far as I understand there are even people out there using injectors to play around with their graphics which is exactly how hacks work. I wouldn't touch one when playing online. The worst thing I can see happening when using modified files is a kick the moment you join a game (that is how it was handled in bf2). On the other hand as far as I know injectors might get you banned instantly, though I am fairly ignorant when it comes to hacks. I'd like to add, I had modified some files for bc2 three months ago and played a bit online. The account is still not banned so I would not trust others when they speak of bans for modified content.

The intent of this tool was to allow people to play around with settings in singleplayer and enjoy the engine (also so the folks at symthic can do controlled tests; as well as filmmakers and machinima). I am not going to deprive the community of this option. Anything else is not intended and I am not willing to take blame for it. Clientside netcode is simply not acceptable when bf2 did everything right. Also, the option to do these mods has been there all along, although without GUI. Here's a cascat of mine from 2011 (I think m16 ammo count or something like that; can't be bothered, it's not even worth trying it as the Update folder most likely overwrites the setting by now anyway): http://www.gamefront.com/files/21023744/cascat_rar It has been on denkirson all along though I never even thought of testing it online; it was only after I realized that bc2 does not check for modified content either that I even dreamed of testing mods online in bf3.

This program is based heavily on my Python script here: http://www.bfeditor.org/forums/index.php?showtopic=15531&st=0 The only difference is that the script discards the offset of the bytes for each entry instantly (unless you uncomment the line with the @) whereas this tool keeps track of the absolute offset for every field allowing users to change things directly.

I suspect the game will add a check for valid content very soon™ which is something I welcome. Some servers with attentive admins already check for the existence of modded cas archives and may issue a kick. This being said, of course you are not meant to play with modified content on ranked servers.

Here is the tool: http://www.gamefront.com/files/22334866/bf3+tweaker.exe Might post it again some time. I honestly posted this first and then made tests second. The only thing I had tested before releasing was playing around with the zoom levels. That was possible in bc2 too so I didn't give it much thought. I wouldn't have expected the game to go that far with clientside hitreg. It's not even the client telling the server that he has hit someone with a certain projectile. It's the client telling the server that he has dealt any amount of damage to any player. The DICE way of suppressing mod tools. Make it so that the tool can be abused as a cheating device.

Requires .NET 4.5.

Instructions:

1) Either create a new cat or open the existing cas.cat. Note that the cat in the Update folder overwrites most of the original entries so it is highly recommended to look there first. Also note that DLC uses sbtoc archives and is affected only peripherally (it might be not affected at all).

2) Modify any value written in bold.

3) Save and activate the cat.

The tool will not write into the original assets (the cas archives) but instead create new cas archives in the range 50-99. It will make a copy of the original file to be tweaked in the new cas archive and apply changes there. The game uses a cat file containing the file hash, offset, size and archive number for each entry. I just tell the cat that the asset to look for (via hash) is not in archive 1-10 but instead in archive 50 so the cat file has to be overwritten to make any changes. However, the tool will make a backup of the cat. Also, the information contained is purely redundant as the cas archives themself have all the information to create a cat file from scratch (the tool is capable of that too if you delete all cats).

To unmod the game just select the appropriate "Restore Cat". You can add a new cat in case you don't want to lose all changes when reverting to the unmodded game. Also, if you directly change cas.cat, change a few things so a new cas archive is created and then restore the cat, that cas archive has just become useless. If you keep doing that you might end up with lots of cas archives that are not used anymore so you will probably want to manually delete them. I recommend making a new cat instead of tweaking cas.cat. Basically you alter the new cat when making tweaks and when you press "Activate" the new cat will be copied to cas.cat.

DLC expansions use sb and toc files instead of cas and cat so changes are not guaranteed to work there. And yes, the game does not do checks for modified content. Just like in bc2 you can do stuff like 4x zoom iron sights, though it was probably more useful in bc2 with the scope taking up a slot on its own. On the other hand it might come in handy for snipers.

Edited by Frankelstner

Share this post


Link to post
Share on other sites

It's a shame you deleted the download. The only thing worse than letting everybody have access to this (which would force DICE to arrive at some resolution sharpish) would be letting only a few people have it who can then craft an advantage for themselves most people can't get and which DICE won't necessarily stop in a hurry. While I hope an eventual resolution would see us able to use modified data files on unranked games right now by allowing this out there but keeping it underground you're making the game worse not better.

Share this post


Link to post
Share on other sites

It's a shame you deleted the download. The only thing worse than letting everybody have access to this (which would force DICE to arrive at some resolution sharpish) would be letting only a few people have it who can then craft an advantage for themselves most people can't get and which DICE won't necessarily stop in a hurry. While I hope an eventual resolution would see us able to use modified data files on unranked games right now by allowing this out there but keeping it underground you're making the game worse not better.

I am aware of that. The modified cascat I have posted should be proof enough of what is possible. Also I have posted everything to mod bc2 too (4x zoom iron sights, three months ago: http://imgur.com/dJUtJ http://imgur.com/Nev7Y) but there hasn't been any action from DICE. At the moment it seems more viable to me to have 50 madmen instead of 500. This being said I will make it public again in three days.

Ah and please don't hate on me too, no matter what I do 50% of the community will hate me. All I want is a simple "Excellent work!".

Edited by Frankelstner

Share this post


Link to post
Share on other sites

Well of course it's 'Excellent Work', quite the achievement, I've never wanted to mod any game more than I'd love to mod this one (I could write a list two pages long of tweaks I'd like to make private games more tense and tactical). But maybe it should've been kept secret and used just to distribute data files that achieve certain requested changes as you have now for colour correction. At the same time some instruction for server-ops on how to use PB MD5 checks to decide they don't want those changes on their server would've been appropriate. That would be a pretty manageable situation with only up-sides.

Share this post


Link to post
Share on other sites

Metro and other maps looks really nice now, the way they should be visible. Stupid Fading tint is bullcrap and dull. Is it possible you can upload the IRNV scope fix? or i will wait till you release tool since IRNV is so fudged up atm in Vanilla maps. Great Job btw !

Share this post


Link to post
Share on other sites

Well of course it's 'Excellent Work', quite the achievement, I've never wanted to mod any game more than I'd love to mod this one (I could write a list two pages long of tweaks I'd like to make private games more tense and tactical). But maybe it should've been kept secret and used just to distribute data files that achieve certain requested changes as you have now for colour correction. At the same time some instruction for server-ops on how to use PB MD5 checks to decide they don't want those changes on their server would've been appropriate. That would be a pretty manageable situation with only up-sides.

Look, I have barely made any tests before releasing the tool. Think back to bf2. Changing things on your client have no effect. The server handles projectile damage, materials, deviation, recoil, whether you are zoomed in or not. I had not thought of testing it because according to my idea of the game it would not have any effect. It would've been wasted time.

Share this post


Link to post
Share on other sites

Okay, so, how do I use this to change Blue Valley to a night map?

If by blue valley you mean the armored kill map Valley, then change the floats from offset 507042112 to 507042136 in Update\Xpack3\Data\Win32\Levels\XP3_Valley\XP3_Valley.sb to something reasonable.

Share this post


Link to post
Share on other sites

If by blue valley you mean the armored kill map Valley, then change the floats from offset 507042112 to 507042136 in Update\Xpack3\Data\Win32\Levels\XP3_Valley\XP3_Valley.sb to something reasonable.

Okay, can you teach me what that even means @_@ I'm a complete noob when it comes to this. Should I even bother?

Share this post


Link to post
Share on other sites
Should I even bother?

Nope.

Also as most of the discussion is about removing the blue, here are some absolute offsets for the DLC 1 and 3 lighting (yup, Python scripts plus manual editing). If you don't know what they mean it is probably better not to touch them.

Share this post


Link to post
Share on other sites

Nope.

Okay, well, I've seen a few people put out the cat and cas files for removing blue tint on the vanilla* maps. Can't that be done with .sb's as well?

Edited by IvanTehFennec

Share this post


Link to post
Share on other sites
Okay, well, I've seen a few people put out the cat and cas files for removing blue tint on the xpack maps. Can't that be done with .sb's as well?

Cascat and sbtoc are completely different archives. The tool is only for cascat archives as stated in the title. Anyone modding DLC maps has used the offsets I have given you (note that tehfusion has figured out the offsets on his own though). The pastes only make things more convenient.

Edited by Frankelstner

Share this post


Link to post
Share on other sites

Cascat and sbtoc are completely different archives. The tool is only for cascat archives as stated in the title. Anyone modding DLC maps has used the offsets I have given you (note that tehfusion has figured out the offsets on his own though). The pastes only make things more convenient.

I mean can you put out modded sbtoc's that remove blue tint?

Share this post


Link to post
Share on other sites

I mean can you put out modded sbtoc's that remove blue tint?

Not that I am aware of. They would be way too large. Cascat are excellent archives for modding. Every file exists only once (the DLC on the other hand for example have stored the weapon stats in the individual maps so the weapons are stored four times). Additionally new archives can be added just by telling the cat that there is another archive number. And that's the brilliant part, you see? The original assets are not modified at all and all changes are stored in a rather tiny file.

Every toc file has exactly one sb file with the same name. A cat file on the other hand has an arbitary number of cas files. I am not sure how to get around this issue.

Edited by Frankelstner

Share this post


Link to post
Share on other sites

Not that I am aware of. They would be way too large. Cascat are excellent archives for modding. Every file exists only once (the DLC on the other hand for example have stored the weapon stats in the individual maps so the weapons are stored four times). Additionally new archives can be added just by telling the cat that there is another archive number. And that's the brilliant part, you see? The original assets are not modified at all and all changes are stored in a rather tiny file.

Every toc file has exactly one sb file with the same name. A cat file on the other hand has an arbitary number of cas files. I am not sure how to get around this issue.

Shitty DLC coding from DICE I presume?

Share this post


Link to post
Share on other sites

Shitty DLC coding from DICE I presume?

Nope. It was the same with bc2. The bf3 alpha and beta relied on sbtoc too. Same for all other fb2 games. Only bf3 retail files are based on cascat.

Basically cascat means long loading times but easy mods whereas sbtoc means streamlining the archives for short loading times at the cost of space and ease of modding.

Share this post


Link to post
Share on other sites

Nope. It was the same with bc2. The bf3 alpha and beta relied on sbtoc too. Same for all other fb2 games. Only bf3 retail files are based on cascat.

Basically cascat means long loading times but easy mods whereas sbtoc means streamlining the archives for short loading times at the cost of space and ease of modding.

Out of curiosity, how does cascat and sbtoc compare to the zip files used in BF2/2142. I know the loading times in BF2 were super longer before the long md5 check, while they were significantly improved in 2142 by splitting the single large server and client zips into smaller multiple files (I did this to a modded version of POE2 as well and halved the loading times).

It really is unfathomable how much of this game is client side. They have some really idiotic people running the engine development team.

Edited by Cold Fussion

Share this post


Link to post
Share on other sites

Out of curiosity, how does cascat and sbtoc compare to the zip files used in BF2/2142. I know the loading times in BF2 were super longer before the long md5 check, while they were significantly improved in 2142 by splitting the single large server and client zips into smaller multiple files (I did this to a modded version of POE2 as well and halved the loading times).

Ah well. Both cascat and sbtoc are uncompressed. In cascat there is no internal structure in the archives and everything is accessed with a SHA1 hash. That's why my tool takes so long to load, it has to read all the metadata of the dbx files (can easily be 2/3 of the file) and then make a quick search for the right field that contains the actual filename in order to have more meaningful names than just 20 random bytes.

On the other hand sbtoc has superbundles containing bundles (sb also contains chunks, i.e. audio or graphics resources). These bundles are still archives and then in turn contain the dbx files that my program reads plus chunks again. In contrast to cascat there are also actual filenames given by the archive, adding a bit of redundancy with the filename defined by the archive and the same filename defined deep within the individual dbx file.

So cascat is more of a global file dump while making sure everything is unique whereas sbtoc does not mind making lots of copies for every individual map if it speeds up loading times. Either way, as the archives are uncompressed there's nothing to gain or lose by splitting the file into pieces this time around.

Share this post


Link to post
Share on other sites

Ah well. Both cascat and sbtoc are uncompressed. In cascat there is no internal structure in the archives and everything is accessed with a SHA1 hash. That's why my tool takes so long to load, it has to read all the metadata of the dbx files (can easily be 2/3 of the file) and then make a quick search for the right field that contains the actual filename in order to have more meaningful names than just 20 random bytes.

On the other hand sbtoc has superbundles containing bundles (sb also contains chunks, i.e. audio or graphics resources). These bundles are still archives and then in turn contain the dbx files that my program reads plus chunks again. In contrast to cascat there are also actual filenames given by the archive, adding a bit of redundancy with the filename defined by the archive and the same filename defined deep within the individual dbx file.

So cascat is more of a global file dump while making sure everything is unique whereas sbtoc does not mind making lots of copies for every individual map if it speeds up loading times. Either way, as the archives are uncompressed there's nothing to gain or lose by splitting the file into pieces this time around.

Ah ok. It's interesting how they have so much redundancy in the game files. I guess they consider hard drive space and data limits aren't a big problem in todays world. If I could request two features for your tools (if you're taking them) it would be loading multiple (lets call them .tweak files for old times sake) in tabs, and possibly a search function to search for a term inside a 'tweak' file.

Share this post


Link to post
Share on other sites

Ah ok. It's interesting how they have so much redundancy in the game files. I guess they consider hard drive space and data limits aren't a big problem in todays world. If I could request two features for your tools (if you're taking them) it would be loading multiple (lets call them .tweak files for old times sake) in tabs, and possibly a search function to search for a term inside a 'tweak' file.

Dbx are the new tweak and con. At least I think that's what they are called. I don't even know what these letters stand for ever since these files appeared in bc2 beta.

I'll try to do something with DLC first and then try to add a search. Sadly the DLC won't be as grand as cascat modding though because I don't see a way to create additional small archives. I'd rather not make any promises for tabs even though I'd like to see them. Wish I was as skilled as Corsix when he made his tool for coh.

Share this post


Link to post
Share on other sites

Dbx are the new tweak and con. At least I think that's what they are called. I don't even know what these letters stand for ever since these files appeared in bc2 beta.

I'll try to do something with DLC first and then try to add a search. Sadly the DLC won't be as grand as cascat modding though because I don't see a way to create additional small archives. I'd rather not make any promises for tabs even though I'd like to see them. Wish I was as skilled as Corsix when he made his tool for coh.

Zeus bowed down before Corsix. His tools for coh were absolutely amazing.

Share this post


Link to post
Share on other sites

gamefront reports this as being only 33k in size, and naturally the 33k download is corrupt. any chance of uploading it again?

BF3 is currently my least played game, if your tweaker can help change that then i'd like to give it a try

Share this post


Link to post
Share on other sites

gamefront reports this as being only 33k in size, and naturally the 33k download is corrupt. any chance of uploading it again?

BF3 is currently my least played game, if your tweaker can help change that then i'd like to give it a try

It's 33k. Do you have .NET 4.5? Also note that I haven't added a background worker or anything like that so the tool will be unresponsive for a few seconds while loading.

Share this post


Link to post
Share on other sites

Just a heads up guys, Punkbuster is now kicking players with MD5 hash check failed for 2 minutes. Looks like PB and DICE made a fix :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0