Jump to content

Chunk0.arc File Breakdown/ Research


HanleysFramer

Recommended Posts

                   To preface this breakdown, the Chunk0 file can be split up into four different sections. I will go in-depth on each section further below. I'll refer to each section as Chunks 1-4 to differentiate. I’ve provided links to the full Chunk0.arc from the latest patch below as well as each individual section. Be mindful that the entire file is written in Big Endian format.

                 For this write-up, I will focus on HSPC type PACs. Although, both EPK8 and HSPC work on the Chunk0 file.

 

                                                                                                                              HEADER (0x0)

                 The Chunk0 header lists out the start and end of each chunk section. The image below may provide better detail:

                                                    1.png

                                                                                                                                               Chunk1 (0x2C)

                  The first Chunk section contains basic ID’s for each pac. These ID’s differentiate each pac from one another by identifying the specific directory the file belongs to. For example, in EPK8 PACs for characters, we know this as the EMD/000XXXXX portion of the file (as can be shown in the image below).

                        2.png

                   In HSPC PACs, these ID’s can be found at the 0x800 offset (also shown in the image below). These are seemingly hashed by some unknown algorithm but identify files the same way EPK8 PACs do.

                                                                                    1234.png

                         In the Chunk1 section, each file in the list consists of 0x14 bytes. The first 0x8 bytes are the aforementioned directory ID. The next eight identify the chunk offsets for “CH10002” in the next two sections. Each listing ends with FF FF FF FF.

 

                                                                                5.png

                                                                                                         Chunk2 (0xC2848)

                  The Chunk2 section also contains a seperate ID for each PAC. This second ID can be found at the 0x10 offset in every HSPC pac.

                                         Capture.PNG

                  In this example, the ID is BE 21 09 23 for PAC file “CH10002”. Each file in the Chunk2 list consists of 0xC bytes. The first 0x4 bytes are the PAC ID. The next 0x4 are the Chunk4 offset for CH10002. The last four bytes are always DA 07 00 00.

                                                     4.png

                                                                                                      Chunk3 (0x105244)

                  The Chunk3 section of the file appears to be a simple copy of the 0xC bytes found at the 0x1000 offset of every HSPC pac. These are the 0xC bytes for CH10002.    

                                                                    Capture.PNG

                                                                      8.png

                                                                                                                               Chunk4 (0x15D8DDE3)

                      The Chunk4 section consists of a straightforward list of the PAC filenames. The offset of each pac file is pointed to by the Chunk2 section.

                                                                         09.png

                                                                          CHUNK SECTIONS: https://www.mediafire.com/file/0clr26xfh4ucld4/chunk_sections.zip/file

                                                                         

                                                                                                                                Adding to the Chunk0.arc

                                   Lastly, I'll briefly run down adding to the Chunk0.arc. If you wanted to add a new PAC to the chunk0, you would need to know the eight byte and four byte ID's we can find on HSPC pac's. Since these are hashed via some unknown algorithm, this would be rather tricky. However, if you've ever started the game without a Chunk0 file, you would know there is a 5-10 minute initial load time. This is the game caching and creating a new Chunk0 file.This file will reside in the game's memory. Although it's not formatted exactly as the original chunk0 is, we can find the eight byte and four byte ID's by simply doing a HEX search on Cheat Engine once the game is open. Add any eight byte ID that we know already exists in the game and you will find the memory region the new chunk0 is saved to. This region contains all the sections we've covered before. 

                (CH10102 in the game's memory:)  Capture.PNG

                                     I would save the region once before you add a file and once after. Comparing these sections before and after will reveal there are newly added ID's. There are some HEX editors that can compare two files and highlight the differences. I would recommend using one of those editors to find the different bytes which would reveal the ID's you'd need to add.

 

                                Once you've found your new PAC's ID's, simply input those into a new listing in each chunk section using the formats i've covered above. You would also need to update the header to cover the right offsets. I've successfully added before but it is admittedly a rather tricky process.

                              Reversing the hashing algorithm would be much preferable but it has been admittedly been quite a process for me, however, hopefully putting this info out there can get someone with the proper know how to fully reverse the algorithm. 

 

                                                                 I'm not very good at write ups or anything but I hope this helps someone looking for some info ✌.

                   

 

 

Edited by HanleysFramer
  • Like 3
  • Glorious 1
Link to comment
Share on other sites

Thank you for sharing your knowledge with us @HanleysFramer!

Hopefully someone can use this information to reverse-engineer the hex algorithm used.

Some additional info regarding chunk section 3:

Offset 0x1000 in a HSPC PAC file usually points to the file data section in this file.

03 00 00 00 0F 32 00 00 00 00 0C 00

--

03 * ALIGNMENT* = 0x1800 -> Offset 0x1800 is the beginning of the PAC file content

*(Alignment is 0x800, which is defined in the HSPC header section)

0F 32 00 00 * 0x100 = Size of this content

So it seems like section 3 is an information that tells the game where the (HSPC) data section starts and what size that section is.

I'm not sure what this 00 00 0C 00 is, maybe it's the section length, which is 0xC.

BE 21 09 23 in chunk section 2 seems to be some sort of CRC.

Edited by TheVisitorX
Link to comment
Share on other sites

  • 1 year later...

Update on this since I forgot to post here.


https://www.mediafire.com/file/mes50ak9sqpjjgq/chunk0_gen.zip/file

This is a sort of chunk generator. It works by capturing the chunk0.arc the game generates when it loads. The catch is you have to recapture everytime you modify or add a file. If you want to recapture, you have delete the existing chunk0.arc in your game directory and follow the process below.

(The .exe is set up to only work on the latest patch of WWE 2k19 so ensure your version is up to date as well as that the WWELive updates are downloaded.)


The steps to using this are as follows:

(Make sure your def is rebuilt using CCT in full mode. Using anything else causes some issues.)

1. Load up your game with no chunk01.arc in the game directory.

2. At the "Press Start" screen, click on chunk0grabber.exe. If it dumped successfully, a chunk_extract.bin should appear in your folder.

3.Run chunk0_gen.py in the same folder as chunk_extract.bin. This should output your Chunk01.arc

4.Copy and paste the generated arc into your game folder. Done.

You need python installed to run the .py of course. If all goes fine, I might rewrite it so it's just one exe file.

 

 

Edited by HanleysFramer
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...