[Release] S4 League Resource Files

12/12/2009 02:16 Asiro#1
Hello everyone,

I think nobody knows me, but I'm a member of the Underground here. Since I will resign from hacking S4, I want to make my hacks public to share with everyone. I stopped playing S4 League long ago, so I don't care much about S4League anymore.

What I want to share with you is the decryption of the S4League resource files. It is also used for decrypting the network traffic, but you have to figure that out yourself.

Ok, lets start with the resource.s4hd file. It contains the internal file names and the crc value of the decrypted/uncompressed file and it's compressed and encrypted by a key.

The key is
Code:
0x82, 0x53, 0x43, 0x4C, 0x2B, 0x0D, 0x37, 0xD7,
0xD9, 0xD8, 0x1B, 0x6D, 0xA0, 0xC3, 0x2B, 0xEE,
0x45, 0x88, 0x1A, 0xA6, 0x18, 0x1D, 0x9D, 0x38,
0x2A, 0x55, 0x03, 0x1D, 0xCD, 0xA6, 0x73, 0x07,
0xED, 0x8D, 0xC5, 0xDB, 0xA3, 0xBD, 0xB6, 0xD5
Only the first 32 values are used. They use the LZO compression library.

The filename in the _resources folder is the crc as hex value. The files are compressed and encrypted with the same key.

Files that end with .x4 are special. They are compressed and encrypted again, but with the whole 40 byte key above. X4 files contain many parameters of the game, like height of jump, gravity, prices for shop items and many more...

AFAIK, the CRC is not checked when reading the files from disk. The CRC is the CRC32 of the internal name and the CRC32 of the uncompressed/decrypted file. Both are encrypted with the key above. They really know how to reuse code. :D

I add the source code of a program to this post that contains the functions for decrypting the resource files. To prevent easy leaching, you have to figure out how to use it yourself. But I'm sure, someone will make a pretty filebrowser for this game. :D Oh, and you need the miniLZO files for compiling.

If you have an older installation of S4League that was patched several times, the clean resource function is very useful. It deletes all unused files from the _resources folder, which saved me 1.5 GB disk space.

Code like this has been around for months, so we already had our fun, now they can fix it. :D I bet they need around 2 months to fix it and everyone has to download the full game again. I give no support for this code and I will not fix it, when they change something. I'm out of the game.

Now the code:


Edit: Let me add the code as C#:


The GUI Software has been removed. DON'T ASK ME FOR IT! Thanks. Ask someone of the leechers, who already downloaded it. Or write it yourself.
12/12/2009 02:22 MrSm!th#2
very nice
i ll test it tomorrow

How did you find out that?^^

wth is minilzo???
12/12/2009 11:33 KS_Adonis#3
Quote:
Originally Posted by Asiro View Post
Hello everyone,




Files that end with .x4 are special. X4 files contain many parameters of the game, like height of jump, gravity, prices for shop items and many more...
Very Nice
12/12/2009 12:20 Adroxxx#4
#sticky

I don't think that the most people will know how to use it ;O
12/12/2009 12:48 KS_Adonis#5
Quote:
Originally Posted by Adroxxx View Post

I don't think that the most people will know how to use it ;O
Haha das denke ich auch.
12/12/2009 12:50 MrSm!th#6
Quote:
Originally Posted by Adroxxx View Post
#sticky

I don't think that the most people will know how to use it ;O
^this xD
But who cares?
This way not every leecher can use it^^
And I think so it wont be patched the next time...
12/12/2009 15:13 Mister Joy#7
Mein neuer PC hat windows.h garnicht << NAja bin grad am download der header libs danach mal testen ob ichs hinbekomme.:D
12/12/2009 15:52 MrSm!th#8
the files in the _ressources directory have no format O.o

just "Datei" (when there is no .*)

they are just called

1a0a8518135369d2 (without .x4 or something like this)

and they change their datas O.o

if you go in the folder, for 1 second there are other names than normal
and the KBs change too
very strange O.o
sure, that CRC is not checked when reading the files?
12/12/2009 16:52 KS_Adonis#9
Quote:
Originally Posted by MrSm!th View Post
the files in the _ressources directory have no format O.o

just "Datei" (when there is no .*)

they are just called

1a0a8518135369d2 (without .x4 or something like this)

and they change their datas O.o

if you go in the folder, for 1 second there are other names than normal
and the KBs change too
very strange O.o
sure, that CRC is not checked when reading the files?
Guck in dein S4 League Ordner und such nach dem Ordner shop da sind .x4 daten drin
12/12/2009 20:57 MrSm!th#10
Quote:
Originally Posted by Asiro View Post
The filename in the _resources folder is the crc as hex value. The files are compressed and encrypted with the same key.

Files that end with .x4 are special.


Quote:
Originally Posted by floydg View Post
Guck in dein S4 League Ordner und such nach dem Ordner shop da sind .x4 daten drin
couldn know it^^
so the ressources in the _ressources folder have no format? O.o
and why do they change their datas?

One question:

This code is for decrypting the ressources.
But what do you want to do when they are decrypted?
You cant open .x4 with Olly or a hex editor so how do you want to modifiy them???
Did you wrote your own engine or something like this?
12/13/2009 02:13 Asiro#11
Quote:
How did you find out that?^^
By looking into the S4League.exe file.

Quote:
wth is minilzo???
[Only registered and activated users can see links. Click Here To Register...]

Quote:
the files in the _ressources directory have no format O.o

just "Datei" (when there is no .*)

they are just called

1a0a8518135369d2 (without .x4 or something like this)
Let me answer this with an example:

Sure the files have no format. That's because the are encrypted! The name is the CRC of the file.

Now if I list the contents of resource.s4hd file, i get for example this file:

Code:
Filename: xml/game_tempos.x4
File-CRC: D534396923DC81F0
Real File-Size: 956
Unknown: 0
xml/game_tempos.x4 is the internal filename. Do you see the .x4 file ending?
That file is saved at the location _resources\D534396923DC81F0

And when you decrypt and decompress it, it contains the following data:


Music is stored as ogg, Textures are stored as jpg/dds, Scenes/Models are stored in an unknown format...

Quote:
sure, that CRC is not checked when reading the files?
Not 100%, but I didn't see them calculating the CRC after loading the file. But it's possible that I missed it somewhere.

Quote:
This code is for decrypting the ressources.
But what do you want to do when they are decrypted?
This code does not contain the functions to encrypt them again, but it is easy to reverse the decryption algorithm...
12/13/2009 02:21 69Shizume69#12
och da ist Asiro geil :D *winke* :D
12/13/2009 02:32 MrSm!th#13
Quote:
Originally Posted by Asiro View Post

This code does not contain the functions to encrypt them again, but it is easy to reverse the decryption algorithm...
i dont understand that O.o
did you mean decrypt by encrypt?^^
like this it doesnt make sense for me sorry xD

and i think you didnt understand me:

what will happen after decrypting the files?
what can you do with them without an engine for .x4 ressource files?
or did i understand something wrong?


edit:

if i understood you right you wanted to say that this code just encrypts and its easy to find the decryption with this.

but if this doesnt decrypt it why does the code say
Code:
DecryptUtils
???

now i m completely bedlam xD
maybe its too late for me to understand texts^^
12/13/2009 02:35 69Shizume69#14
Quote:
Originally Posted by MrSm!th View Post
i dont understand that O.o
did you mean decrypt by encrypt?^^
like this it doesnt make sense for me sorry xD

and i think you didnt understand me:

what will happen after decrypting the files?
what can you do with them without an engine for .x4 ressource files?
or did i understand something wrong?
ui ui ui da gabs mal n tollen hack von asiro :D

da konnte man decrypten usw und exportieren und importieren :D

war voll geil :D

vlt bekommst du am ende auch ne xml-datei :D

edit: da steht dass man texturen ändern kann ne?
geil das muss ich dann unbedingt lernen :D PinkFlash Mod YEAH :D
12/13/2009 02:40 MrSm!th#15
Quote:
Originally Posted by Topaseng View Post
ui ui ui da gabs mal n tollen hack von asiro :D 1

da konnte man decrypten usw und exportieren und importieren :D 2

war voll geil :D 3

vlt bekommst du am ende auch ne xml-datei :D 4

edit: da steht dass man texturen ändern kann ne?
geil das muss ich dann unbedingt lernen :D 5 PinkFlash Mod YEAH :D 6
xDDD

Joa das wäre schon lustig.
Ich kann mir bei failaplaya auch vorstellen, dass es durch diese ressources auch möglich wäre ein ps für 1 PEN zu kaufen...
wo gabs denn diesen "hack"?