Page 1 of 1

A.I.M Racing

Posted: Tue Jun 16, 2009 6:58 pm
by requ
Been looking at it but has no luck, if anyone else can take a look it would be greatful!

File Header: SGMF
AIMRBIN.zip

Re: A.I.M Racing

Posted: Tue Jun 16, 2009 7:37 pm
by Mr.Mouse
Is this the total file? Any more examples?

Re: A.I.M Racing

Posted: Tue Jun 16, 2009 8:24 pm
by requ

Re: A.I.M Racing

Posted: Tue Jun 16, 2009 10:06 pm
by Mr.Mouse
Okay so far I have established the following.

Code: Select all

// Header

[4]	MagicWord	"SGMF"
uint32	Number of files
uint32	Number of file chunks
uint32	Size of uncompressed filechunk
uint32	Null

// Resource information ('number of files'-times)

[80]	Filename
uint32	Offset (in uncompressed archive?)
uint32	Size (in uncompressed archive?)

// Filechunk information

uint32	Unknown (Offset in uncompressed file?)
uint32	Compressed chunk? (1= yes)
uint32 	Offset (in archive) of chunk

// Chunk information

uint32	Chunk size
[n]	(un)compressed data

Re: A.I.M Racing

Posted: Wed Jun 17, 2009 6:16 am
by Gocha
How can I use it to extract the files?

Re: A.I.M Racing

Posted: Wed Jun 17, 2009 8:50 am
by Mr.Mouse
You can't. These are my first findings of the archive format. What we have yet to establish is:

1. Each resource was probably divided in chunks of 32768 (&h8000) bytes before compression. So, in essence, the chunks in the archive will allways be either 32768 in size (i.e. NOT compressed, see Compressed flag in description), or smaller when compressed. This means that we know the maximum uncompressed size of each chunk : 32768. But how about the last chunk, or files that were originally smaller than 32768? Probably the 32768 is a padding size.
2. The compression that was used is unclear. We have to find out what method was used.
3. What is this about the strange numbers, like offsets, in each chunk information section? Is this the location of the uncompressed data in the original uncompressed archive file? Is the original archive a mere list of resources each saved back to back, but padded up to 32768 bytes, and do these unknown numbers point to the offsets of where to save the chunk?

You see, there are still some open questions.

Re: A.I.M Racing

Posted: Wed Jun 17, 2009 2:00 pm
by requ
Yeah that's why I'm having a hard time opening these archives.

Re: A.I.M Racing

Posted: Wed Jun 17, 2009 11:05 pm
by Mr.Mouse
After analyses I do think that a whole uncompressed archive with files saved back to back was compressed using smal chunks of 32768 in size, and that the chunks are stored in the right order as well. Other values could indicate SRC or something. What about Deflate? or LZSS?

Here're some tab-delimited automated analyses of all different sections in an archive:
Look at the first RESOURCE table, these are definitely the offsets and sizes of the uncompressed archive.
Check how Number_of_chunks * Paddingsize almost equals the last size + offset in that table. The difference is probably due to those chunks that were not compressed: ComType 0 = Not Compressed, ComType 1 = compressed, CompType 4 = not compressed and SMALLER than Paddingsize!
analyses.zip
Like:

Code: Select all

Filename: C:\Program Files\Microsoft Visual Studio\VB98\Programs\lzss
Number of resources: 16
Number of chunks: 151
Padding size: 32768


RESOURCE INFORMATION: 
DATA\LOCS\TRACK01.MMO	0	446699
DATA\LOCS\TRACK02.MMO	446699	139484
DATA\LOCS\TRACK03.MMO	586183	319343
DATA\LOCS\TRACK04.MMO	905526	111045
DATA\LOCS\TRACK05.MMO	1016571	195719
DATA\LOCS\TRACK06.MMO	1212290	307830
DATA\LOCS\TRACK07.MMO	1520120	351385
DATA\LOCS\TRACK08.MMO	1871505	277671
DATA\LOCS\TRACK09.MMO	2149176	205802
DATA\LOCS\TRACK10.MMO	2354978	277095
DATA\LOCS\TRACK11.MMO	2632073	545133
DATA\LOCS\TRACK12.MMO	3177206	299586
DATA\LOCS\TRACK13.MMO	3476792	367500
DATA\LOCS\TRACK14.MMO	3844292	285802
DATA\LOCS\TRACK15.MMO	4130094	349852
DATA\LOCS\TRACK16.MMO	4479946	460374


CHUNK INFORMATION TABLE: 
Voffset	ComType	Offset
1643586	1	3242
1655767	1	11871
1672218	1	21437
1686877	1	30585
2167742	1	40830
2152910	1	50021
1546821	4	59691
1503185	4	81687
2186574	4	103917
1876699	1	129843
2289859	1	138108
2112017	1	154223
2247685	1	162169
2055764	1	170265
1924009	1	180000
1759373	1	191652
1791717	1	203514
1934829	1	212754
1539976	1	224004
2063613	1	230815
1587661	1	242980
1736277	1	249898
1785922	1	258611
1736569	1	267721
1651796	1	276277
1704232	1	285246
1738676	1	294527
2059185	1	303126
1973596	1	315275
1645552	1	325212
1873421	1	333574
1947364	1	342865
1730490	4	354758
1686052	4	379500
1617250	4	403420
1636465	1	426946
1733198	1	436571
1674218	1	443782
1896641	1	451720
2031317	4	460943
1935201	1	487063
1769080	1	495745
1806233	1	504444
1874361	1	514809
2125203	1	525452
2085000	1	533216
2244358	1	545007
1931089	1	560591
2152924	1	569416
1990874	1	579643
1804374	1	589357
2015166	1	599217
1797828	1	611909
1928562	1	620934
1638009	1	631301
1674150	1	637708
1846721	1	647659
2055820	4	656991
2047993	1	682639
1824232	1	694391
1730682	1	705013
1994295	1	714629
1559298	1	721755
2043218	1	730433
1967757	4	740488
2013837	1	766068
1813579	1	775124
1751127	1	784116
1759253	4	792964
1609019	1	816318
1695980	1	825039
2048354	1	834154
1877040	4	844348
1974702	1	868870
2261035	1	880522
1910704	1	893953
1973175	4	905205
1880485	4	931003
1649526	1	955667
2008633	1	965623
2174106	4	974630
1964752	4	1002162
1692405	4	1029226
1621460	1	1054274
1669138	1	1062742
1569895	1	1071972
1571260	1	1080863
1726662	1	1089576
1785452	4	1099106
1907209	1	1125130
1813757	1	1135378
1884209	1	1145999
1571212	1	1156770
1494413	1	1165019
1458089	4	1173309
2659228	1	1197089
2851536	1	1211461
2340495	1	1221423
2437642	1	1230147
2361065	1	1239369
2329712	4	1247923
2056445	1	1275881
2168170	1	1288835
2082810	1	1300313
2012031	1	1309717
2236668	1	1319089
2434982	4	1334125
1684958	4	1362449
1569017	4	1384565
1831086	1	1406243
2177887	1	1416051
1913197	1	1429108
1747959	1	1439621
2092839	1	1449358
2010894	1	1459345
2177439	1	1468577
2609219	1	1481955
2186053	1	1491692
1846214	1	1502580
1741948	1	1509907
2251706	1	1519311
1942520	1	1532542
1688091	1	1544516
2023950	1	1554190
1632782	1	1563838
2184503	1	1571967
2290330	1	1580959
1939331	1	1593953
2115301	1	1604228
1950649	4	1617099
1880301	1	1642409
1979043	1	1653136
1570542	4	1662708
2184348	1	1686042
1586078	1	1698949
1687254	4	1707715
2432714	1	1731289
1865976	1	1746725
1842147	4	1756393
2005345	1	1780465
1682972	1	1792194
1647765	1	1800979
1490611	1	1810480
2321695	1	1818942
1605075	1	1826129
1929064	1	1835066
1854262	1	1844677
1978213	1	1854645
1894622	1	1865082
2013117	1	1876030
1687323	1	1883387


CHUNK INFORMATION DATA: 
Chunksize	Offset	Size	IVar
8625	3247	8621	4354
9562	11876	9558	4353
9144	21442	9140	4364
10241	30590	10237	4362
9187	40835	9183	4372
9666	50026	9662	4418
21992	59696	21988	749
22226	81692	22222	0
25922	103922	25918	-1
8261	129848	8257	4354
16111	138113	16107	4381
7942	154228	7938	4353
8092	162174	8088	4353
9731	170270	9727	4354
11648	180005	11644	4353
11858	191657	11854	4354
9236	203519	9232	4386
11246	212759	11242	4537
6807	224009	6803	4561
12161	230820	12157	4409
6914	242985	6910	4354
8709	249903	8705	4354
9106	258616	9102	4573
8552	267726	8548	4352
8965	276282	8961	4354
9277	285251	9273	4424
8595	294532	8591	4370
12145	303131	12141	4354
9933	315280	9929	4507
8358	325217	8354	4467
9287	333579	9283	4353
11889	342870	11885	4442
24738	354763	24734	1862408250
23916	379505	23912	16784702
23522	403425	23518	1048625
9621	426951	9617	4352
7207	436576	7203	4352
7934	443787	7930	4417
9219	451725	9215	4368
26116	460948	26112	17440
8678	487068	8674	4400
8695	495750	8691	4354
10361	504449	10357	4476
10639	514814	10635	4369
7760	525457	7756	4353
11787	533221	11783	4599
15580	545012	15576	4354
8821	560596	8817	4354
10223	569421	10219	4354
9710	579648	9706	4421
9856	589362	9852	4595
12688	599222	12684	4543
9021	611914	9017	4387
10363	620939	10359	4354
6403	631306	6399	4422
9947	637713	9943	4354
9328	647664	9324	4355
25644	656996	25640	62
11748	682644	11744	4398
10618	694396	10614	4354
9612	705018	9608	4354
7122	714634	7118	4357
8674	721760	8670	4353
10051	730438	10047	4354
25576	740493	25572	-336116211
9052	766073	9048	4542
8988	775129	8984	4354
8844	784121	8840	4354
23350	792969	23346	-1086504153
8717	816323	8713	4354
9111	825044	9107	4354
10190	834159	10186	4368
24518	844353	24514	-887798266
11648	868875	11644	4352
13427	880527	13423	4354
11248	893958	11244	4353
25794	905210	25790	1229217620
24660	931008	24656	0
9952	955672	9948	4476
9003	965628	8999	4354
27528	974635	27524	189
27060	1002167	27056	919877695
25044	1029231	25040	5634
8464	1054279	8460	4356
9226	1062747	9222	4428
8887	1071977	8883	4354
8709	1080868	8705	4358
9526	1089581	9522	4354
26020	1099111	26016	543862819
10244	1125135	10240	4354
10617	1135383	10613	4367
10767	1146004	10763	4460
8245	1156775	8241	4354
8286	1165024	8282	4353
23776	1173314	23772	63
14368	1197094	14364	4356
9958	1211466	9954	4352
8720	1221428	8716	4558
9218	1230152	9214	4527
8550	1239374	8546	4354
27954	1247928	27950	977797172
12950	1275886	12946	4495
11474	1288840	11470	4353
9400	1300318	9396	4354
9368	1309722	9364	4514
15032	1319094	15028	4411
28320	1334130	28316	1598968915
22112	1362454	22108	0
21674	1384570	21670	0
9804	1406248	9800	4353
13053	1416056	13049	4360
10509	1429113	10505	4497
9733	1439626	9729	4358
9983	1449363	9979	4420
9228	1459350	9224	4354
13374	1468582	13370	4460
9733	1481960	9729	4600
10884	1491697	10880	4356
7323	1502585	7319	4358
9400	1509912	9396	4420
13227	1519316	13223	4422
11970	1532547	11966	4354
9670	1544521	9666	4356
9644	1554195	9640	4422
8125	1563843	8121	4573
8988	1571972	8984	4534
12990	1580964	12986	4358
10271	1593958	10267	4354
12867	1604233	12863	4563
25306	1617104	25302	0
10723	1642414	10719	4354
9568	1653141	9564	4506
23330	1662713	23326	17537
12903	1686047	12899	4476
8762	1698954	8758	4363
23570	1707720	23566	987500352
15432	1731294	15428	4436
9664	1746730	9660	4419
24068	1756398	24064	1290945902
11725	1780470	11721	4354
8781	1792199	8777	4354
9497	1800984	9493	4536
8458	1810485	8454	4372
7183	1818947	7179	4495
8933	1826134	8929	4598
9607	1835071	9603	4371
9964	1844682	9960	4354
10433	1854650	10429	4368
10944	1865087	10940	4354
7353	1876035	7349	4484
11145	1883392	11141	4352

Re: A.I.M Racing

Posted: Wed Sep 30, 2009 12:42 am
by aluigi
I have released a script for these archives.
practically it's a filesystem composed by chunks of the following types:
0: uncompressed
1: compressed with lzo 1x
4: compressed with rlew