User Tools

Site Tools


cxdf-format

About

cxdf (compact cross differentiation format) was developed for JuraviS in order to streamline a compact and effective format for modifying game files based on their original counterparts. This format aims to give an alternative to including copyrighted data into patch files.

Structure

All values are stored in Little-Endian.

  1. Identifier [2 bytes]
    • String J5 or [0x4A,0x35]
  2. Version [1 byte]
    • Current Version: 0x01
  3. Settings [1 byte]
    • 00001000: Resize on filesize mismatch
    • 00000111: New filesize byte count
  4. Filesize [0-7 bytes, unsigned]
  5. Patch Instructions [varies, multiple]

Patch Instructions

  1. Header [1 byte]
    • 11110000: Instruction ID
    • 00001000:
      • 0 = Seek (absolute jump to offset)
      • 1 = Hop (relative jump from current offset)
    • 00000111: Seek/Hop offset byte count
  2. Seek/Hop Offset [0-7 bytes, unsigned]
  3. Instruction Data [varies]

Instruction Data

0x0 Write Byte

Writes a single byte with the given value to the current offset of the modification buffer.

  1. Byte Value [1 byte]

0x2 Repeat Byte

Writes a single byte repeating for a given length to the current offset of the modification buffer.

  1. Repeat count [1 byte, unsigned]
    • 1-256
  2. Byte Value [1 byte]

0x3 Repeat Byte (long)

Same as above; long version;

  1. Repeat count [2 bytes, unsigned]
    • 1-65536
  2. Byte Value [1 byte]

0x4 Write Buffer

Writes a buffer of bytes to the current offset of the modification buffer.

  1. Buffer length [1 byte, unsigned]
    • 1-256
  2. Buffer [1-256 bytes]

0x5 Write Buffer (long)

Same as above; long version;

  1. Buffer length [2 bytes, unsigned]
    • 1-65536
  2. Buffer [1-65536 bytes]

0x6 Repeat Buffer

Writes a buffer of bytes repeating a number of times to the current offset of the modification buffer.

  1. Repeat count [1 byte, unsigned]
    • 1-256
  2. Buffer length [1 byte, unsigned]
    • 1-256
  3. Buffer [1-256 bytes]

0x7 Repeat Buffer (long)

Same as above; long version;

  1. Repeat count [2 bytes, unsigned]
    • 1-65536
  2. Buffer length [1 byte, unsigned]
    • 1-256
  3. Buffer [1-256 bytes]

0x8 Copy Vanilla Range

Copies a buffer of bytes from the unmodified buffer back to the current position in the modification buffer.

  1. Parameters
    • 10000000:
      • 0 = Absolute Offset (unsigned)
      • 1 = Relative Offset (signed)
    • 00111000: Offset byte size
    • 00000111: Copy length byte size
  2. Offset [0-7 bytes, unsigned or signed, see first parameter]
  3. Copy length [0-7 bytes, unsigned]
    • Read value is +1 (examples: 0x00 → 1, 0xFF → 256)
cxdf-format.txt · Last modified: 2021/05/24 15:01 by xifanie