Generic Archive (*.agt)

Summary

The primary archive format. This is practically a zip, but with a custom format. This file format has remained the same from the earliest known version.

These files are always "encrypted", see Encryption.

Encryption

Almost the entire file is encrypted with a simple repeating XOR cipher. This cipher is hardcoded into the client and has remained the same from the earliest known version.

The very beginning of the file, the header, is plain. After that, from byte 0x20, the rest of the file is encrypted. Even though the encrypted section starts at 0x20, the offset into the cipher is absolute (also starts at 0x20).

Structure

These are the building blocks this archive format is built on. The offsets are relative to the beginning of the structure, not the file.

OffsetTypeNotes
0x00char[8]always "NayaPack"
0x08uint32always 0
0x0Cuint16always 1
0x0Euint16always 1
0x10uint32File Count
0x14uint32[3]always 0

File Info

OffsetTypeNotes
0x00uint32Compressed Chunks Position
0x04uint32Compressed Chunk Count
0x08uint32Decompressed Length
0x0Cuint32File Path Length
0x10char[File Path Length]File Path

File Contents

OffsetTypeNotes
0x00uint16[Compressed Chunk Count]Compressed Chunk Length
n/auint8[Compressed Chunk Length]Compressed Chunk Data (zlib deflate)

Locations

Based on 0.02TW as an example:

  • Data_TW.agt
  • Data\decal.agt
  • Data\effects.agt
  • Data\game.agt
  • Data\Init.agt
  • Data\Localize.agt
  • Data\Option.agt
  • Data\vehicles.agt
  • Data\World\autoshop.agt
  • Data\World\cras.agt
  • Data\World\data.agt
  • Data\World\garage.agt
  • Data\World\koinonia.agt
  • Data\World\moonpalace.agt
  • Data\World\oros.agt
  • Data\World\parkinglot.agt
  • Patch\Patch.000
  • Patch\Patch.001
  • Patch\Patch.002
  • Patch\Patch.003
  • Patch\Patch.004
  • Patch\Patch.005
  • Patch\Patch.006
  • Patch\Patch.007
  • Patch\Patch.008
  • Patch\Patch.009
  • Patch\Patch.010