UKADOC Project
Overview

This is the specification for update definition files used by the ghost update system (network update).
Update definition files contain a list of the files that make up a ghost and their hash values. The baseware retrieves the file from the server, compares it with local files, and performs a differential update.

There are currently two valid formats. The legacy format, updates.dau (Version 1), has been deprecated and is omitted.

updates2.dau (Version 2)
A binary-oriented format delimited by byte value 1.
updates.txt (Version 3)
A text format delimited by byte value 1, with line prefixes.

updates2.dau (Version 2)

This format uses byte value 1 as the field delimiter and terminates each line with CRLF.

Character encoding
The default is the OS default charset. It can be specified by appending a charset=文字コード名 field to the end of the first entry.
Line format

Each line has the following format.

ファイルパス\x01MD5ハッシュ\x01拡張フィールド1\x01拡張フィールド2\x01...

\x01 indicates byte value 1. Lines end with CRLF.

Example

ghost/master/descript.txt\x01a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\x01size=1234\x01date=2024-01-15T12:34:56\x01charset=Shift_JIS\x01
ghost/master/shiori.dll\x01f6e5d4c3b2a1f6e5d4c3b2a1f6e5d4c3\x01size=65536\x01date=2024-01-15T12:34:56\x01
shell/master/surface0.png\x01deadbeefdeadbeefdeadbeefdeadbeef\x01size=32768\x01date=2024-01-15T12:34:56\x01

※ \x01 is actually byte value 1. charset= is appended only to the end of the first entry.

updates.txt (Version 3)

Like updates2.dau, this format uses byte value 1 as the delimiter, but is a text format in which each line has a line-type prefix.

Line type

The type of each line is determined by its prefix. Lines that are neither file, nor charset, are ignored.

charset,character encoding name
Specifies the character encoding for subsequent lines. Write this near the beginning of the file.
file,data...
The content following the file, prefix uses the same format as updates2.dau.

Example

charset,Shift_JIS
file,ghost/master/descript.txt\x01a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\x01size=1234\x01date=2024-01-15T12:34:56\x01
file,ghost/master/shiori.dll\x01f6e5d4c3b2a1f6e5d4c3b2a1f6e5d4c3\x01size=65536\x01date=2024-01-15T12:34:56\x01
file,shell/master/surface0.png\x01deadbeefdeadbeefdeadbeefdeadbeef\x01size=32768\x01date=2024-01-15T12:34:56\x01

※ \x01 is actually byte value 1.

Field details

These are the field definitions common to the file, lines in updates2.dau and updates.txt.

Required fields
  • File path (position [0]): Relative path to the file to be updated. Uses forward slashes (/) as separators.
  • MD5 hash (position [1]): MD5 hash of the file contents. A 32-character hexadecimal string.
Extension fields (position [2] and later)

Written in key=value format. All are optional.

  • size=number: File size in bytes.
  • date=string: Date and time string in ISO 8601 format. Example: 2024-01-15T12:34:56
  • charset=string: Charset name. Appended only to the end of the first entry in updates2.dau. Used only to determine the charset; ignored when loading the file as a definition file.
Path Handling
URL encoding
If all entries are percent-encoded, they are decoded before use. Otherwise, only the URL side is encoded.
Security checks

Entries that meet any of the following conditions are treated as invalid.

  • No MD5.
  • Ends in / or \ (directory entry).
  • Contains ..\ or ../ (to prevent directory traversal).
Generation process

updates2.dau / updates.txt can be generated from a ghost's file list using SSP's "Create update files" feature and similar tools.

File scanning

Recursively scans directories. The following files are excluded.

  • Hidden files (FILE_ATTRIBUTE_HIDDEN)
  • Files specified by noupdate in developer_options.txt
  • Files excluded by .gitignore-format filter files
Copying to ghost\master
If a ghost\master folder exists directly under the directory, the generated update files are also copied there.