XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Wed Mar 29, 2017 12:33 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: MTC + MDF
PostPosted: Wed Jan 07, 2015 8:40 pm 
Offline
beginner

Joined: Sun Feb 17, 2008 1:52 pm
Posts: 20
Has thanked: 4 times
Have thanks: 0 time














You can make the ads go away by registering

Any script to pack/unpack data from this files? (images, text, maps...)

https://www.sendspace.com/file/thbepe

Game: Monaco

Thanks for your help!


Top
 Profile  
 
 Post subject: Re: MTC + MDF
PostPosted: Mon Jan 12, 2015 1:20 pm 
Offline
advanced
User avatar

Joined: Fri Jul 25, 2014 6:28 am
Posts: 67
Location: Korea
Has thanked: 12 times
Have thanks: 24 times
Code:
//--------------------------------------
//--- 010 Editor v6.0 Binary Template
//
// File: .mtc in monaco
// Author: MiRiKan
// Revision: 1.0
// Purpose: unpacking monaco files
//--------------------------------------
local uint i, pos0, pos1;
uint header;
uint count;

struct pointers{
    for (i = 0; i < count; i++){
        struct _POS{
            uint pointer;
            pos0 = FTell();
            FSeek(pointer);
            uint _pos;
            uint _ID;
            pos1 = FTell();
            FSeek(_pos);
            uint unk;
            uint unk <hidden=true>;
            uint realpointer; //pointer for .mdf
            uint unk <hidden=true>;
            uint unk;
            uint64 realFileSize; // files in .mdf
            FSeek(pos0);
        }Data;
    }
}data;


it looks nonencrypted files in .mdf. but i can not find any name of file, so that i can not make unpacking tool as easy.
making tool now...

_________________
Team.SM, Create Koren Translations for Games.


Top
 Profile  
 
 Post subject: Re: MTC + MDF
PostPosted: Mon Jan 12, 2015 2:05 pm 
Offline
beginner

Joined: Sun Feb 17, 2008 1:52 pm
Posts: 20
Has thanked: 4 times
Have thanks: 0 time
Thank you MiRiKan. Good luck with that :)


Top
 Profile  
 
 Post subject: Re: MTC + MDF
PostPosted: Tue Oct 18, 2016 12:08 am 
Offline
ultra-n00b

Joined: Tue Dec 29, 2015 4:04 am
Posts: 4
Has thanked: 0 time
Have thanks: 1 time
MiRiKan wrote:
it looks nonencrypted files in .mdf. but i can not find any name of file, so that i can not make unpacking tool as easy.


Just dump to keys when that happens? :)

---

Anyway, the reason I'm replying is I've been sitting on this for years now ... I fully intended to post this when I saw it last January, but things got out of hand and I forgot. Someone just reminded me I need to rebuild the safe code for release so here's the name list a bit early.

As I rewrote part of my old Monaco code in Go in 2014-2015 I have this in a Go file with it which should help you if you need it ... typically you'd build a lookup table, but since I usually write daemons for modding (tcp/ip connections for requests to save time/lookup nonsense for offsets on data I want cached) I keep JSON dumps :)

Here's the Go code snippet I kept with it in dropbox:

Code:
import (
   "hash/crc32"
   "path/filepath"
)

// StringCRC32 does case sensitive CRC32 calculations for Monaco.
func StringCRC32(raw string) (crc int32) {
   crc = 0
   p := []byte(raw)
   for _, v := range p {
      crc = int32(crc32.IEEETable[uint8(crc^(int32(v)&0xFF))]) ^ (crc >> 8)
   }
   return
}

// StringICRC32 does case insensitive CRC32 calculations for Monaco.
func StringICRC32(raw string) (crc int32) {
   crc = 0
   p := []byte(raw)
   for _, v := range p {
      crc = int32(crc32.IEEETable[uint8(crc^(int32(v)&0xDF))]) ^ (crc >> 8)
   }
   return
}

// PlatformStringCRC32 is used for filename calculation (sensitive)
func PlatformStringCRC32(raw string) (crc int32) {
   plat := filepath.Clean(raw)
   crc = StringCRC32(plat)
   return
}

// PlatformStringCRC32 is used for filename calculation (insensitive)
func PlatformStringICRC32(raw string) (crc int32) {
   plat := filepath.Clean(raw)
   crc = StringICRC32(plat)
   return
}


Due to size limitations the name list is in the original JSON form (a 7ziped .txt file). I got the names by using pattern based brute-forcing and CRCing them. Given all of that you should be able to repackage if you want.

Notably the CRC differs marginally, here it is without all of the casting hell to clarify the difference:
Code:
// Monaco (0xDF mask instead of 0xFF for insensitive)
// crc ^ (byte & mask)
crc = crc32_tab[crc^(v & 0xFF))] ^ (crc >> 8)

// Normal
// (crc ^ byte) & mask
crc = crc32_tab[(crc ^ v) & 0xFF] ^ (crc >> 8)


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group