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] Colin McRae Rally (1998) .c3d

Featured Replies

  • Supporter

zlib/deflate. You can get decompressed size at end of file - 4 bytes.

And here is template for c3d. Not sure if it will work on all.

I was unable properly decode vertices and rest of it like normals / uvs. Maybe someone else can...

Here's decompressor

##############################
comtype deflate
get BaseFileName basename
get FileExtension extension
get FileSize asize

xmath DecompressedSizeOffset "FileSize - 4"
xmath CompressedSize "FileSize - 14"
goto DecompressedSizeOffset
get DecompressedSize uint32

string Name p "%s_d.%s" BaseFileName FileExtension
clog Name 10 CompressedSize DecompressedSize
//------------------------------------------------
//--- 010 Editor v14.0 Binary Template
//
//      File: 
//   Authors: 
//   Version: 
//   Purpose: 
//  Category: 
// File Mask: 
//  ID Bytes: 
//   History: 
//------------------------------------------------
LittleEndian();OutputPaneClear();

local string FileName=GetFileName(),FilePath=FileNameGetPath(FileName,true),BaseName=FileNameGetBase(FileName,false),ShapeNum;
local uint32 i,j,k,l;

char Sign[4];
uint32 CM3DSize;
struct
{
    struct
    {
        char CM3DSign[4];
        uint32 Unknown;
        uint32 CM3DInfoSize;
        uint16 TOCCount;
        uint16 ShapeCount;
        uint32 TextureCount;
        uint32 TOCBaseOffset;
        uint32 ShapeBaseOffset;
        uint32 TextureBaseOffset;
    }CM3DInfo;
    
    
    FSeek(startof(CM3D) + CM3DInfo.TOCBaseOffset);
    struct
    {
        uint32 Unknown_0;
        uint32 Unknown_1;
        uint32 Unknown_2;
        uint32 Unknown_3;
        uint32 Unknown_4;
        uint32 Unknown_5;
        uint32 Unknown_6;
        uint32 Unknown_7;
        uint32 Unknown_8;
        uint32 Unknown_9;
        uint32 Unknown_10;
        uint32 Unknown_11;
        uint32 Unknown_12;
        uint32 Unknown_13;
        uint32 Unknown_14;
        uint32 Unknown_15;
        uint32 Unknown_16;
        uint32 Unknown_17;
        uint32 Unknown_18;
        uint32 Unknown_19;
        if (Unknown_19 == 1)
            uint32 Unknown_20;
    }CM3DTOC[CM3DInfo.TOCCount]<optimize=false>; // at some cases completely wrong
    
    
    FSeek(startof(CM3D) + CM3DInfo.ShapeBaseOffset);
    struct
    {
        string ShapeName;
        FSeek(startof(ShapeName));
        FSkip(12);
        uint32 ShapeDataSize;
        uint16 VertexCount;
        uint16 IndexCount;
        FSkip(28);
        
        struct
        {
            int16 VPosX,Unk_0;
            int16 VPosY,Unk_1;
            int16 VPosZ,Unk_2;
            FSkip(20); // reserved
        }ElementBuffer[VertexCount]<optimize=false>;
        
        struct
        {
            int16 Unk_0;
            uint16 F1,F2,F3;
            int16 TextureId; // maybe
            FSkip(14); // reserved
        }IndexBuffer[IndexCount]<optimize=false>;
    }CM3DShape[CM3DInfo.ShapeCount]<optimize=false>;
    
    
    FSeek(startof(CM3D) + CM3DInfo.TextureBaseOffset);
    struct
    {
        string TextureName;
        FSeek(startof(TextureName));
        FSkip(12);
        uint32 BM6DSize;
        struct
        {
            char BM6DSign[4];
            FSkip(6);
            uint32 TextureDataOffset;
            uint32 Unknown_0;
            uint32 TextureWidth;
            uint32 TextureHeight;
            uint16 Unknown_1;
            uint16 PixelFormat;
            uint32 Unknown_2;
            uint32 TextureDataSize;
            uint32 Unknown_3;
            uint32 Unknown_4;
            uint32 Unknown_5;
            uint32 Unknown_6;
            local uint32 TextureDataSizeCalc=(TextureWidth * TextureHeight);
            byte PaletteData[1024];
            
            FSeek(startof(BM6D) + TextureDataOffset);
            if (TextureDataSize != 0)
                byte TextureData[TextureDataSize];
            else
                byte TextureData[TextureDataSizeCalc];
                
            FSeek(startof(BM6D));
            FSkip(BM6DSize);
        }BM6D;
    }CM3DTexture[CM3DInfo.TextureCount]<optimize=false>;
}CM3D;

Edited by h3x3r

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.