HaoJun0823 / GECV

5 stars 0 forks source link

How to Define End Blocks #22

Closed DarkGD123 closed 6 months ago

DarkGD123 commented 6 months ago

considering how hard it is to identify end blocks for PRES (old to newer variants, BLZ (version 2 and 4), and some other formats, can you at least give some small ideas?

nachotacos69 commented 6 months ago

this is kind of interesting. although to define end blocks, its usually on some kind of null strings or bull bytes whatever you call it

HaoJun0823 commented 6 months ago

What is an "end block"?

nachotacos69 commented 6 months ago

i think what he meant is something related to where a file stops, like end offset or something like null strings?

take this RIFF AT3 as an example from PATCH.EDAT:

https://github.com/HaoJun0823/GECV/assets/99103531/93fdd497-7ecd-4b8d-9500-2e5db7d0158f

HaoJun0823 commented 6 months ago

i think what he meant is something related to where a file stops, like end offset or something like null strings?

take this RIFF AT3 as an example from PATCH.EDAT:

  • i copied a start offset hex and go to that specific part where AT3 is located
  • i copied another offset of AT3 which is the end offsets or whatever you call it
  • where it stops containing data is somewhere around the null strings 00

    start.to.end.mp4

I still don't understand what you guys are talking about.

Most of the data in the game is aligned according to 16 bytes, and if it is less than 16 bytes, it will be aligned with zeros.

11 This process has been described.

RDP resources will be indexed by pres, We found that some RDPs are aligned at 0x800.

nachotacos69 commented 6 months ago

ah i see.. maybe i did something a bit bad, so yeah, thanks for clarification

nachotacos69 commented 6 months ago

i usually just think that where the file actually stops at \00, like since there's multiple blz2 or 4 headers i usually go copy the header + data/chunks + and end the copying when i encounter a few consecutives of \00 well atleast from what i can understand on C# stuff but yeah. maybe im just guessing haha

DarkGD123 commented 6 months ago

ahh i see, thanks for the clarification @HaoJun0823, also is there any documentation for the PRES? (older variants instead of the PC version)

HaoJun0823 commented 6 months ago

ahh i see, thanks for the clarification @HaoJun0823, also is there any documentation for the PRES? (older variants instead of the PC version)

Again, we've been focused on PC from beginning to end, so we don't know the structure of other platforms.

PRES has not changed much, the PC only has six more country data segments. If you can understand PC, you can also understand other platforms.

DarkGD123 commented 6 months ago

ahh, okay then 😄

HaoJun0823 commented 6 months ago

i usually just think that where the file actually stops at \00, like since there's multiple blz2 or 4 headers i usually go copy the header + data/chunks + and end the copying when i encounter a few consecutives of \00 well atleast from what i can understand on C# stuff but yeah. maybe im just guessing haha

In PRES, all files are indexed, and the file size is recorded in the index.

The game will read these files in 16-byte sizes until the end of the file. Therefore, files that are not long enough need to be supplemented with 00 to align to 16 bytes.

Adding 00 will not destroy the file structure. PRES and TR2 are strong indexes. BNSF, IS14, and GNF (PC) have their own header information.

BLZ also ends when it reads 00, because the next data block size is 0.

nachotacos69 commented 6 months ago

ahh, i see. thank you then 🎊