the cutting room mirror

Grand Theft Auto: Chinatown Wars (Nintendo DS)

This article has a talk page!This article has a talk page!
view on tcrf.net

Grand Theft Auto: Chinatown Wars brings the series to the Nintendo DS with a story involving Triads in Liberty City. While not the first game in the series for a Nintendo system, it was a major one, though a PSP port followed just a few months later.

Symbol Table#

Found only in the European version is a file, gtads-map.bin, which contains a symbol table with the name of every function, their address locations and which overlays each one is stored in. This also includes the function names for the game's libraries.

The following is a imhex pattern to decode the contents of this file:

#include <std/core.pat>
#include <std/string.pat>

struct Header {
    u32 sectionCount;
    u32 stringTableOffset;
    u32 symbolCounts[sectionCount];
};
Header header @ 0x00;

fn string_base(u128 offset) {
    return 0x08 + header.stringTableOffset;
};

struct Symbol {
    u32 address;
    u32 size;
    std::string::NullString *name : u32 [[pointer_base("string_base")]];
};

struct Section {
    Symbol symbols[header.symbolCounts[std::core::array_index()]];
};
Section sections[header.sectionCount] @ sizeof(header);