ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sun Oct 21, 2018 4:17 am

All times are UTC




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Master X Master (*.PAK)
PostPosted: Wed Nov 12, 2014 3:03 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 765
Download: Part 1, Part 2

What wee know. File encrypted by AES + XOR. AES used only for initialize main key. Data is XORing by key initialized from AES.

AES Main key: \x22\xE0\xF3\x80\x7D\xD0\x65\xA5\xD7\x9E\xA6\x26\xD2\x74\x06\x9A

For example
XOR Key for offset 0x8 with size 0x10 - \x8D\x28\x60\xEC\x3F\x5C\xD9\x0F\x6B\x10\x33\xFD\xB7\x0A\x68\x25
XOR Key for offset 0x18 with size 0x4 - \xBD\xD5\xB5\xAB\x63\x91\xF9\xED\x6B\x13\x65\xD0\xB0\xD0\xDD\x25

Now I'm trying to understand - how the key are updated from AES? addRoundKey? Any ideas ? :?


Top
   
PostPosted: Wed Nov 12, 2014 8:42 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9070
Are you sure it's not aes with ivec?
If ivec is set to zero you can use just: encryption aes_128_cbc "\x22\xE0\xF3\x80\x7D\xD0\x65\xA5\xD7\x9E\xA6\x26\xD2\x74\x06\x9A"


Top
   
PostPosted: Wed Nov 12, 2014 9:19 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 765
Encryption is XOR by key initialized from AES (Set_Key / Decrypt_Key)


Top
   
PostPosted: Sat Nov 22, 2014 5:27 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 765
Code:
struct PAKHeader
{
   DWORD   dwID; //PAKA
   WORD    w_MinorVersion; // 2
   WORD    w_MajorVersion; // 1
   DWORD   dwHeaderSize; // 0x24 (36)
   DWORD   dwDataOffset; // 0x400 (1024)
   DWORD   dwTableSize; // 0x2A (42) -> For some manipulations with data -> ADD ECX,0x880 = 0x000008AA (2218)
   DWORD   dwNull1;
   DWORD   dwTotalFiles; // ???
   DWORD   dwUnknown; // ??? = 0x00000100 (65536)
   DWORD   dwNull2;
};


~Using. Read header into buffer.

Code:
    mxm_update_key(p_MasterKey, (int)&p_Final_Key);
    for (int i = 8; i < 24; ++i )
    {
       pHeaderBuffer[i] ^= p_Final_Key[i];
    }

    mxm_update_key(p_MasterKey, (int)&p_Final_Key);
    for (int i = 24; i < 36; ++i )
    {
       pHeaderBuffer[i] ^= p_Final_Key[i];
    }


I attached function for updating key. Somebody can help?


Attachments:
PakUpdateKey.rar [5.03 KiB]
Downloaded 113 times
Top
   
PostPosted: Sun Nov 23, 2014 8:52 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9070
I have attached a modified code that is probably more similar to the final code.
There was a missing field that is the amount of cycles to make.
Hope it helps.

In the script I used 80 but it's only the maximum amount of cycles, it's not the correct one.
I also tried to scan them but without good results.


Attachments:
test.zip [14.44 KiB]
Downloaded 165 times
Top
   
PostPosted: Wed Sep 19, 2018 12:45 am 

Joined: Wed Sep 19, 2018 12:06 am
Posts: 1
Is it possible to have an other look at the game archives to unpack them? Now that the game is dead the community would be very happy if they could rip some of the files.
I have uploaded the Chinese version: https://archive.org/details/MasterXMasterTencent and the NCWest version: https://archive.org/details/MasterXMaster.
The Chinese version of 2015 is the oldest complete working version we got from the game, this version doesn't encrypt it's log not by default, to deactivate encryption of the log files on other versions use the /LogEncryption:0 launch argument.
Also the 2015 patches can't be used on the 2015 full client because the version difference between them is to big (7 months between releases) but it could be interesting to compare them maybe.

P.s. If one of you still got a version of the game (even if it's incomplete) that is not on archive.org like the 2014 Korean one please send it to me, so that I can archive it for the community.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited