Jump to content

Question: Esm file binary parsing. Decompressing record data.


Recommended Posts

UPDATE:

 

ISSUE IS CLOSED.

 

It was a bug in my decompressing (deflating) code.

 

-----------------------------------------

 

 

I am developing a small c++ esm parsing tool for myself and stuck on decompressing compressed records.

 

header - header of record (contains record signature, size, flags etc).

data - data containing subrecords, following header.

 

Steps I am taking:

1. Read record header.

2. Check compressed flag.

3. if compressed, read first 4 bytes (int) of data for uncompressed data size.

4. Decompress (zlib) data, spiking first 4 bytes (from step 3) .

 

Some records are decompressed correctly, but some records have uncompressed data size (from step 3) that does not make any sense.

 

For example: LAND (formId 00063B0B) has data size 201 byte, but uncompressed data size (4 bytes of data, from step 3) is 4385 bytes (hex 21 11 00 00). Please see attached HxD screenshot.

 

Question: how do I decompress those kids of records? Where should I read correct decompressed data size from?

 

Any help will be appreciated.

 

 

 

Edit:

attached decompressed data output screenshot.

Edited by Guest
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...