Code Monkey home page Code Monkey logo

dark-chronicle-reverse-engineering's Introduction

Dark Chronicle Reverse Engineering

Dark Chronicle / Dark Cloud reverse engineering stuff

Most of the work has been done using an original Dark Chronicle PAL PS2 CD

Data HD file specification

The game uses an archive format to store its main files, the format is very similar among the two games Dark Cloud and Dark Chronicle (Dark Cloud 2)

The archive is split into chunks of 2048 bytes each, a file start from a chunk and the next file is offset to align itself to the next chunk location.

Chunk Diagram

The data.hd file contains the name, offset and length of each file in the archive.

data.hd2

From Dark Cloud:

struct DATAHD2 {
    // the position of the null terminated string on the current file
    int fileNameOffset;
    int unused0; // padding for future uses
    int unused1; // padding for future uses
    int unused2; // padding for future uses
    // the file offset from the beginning of the archive
    int fileOffset;
    // the file size, in bytes
    int fileLength;
    // the chunk index at which the file starts, chunkOffset * 2048 gives you fileOffset
    int chunkOffset;
    // the number of chunks the file span across
    int chunkCount;
};

The file name is a null \0 terminated string.

All files that contains invalid ASCII characters are empty, it is likely caused by the developers not deleting some temporary files properly before packing the game.

The game has been created using Windows, Level 5 is a japanese company, therefore the default CodePage used on japanese windows computer is Shift_JIS, this is also the encoding for most text-based game files.

Code page 932 Shift_JIS is the appropriated encoding when dealing with text based game files.

Data HD

data.hd3

From Dark Chronicle:

In Dark Chronicle, Level 5 have settled down to the archive format, therefore redundant fields has been removed.

struct DATAHD3 {
    // the position of the null terminated string on the current file
    int fileNameOffset;
    // the file size, in bytes
    int fileLength;
    // the chunk index at which the file starts, chunkOffset * 2048 gives you fileOffset
    int chunkOffset;
    // the number of chunks the file span across
    int chunkCount;
};

The fileOffset has been removed, chunkOffset * 2048 gives you the file offset.

The unused fields have also been removed.

data.hd4

struct DATAHD4 {
    // the position of the null terminated string on the current file
    int fileNameOffset;
    // the file size, in bytes
    int fileLength;
    // the chunk index at which the file starts, chunkOffset * 2048 gives you fileOffset
    int chunkOffset;
};

Dark Chronicle contains a data.hd4 which removes the chunkCount, you can calculate the number of chunks by dividing the fileLength by 2048.

This archive format appear to be unused, it saves (4 * 8752) + 4 bytes.

There are 8752 files in the archive (one is duplicated), + 4 for what appear to be padding.

data.hd3 file size is 354912 bytes data.hd4 file size is 319900 bytes

35012 bytes are saved in the process.

Duplicate Files

The file wep_t\ws050_item.chr is the last file of the data.hd3 archive and appear to be duplicate for unknown reasons. The two duplicated files are binary identical, it is likely that the software used by Level 5 to pack the files may have contained a bug that write the last file twice.

It is unknown if the game actually load the second or the first file.

As a side note, incase the game would actually load the second file it would be possible to write mods that do not rewrite the file entirely, but merely append some content at the end thus it will not be too hard to create a fast mod repacker.

Never Ending Adventure

The scans folder contains hi resolution scan of the italian game cover, for preservation and reconstruction purposes.

The original font cover:

Original Front Cover

The original CD:

Original CD

Cheat Engine Table

The cheat engine table is mostly in italian as it's very old, I'v recently just updated it for PCSX2 1.7 pcsx2-avx2.exe.

It have some very useful features, for example:

  • Debug Menu, see: The Cutting Room Floor: Debug Menu
  • Character Position
  • Aquarium, you can make the fish to always eat!
  • Camera, take a picture of something useless, you can swap it for a photo idea at any moment!
  • Invention List, add any invention you want, in any order!
  • Weapons, id and flags have the proper menu!

Cheat Table

ISO Explorer

DarkChronicle.NET

The program allows you to see all the files in the ISO of the game, there are some shortcut and a filter so you can very quickly found anything!

dark-chronicle-reverse-engineering's People

Contributors

lucacicada avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.