Thursday, July 7, 2011

Sensibeat's cmn.emz File Structure Tutorial

cmn.emz file structure

I extracted ZGF.cmn.emz in piecemontee's SF4 AE and opened it in my hexadecimal editor:
[IMG]
I highlighted the references for each data, in bright colors the Relative Location and in faded color, the Length.
So the 16 characters in red are references for #EMO, the 16 in orange are references for #EMM ... etc

You have to know that those values are read backwards (2 characters at a time)

In the case of #EMO, let's look at it's Relative Location (in bright red), we read: 60 00 00 00
It means the Relative Location is 00 00 00 60 (60)

The Rule is: Relative Location (RL) = offset of True Beginning (TB) - offset of Current Reference Location (CL)

We have RL: 60 and CL: 20
TB = RL+CL = 60+20 = 80 (easy one but for later calculations remember we're in hexadecimal)

The True Beginning of #EMO is at offset: 80
[IMG]

Let's try with #EMM:
We read: E8 8D 02 00
Meaning our RL is: 00 02 8D E8 (28DE8)
We have CL: 28
TB = 28DE8+28 = 28E10

The True Beginning of #EMM is at offset: 28E10
[IMG]



Now let's take a look at our #EMO's Length (in faded red, 1st screen), we read: 88 8D 02 00
It means the length of the file is 00 02 8D 88 (28D88)

The Rule is: Length (L) = offset of True Ending (TE) - offset of True Beginning (TB)

We have L: 28D88 and TB: 80
TE = L+TB = 28D88+80 = 28E08

The True Ending of #EMO is at offest: 28E08
[IMG]

The last references are the True Beginnings of the files names at the end of the cmn.emz file:
[IMG]

For ZGF.skl.emo we can read: 90 D0 A8 00
Meaning its True Beginning is at offset A8D090

Cari Farmasi

Farmasi Di Kuala Lumpur dan Selangor Selangor / KL Area NO SHOPS NAMES ...