Page 8 of 10

Re: Universal Century Gundam Online .DET

Posted: Thu Apr 05, 2012 2:22 pm
by Demonsangel
Yes, but it seems you're missing the python imaging library. Though iirc Finale said Sanae only used standard python libraries so you'll have to wait for him to elaborate.

Re: Universal Century Gundam Online .DET

Posted: Thu Apr 05, 2012 2:28 pm
by leyme
Image
Image
A little change to the windows command line.
But, there is something amiss.

Re: Universal Century Gundam Online .DET

Posted: Thu Apr 05, 2012 6:29 pm
by finale00
Demonsangel wrote:Yes, but it seems you're missing the python imaging library. Though iirc Finale said Sanae only used standard python libraries so you'll have to wait for him to elaborate.
Oh, I use the PIL library for the xx format export because I haven't written my own image import/exporters lol
I guess that isn't standard. Though, it's used exclusively for that particular plugin.

Code: Select all

sanae.py -f mqo my_file
exports it as mqo, which does not require any sort of image processing.

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 2:14 am
by leyme
Image
Thank you everybody for your support.

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 3:57 am
by leyme
Image
Image

Oops. Help me.
An error occurred while converting some det file to mqo.

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 5:37 am
by youngmark
I think there're problems my PC, still they don't work.
I can format the hard disk and reinstall Windows right now.

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 5:53 am
by finale00
leyme wrote:
Oops. Help me.
An error occurred while converting some det file to mqo.
This is the sample files.
http://www.mediafire.com/?85ojjudi9cgpbpk
I've looked at the format again and noticed I was doing something wrong before.

It is a chunk-based format, and each chunk has the form

Code: Select all

dword chunkID
dword chunktag (always the same)
dword chunkType
There are almost always more vertex sections than face sections, but you can match them up because the corresponding vertex chunkID = face chunkID - 52

Or at least, that seems to be able to load up all the models you provided.

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 6:58 am
by leyme
Thank you for replying so quickly.
Can I expect the next update?

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 7:02 am
by finale00
Ya, here's a noesis plugin with the revised format: http://db.tt/zDtBcHGP
I don't see any texture names though.

Maybe that other private server forum released some info? They seemed to be modding and adding all sorts of stuff the last time I went there.

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 7:20 am
by leyme
Image
This is a perfect script, all support.
Thanks for creating this awesome script.

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 7:34 am
by finale00
It doesn't work for a bunch of files I downloaded from the beginning of the thread LOL

Looks like there are two versions...

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 4:07 pm
by leyme
Roger that.

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 6:04 pm
by finale00
Anyone how to decrypt/decompress the map DET's?
The ones in the OBJECT folder.

Anyways there sort of seems to be some matrices at the bottom of the file, but I can't get past those "script data" chunks.

I've updated the script to load those other models that had some extra data at the top, but then I found some models that have different vertex structs (36, 40, 44, 48 bytes). And fortunately, the chunkID's are also different.

I think that's pretty much where I got before lol

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 7:03 pm
by leyme
I found the information on a retrieval page on the Internet.
What is this?

Code: Select all

//=============================================================================
2	//  File:     Crypto.java - Combined Functions for UCGO Crytpography
3	//            Note: Make sure Header is correct (namely XORSize is in place)
4	//
5	//  Author:   Eric "Xenozephyr" Dyoniziak
6	//  Licensees: (write names here)
7	//
8	//  Date:     June 24rd, 2007
9	//
10	//  Copyright(C) 2007
11	//  This source code is property of the above author and licensees, and may not
12	//   be edited, distributed, or compiled without their written permission.
13	//  This copyright notice must remain in its original form and may not be
14	//   edited or removed, regardless if permission to compile, edit, or
15	//   distribute this source code was given.
16	//  This intellectual property is protected internationally by the
17	//   World Intellectual Property Organization (WIPO) Copyright Treaty
18	//   and locally by the Digital Millennium Copyright Act (DMCA). Violation
19	//   may result in legal actions taken by the author and/or licensees.
20	//  This source code is distributed in the hope that it will be useful, but
21	//   WITHOUT ANY WARRANTY; without even the implied warranty of
22	//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23	
24	package UCGOCrypto;
25	import java.util.Random;
26	public class Crypto
27	{
28	    private Blowfish blowfish;
29	    private XORMask xormask;
30	    private Random rand;
31	
32	    private int byteArrayToInt(byte[] buf, int ofs)
33	    {
34	        return (buf[ofs+3]<<24) | ((buf[ofs+2] & 0x0ff)<<16) | ((buf[ofs+1] & 0x0ff)<<8) | ( buf[ofs] & 0x0ff);
35	    }
36	
37	    private void intToByteArray(int value,byte[] buf,int ofs)
38	    {
39	        buf[ofs+3] = (byte)((value >>> 24) & 0x0ff);
40	        buf[ofs+2] = (byte)((value >>> 16) & 0x0ff);
41	        buf[ofs+1] = (byte)((value >>>  8) & 0x0ff);
42	        buf[ofs] = (byte)  value;
43	    }
44	
45	    public Crypto()
46	    {
47	        blowfish = new Blowfish("chrTCPPassword");
48	        xormask = new XORMask();
49	        rand = new Random(System.currentTimeMillis());
50	    }
51	
52	    public void Encrypt(byte[] data, int length)
53	    {
54	        short randVal = (short)(rand.nextInt(65536) & 0x0FFFF);
55	        int KEY = xormask.Keygen(randVal);
56	        int XORSize = byteArrayToInt(data,16);
57	        xormask.Encrypt(data,64+XORSize,KEY);
58	        KEY = randVal & 0x0FFFF;
59	        intToByteArray(KEY,data,4);
60	        blowfish.Encrypt(data,length);
61	    }
62	
63	    public void Decrypt(byte[] data, int length)
64	    {
65	        //EDIT: Sjekk at dataene vi mottar er minst 64 byte, minste størrelse for en UCGO pakke.
66	        if ( data.length < 64 ) return; //Ugyldige data mottatt, ignorer.
67	        blowfish.Decrypt(data,length);
68	        short randVal = (short)(((data[5] & 0x0ff) << 8) | (data[4] & 0x0ff));
69	        int KEY = xormask.Keygen(randVal);
70	        int XORSize = byteArrayToInt(data,16);
71	        XORSize ^= KEY;
72	        //EDIT: Sjekk at XORSize + headersize ikke går utenfor byte arrayet. For å unngå OutOfBounds exception.
73	        if ( (XORSize+64) > data.length ) return; //Ugyldige data mottatt, ignorer.
74	        xormask.Decrypt(data,64+XORSize,KEY);
75	        KEY = (KEY >>> 16) & 0x0FFFF;
76	        intToByteArray(KEY,data,4);
77	    }
78	}
http://trac.assembla.com/solarone/changeset/8
I hope that this has been helpful to you

Re: Universal Century Gundam Online .DET

Posted: Fri Apr 06, 2012 7:54 pm
by finale00
Ugh lol if you look around you'll see lots of code. I wonder if that blowfish algorithm is just the common one used everywhere.
Maybe someone already wrote a stand-alone tool for decrypting them.