July 5Jul 5 Localization I'm looking for tools to import .c3d from Colin McRae Rally (1998). This file format has compression/encryption/obfuscation. colinmcraerally1998_c3d.rar
July 5Jul 5 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 Monday at 10:10 AM5 days by h3x3r
Create an account or sign in to comment