Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

[PC] Swedish Touring Car Championship 2 .dta .pdo .pdw

Featured Replies

Solved by NeoGT404

  • Localization

The format is something like this:

// HEADER
  4 - Header (PDI1)
  4 - Number Of Files (including Padding files)
  4 - Number Of Files
  4 - Unknown (30)
  4 - Directory Offset (46)
  4 - CDI1 Data Offset
  4 - Length Of CDI1 Data
  2 - null
  14 - Padding (all 255's)
  2 - Unknown (3)

// DETAILS DIRECTORY
  // for each file (68-bytes per entry)
    2 - File/Directory ID (4=directory, 24=uncompressed file, 25=Compressed file, 0=padding file)
  
    if (file){
      2 - File ID (incremental from -1)(some are -1, which skip over the number for this loop)
      2 - File ID (incremental from 1)(some are -1, which skip over the number for this loop)
      6 - Unknown (all 255's)
      4 - File Offset (relative to the start of the file data)
      4 - File Length
      44 - Filename (null terminated, filled with nulls)
      4 - Unknown
      }
    else if (directory){
      2 - File ID (incremental from -1)(some are -1, which skip over the number for this loop)
      2 - File ID (-1)
      4 - Unknown
      4 - Unknown
      6 - null
      44 - Directory Name (null terminated, filled with nulls)
      4 - null
      }
    else if (padding file){
      66 - null
      }
    
// FILE DATA
  // for each file
    4 - CDI1 Header (CDI1)
    4 - Decompressed File Length
    4 - Flags (16=TEA Encryption, 17=TEA Encryption and Compression)
    X - File Data

Files can be encrypted with the TEA algorithm, with Key = THEEVENTHORIZONS

Files can also be compressed, but not currently sure what the compresison algorithm is. From looking at the TXT files in the archive, it looks like you need to decrypt the file first, and then it looks like the compression might be RLE-based?

  • Author
  • Localization
2 hours ago, wattostudios said:

The format is something like this:

// HEADER
  4 - Header (PDI1)
  4 - Number Of Files (including Padding files)
  4 - Number Of Files
  4 - Unknown (30)
  4 - Directory Offset (46)
  4 - CDI1 Data Offset
  4 - Length Of CDI1 Data
  2 - null
  14 - Padding (all 255's)
  2 - Unknown (3)

// DETAILS DIRECTORY
  // for each file (68-bytes per entry)
    2 - File/Directory ID (4=directory, 24=uncompressed file, 25=Compressed file, 0=padding file)
  
    if (file){
      2 - File ID (incremental from -1)(some are -1, which skip over the number for this loop)
      2 - File ID (incremental from 1)(some are -1, which skip over the number for this loop)
      6 - Unknown (all 255's)
      4 - File Offset (relative to the start of the file data)
      4 - File Length
      44 - Filename (null terminated, filled with nulls)
      4 - Unknown
      }
    else if (directory){
      2 - File ID (incremental from -1)(some are -1, which skip over the number for this loop)
      2 - File ID (-1)
      4 - Unknown
      4 - Unknown
      6 - null
      44 - Directory Name (null terminated, filled with nulls)
      4 - null
      }
    else if (padding file){
      66 - null
      }
    
// FILE DATA
  // for each file
    4 - CDI1 Header (CDI1)
    4 - Decompressed File Length
    4 - Flags (16=TEA Encryption, 17=TEA Encryption and Compression)
    X - File Data

Files can be encrypted with the TEA algorithm, with Key = THEEVENTHORIZONS

Files can also be compressed, but not currently sure what the compresison algorithm is. From looking at the TXT files in the archive, it looks like you need to decrypt the file first, and then it looks like the compression might be RLE-based?

Is there a tool that can decrypt files I've extracted from DTA/PDO/PDW?

Edited by mrmaller1905

  • Localization

Looked at it and I think it's more something like this:
 

bitfield f1 {
    bool compressed : 1;
    padding : 1;
    bool is_dir : 1;
    bool is_file : 1;
    bool unk1 : 1;
    padding : 11;
};
bitfield f2 {
    bool compressed : 1;
    padding : 3;
    bool encrypted : 1;
    padding : 11;
};

struct cdi1 {
    char magic[4];
    u32 usize;
    padding[2];
    f2 f;
};
struct e {
    f1 f;

    if (!f.is_dir && !f.is_file) padding[0x42]; // this doesn't have to be here but it just makes it look cleaner
    else {
        s16 ids[5];
        u32 off;
        u32 size;
        char fname[0x2C];
        u32 unk_off;

        if (f.is_file) {
            cdi1 file @ (parent.cd1_dat_off+off);
            char data_end[4] @ (parent.cd1_dat_off+off+size-4);
        }
    }
};

struct a {
    char magic[4];
    u32 pc;
    u32 c;
    u32 header_size;
    u32 dir_off;
    u32 cd1_dat_off;
    u32 cd1_dat_s;
    e e[pc] @ dir_off;
};

a a @ 0;

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.