You are here

Modding on Android

Pages

HansSchmucker's picture
Norman E. Carnage
Kickstarter Backer
Posts: 64
Modding on Android
#1 Submitted: Mon, 13/05/2013 - 21:51

Just to make it absolutely clear: I really only had a quick look and just thought creating a thread would be a good idea so that we don't do the same stuff over and over again. A lot of what I'm writing are just first guesses, nothing more.

It seems that Carma on Android is moddable. The data itself is not in the APK (which mostly contains video and music). Instead it's in an OBB file at Android/obb/com.stainlessgames.carmageddon.

I don't really know anything about that Opaque Binary Blobs as Google calls them. From the documentation it looks like they are supposed to be mountable partition images with optional encryption. But looking at the various OBB files on my sd card it looks more like people are using the OBB delivery mechanism to store whatever they want on sd. The carma obb is definitely not encrypted, that much can be verified with a quick search for the WAV magic word RIFF, but Google's JOBB tool still can't mount it. Looking at it in a hex editor, it doesn't look like any partition format I know. It does contain a magic word at the very end "[version]..1320", which I don't recognize either. The beginning could be a magic word or not, but I don't recognize it either. It's just 0x01000000 three times.

After that it says "DATA_ANDROID.WAD(" , which sounds like the whole OBB file is just a dummy container for this homemade WAD format. WAD is not really a specific format, today it's really just an alias for "simple uncompressed file table" (WAD apparently stands for "Where's All the Data?" according to Wikipedia... I honestly didn't know that).

After that there's a long list of file names and after that there's a table of what looks like 64bit numbers, probably offsets.

That's all I've gathered so far. It looks promising, but of course there could be checksums or other mechanisms for preventing modifications.

HansSchmucker's picture
Norman E. Carnage
Kickstarter Backer
Posts: 64
Submitted: Sat, 25/05/2013 - 17:14

Just looked at it again.

The basic format is like this:
At 0x38 there's a list of 0 terminated strings that ends with an additional 0. Those are the file names
Then comes a table of 64 bit values
Then another one with 32 bit values
And finally another one with 128 bit values.
After that comes the data.

Now, these values are in little-endian format. The second table seems to contain offsets. There are two WAVE files in the package that can be easily identified by their RIFF header. They start at 8FC198 and 9b5a70. That's 98c18f and 705a9b in little-endian format. The second table contains the values 6CC18F and 445a9b. That's suspiciously close... 0x2C too small both times, which is exactly our filename-table offset minus the number of bytes before "DATA_ANDROID.WAD". So we can be reasonably sure that it's the offset.

What stumps me is the number of entries:
There are 4436 offset and the same number in the bullshit64 table. There are 4675 entries in the bullshit128 table, but since I don't know what it is, that could easily be wrong and in any case it's reasonably close.

However... there are only 2911 filenames for these 4436 entries!?!

HansSchmucker's picture
Norman E. Carnage
Kickstarter Backer
Posts: 64
Submitted: Sat, 25/05/2013 - 17:38

About the bullshit64 table:

The last 32bit are just a counter, that much is clear.
Bytes 0x01-0x03 are almost always 62 9A 42. That 42 seems fixed, but the 62 9a sometimes turns into 9F A3, 66 9E, 81 A7, A0 A3, 0B 9E, 0B A5 or 9C 9A. The first byte appears to always be in the 0x20-0x2E range, except when bytes 0x01-0x03 are not 62 9A 42, and the entries appear to somehow be grouped by this.

Toshiba-3's picture
Velociraptor Fister
Community VIPKickstarter Backer
Posts: 1117
Submitted: Sat, 25/05/2013 - 20:13

There's already an unpacker for the WAD file and exporter for the cars and textures.
More infos: http://www.cwaboard.co.uk/viewtopic.php?f=10&t=9056
Programs: http://rr2000.toshiba-3.com/pc-files#rc

... and carmageddon add-ons at road reaction.

HansSchmucker's picture
Norman E. Carnage
Kickstarter Backer
Posts: 64
Submitted: Sat, 25/05/2013 - 21:31

Thanks a lot... can't believe I missed it. So, does repackaging work?

Toshiba-3's picture
Velociraptor Fister
Community VIPKickstarter Backer
Posts: 1117
Submitted: Sat, 25/05/2013 - 21:53

Well, I don't remember if it does :/
I think it might but then we'd get an error with the package signature. Something along those lines.
But maybe the game could simply work with the data unpackaged? (I do hope so for C:R at least)
I should try with their other games using the same technology.

... and carmageddon add-ons at road reaction.

HansSchmucker's picture
Norman E. Carnage
Kickstarter Backer
Posts: 64
Submitted: Sat, 25/05/2013 - 21:58

Doesn't seem too likely, since the file on Android is at a location where there should be no individual files (also, the WAD has an additional header), but I'll try. Maybe I'm lucky :)

HansSchmucker's picture
Norman E. Carnage
Kickstarter Backer
Posts: 64
Submitted: Sat, 25/05/2013 - 22:16

Didn't work... I'll try a few more paths. Toshiba-3, did you write or are you aware of any documentation for the carma WAD format? I'm still curious what I missed :)

Toshiba-3's picture
Velociraptor Fister
Community VIPKickstarter Backer
Posts: 1117
Submitted: Sat, 25/05/2013 - 22:29

I'm totally clueless about the new formats specs to be honest.
I only know the good old C1 and C2 ones ;)

Best I can do is link you to this I suppose: http://www.slightlymagic.net/forum/viewtopic.php?t=7341

... and carmageddon add-ons at road reaction.

HansSchmucker's picture
Norman E. Carnage
Kickstarter Backer
Posts: 64
Submitted: Sat, 25/05/2013 - 22:35

Thanks! The code at http://svn.gib.me/public/duels/trunk/Gibbed.Duels.FileFormats/Wad/ should contain what I'm looking for. Seems like the format can do more than I thought. I expected it to be uncompressed due to the RIFF headers, but apparently only SOME entries are uncompressed :)

Mr.Deviance's picture
Piledriver
Posts: 744
Submitted: Fri, 14/02/2014 - 15:18

Did you guys give up on this?
I tried to extract the obb file too today and I was met by failure.
I can't believe it's been this much since carma 1 came out for phones and nobody from this big community cared enough to actually get a definitive conclusion on this...
What good is carmageddon if it can't be modded after all these years?
As a fan of carmageddon since it came out, my fun with this game these days has a lot to do with modding rather than replaying the same old vanilla stuff over and over again like a broken record.
Why is it so fucking much to ask to be able to import custom made assets into the mobile version of this game?
Why must everthing that's new these days, have to suck and be locked the fuck down corporatist style?

Edited by: Mr.Deviance on Fri, 14/02/2014 - 15:25

Pages