Skip to content

yinchuan/LSReader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LS Archive Reader

This repository contains code to read files within an archive format called LS. This format is used by KOEI in the game Sangokushi Sōsōden and potentially other games, though I don't have access to verify this.

Dependency

spdlog is used for logging. googletest is used for test.

Credit

This archive format and the decompression algorithm is first reverse-engineered by van from a Chinese game forum. Maxwell from the same forum explained the algorithm in detail. Please note both links are to posts in Chinese language. Functions getBits, getCode, and decode are originally written by van.

Archive Format

The LS archive format supports both compressed and uncompressed data. The file structure consists of four parts:

1. Format Identifier:

  • The first 16 bytes of the file.
  • Possible values: "Ls11" or "Ls12".

2. Compression Dictionary:

  • The next 256 bytes.
  • Used for decompressing data.

3. File Size Information:

  • A group of 12-byte entries, each providing size information for embedded files.
  • Each entry consists of:
    • 4 bytes for the compressed size.
    • 4 bytes for the original size.
    • 4 bytes for the offset of the file data within the archive.
  • This section ends with 4 bytes of 0.

4. Included Files Data Section:

  • Contains the actual data of the files included in the archive.

test_data/Logo_p.e5

This file is a valid LS archive. It has four files of which two are compressed.

About

a library to read LS archive

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published