NotAdam / Lumina

A simple, performant and extensible framework for interacting with FFXIV game data
Do What The F*ck You Want To Public License
88 stars 54 forks source link

Some LGB files are parsed incorrectly and fail #3

Open ff-meli opened 4 years ago

ff-meli commented 4 years ago

There seem to be multiple different issues, but I only have details on one so far.

A number of planner.lgb files have a chunk header that is seemingly different from others, and will parse incorrectly and throw an OOM exception due to an invalid layer count being read from the chunk header.

One example of this is bg/ffxiv/wil_w1/twn/w1t1/level/planner.lgb

In that particular file, it appears that the actual chunk header (the 'LGP1' magic) starts at byte 32, instead of byte 12 as the code assumes. Byte 12 is a 0x1, followed by all 0s until byte 32, so I'm not sure what if anything might ever go there.

Unfortunately, the general structure still seems wrong even accounting for the unexplained 20 bytes (ie, reading the header from where LGP1 is found will still result in incorrect data for at least some fields)

This doesn't occur with every planner file, but it does happen with a number of them.

NotAdam commented 4 years ago

I'm not totally across what the difference between the two files are, but last time I checked it'd pretty much require those files in particular to be handled separately which is pretty annoying.

Is there something in particular that you need from planner files or?

ff-meli commented 4 years ago

I don't personally have a use for this, it was just something I came across while trying to track down the issues Miu was having.

It sounded later like he probably doesn't actually need planner files either, since they don't seem to have much in them, so this can probably just be ignored, or those files skipped etc.

takhlaq commented 4 years ago

fixed in https://github.com/NotAdam/Lumina/pull/4

NotAdam commented 4 years ago

Left it open for now because I want to actually look at what the LGP shit actually is at some point