Awesomenauts (PC version)

Textures, recreate headers, conversions, algorithms and parsing of image files
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Awesomenauts (PC version)

Post by puggsoy »

So the game Awesomenauts has some really weird compression for its graphics. I found this thread on XeNTaX a while ago, where Ekey seems to have figured out. However, the code he provided to generate the key and IV to decrypt it with makes absolutely no sense to me, so I can't generate them myself.

The actual decrypting and decompression shouldn't be much of an issue for me, it's simply the key and IV generation. I would be much, much obliged if someone could help me out on this front, maybe just giving a simpler depiction or explanation of the algorithms.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Awesomenauts (PC version)

Post by aluigi »

It's written that the initializer value for Generate_Key_IV is the size of the file.
The following is the Generate_Key_IV function translated in C, but I have not tested it:

Code: Select all

uint32_t Generate_Key_IV(uint64_t *n) {
    uint32_t    a, b;

    a = *n;
    a = ((a & 0xffff) * 0x9069) + (a >> 0x10);

    b = *n >> 32;
    b = ((b & 0xffff) * 0x4650) + (b >> 0x10);

    *n = (uint64_t)a | ((uint64_t)b << (uint64_t)32);

    if(a == 0) a = 1;
    if(b == 0) b = -1;
    return (a << 0x10) + b;
}
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Awesomenauts (PC version)

Post by puggsoy »

Hmm. I tried translating this to Haxe (the programming language I use), which is more or less the same except it doesn't use pointers and all integers are 32-bit by default.

When I tried setting n to the Manifest.dat filesize (0xB810), the function returned 0xB11DE500. Not only does this seem incorrect (looking at the results for Manifest.dat in the XeNTaX thread) but how would I differentiate between calculating the key and calculating the IV?

I've attached the files Ekey tested with.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Awesomenauts (PC version)

Post by aluigi »

In my opinion there is some information missing in this "puzzle"
Better waiting an answer from Ekey (he is on this forum).
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Awesomenauts (PC version)

Post by puggsoy »

I hope bumping is allowed, just in case Ekey may have missed this. I would highly appreciate any input from him.