Jump to content

dm_1 file format spec.


Heretic121

Recommended Posts

I know we have quite a few intelligent people here so I've got a question:

 

Does anyone know the file spec for COD4s demos (dm_1)?

 

I doubt it because I can normally find anything on Google, and there's not a single mention on there.

 

EDIT:

 

For those that care, I'll update this with anything I find while checking the file's hex.

 

8 octets of FF seem to signify the EOF.

FF FF FF FF FF FF FF FF 

This is a set of octets that seems to be repeated quite often in the demo.

F7 AE 41 44 AD FA D7 C5 CB CD 50 42
  • Like 1
Link to comment
Share on other sites

  • Clan Friend

Maybe they are similar to quake3 demos, no idea.

 

I don't have any cod4 demos to test, so I can't help you.

FF FF FF FF FF FF FF FF

 

is probably two DWORDS set to -1 (0xFFFFFFFF), and if it's like quake3 it means that the message sequence number and message length are -1 (end of the demo)

 

For example at the very beginning of an ET demo I have, I can read:

78 07 00 00 de 37 00 00

 

now, that should be little-endian, so 778 and 37de in hexadecimal.

 

778 in base 10 is 1912, that means that the serverMessageSequence = 1912

37de = 14302 in base 10, and that's the length of that message, using this you can locate the following message.

 

Then you have another demo message, and another, etc. but you need to decode them, they are packed and I don't think it's easy to guess the format, maybe you can look at Quake3 source code for hints.

 

Why are you interested in that thing, btw?

Link to comment
Share on other sites

I don't have any cod4 demos to test, so I can't help you.

 

I've got quite a few benign COD4 demos if you fancy having a look lol.

 

I found your reply to actually be very informative dude, thank you. I wasn't expecting much beyond a simple "Nope." when I posted this topic.

 

I'll definitely have a look at the q3 source and see if I can get my head round it.

 

 

Why are you interested in that thing, btw?

 

Figured I might be able to pull a readable log of the console from the/a demo, which would help immensely for some of the things FA members have to do. No longer having to download and watch an entire demo just for the small, but vital, conversation between two people for example.

Link to comment
Share on other sites

  • Clan Friend

I found some infos here, maybe it could be useful:
http://www.elho.net/games/q3/q3dspecs.htm
 
If you're able to decompress the demo messages (assuming it's the same format as Quake 3 engine), you could be able to read the chats in plain text
 
if you want to really parse the demo you need to know the command numbers and how to parse each command (for example in my ET demo stats generator you find in downloads section, I had to parse the demo like this).
 
But you can just unpack it using MSG_ReadByte alone. For example I tried downloading a random dm_1 file, and I managed to see text inside it:
 g_antilag\0\g_gametype\sd\gamename\Call of Duty 2\mapname\mp_dawnville\protocol\118\scr_friendlyfire\1\scr_killcam\0\shortversion\1.3 etc. etc.
 
but apparently it was a cod2 demo?
 
Maybe with cod4 it will fail, who knows... because another dm_1 I found doesn't have the same format, apparently.
 
Anyway I gave you a tip, now it's up to you to code it :P

Link to comment
Share on other sites

I found some infos here, maybe it could be useful:

http://www.elho.net/games/q3/q3dspecs.htm

Brilliant, thank you.

 

If you're able to decompress the demo messages (assuming it's the same format as Quake 3 engine), you could be able to read the chats in plain text

That's all I'm looking to do at the moment, and no that isn't a hint that I'm planning anything for the future.

 

But you can just unpack it using MSG_ReadByte alone. For example I tried downloading a random dm_1 file, and I managed to see text inside it:

 g_antilag\0\g_gametype\sd\gamename\Call of Duty 2\mapname\mp_dawnville\protocol\118\scr_friendlyfire\1\scr_killcam\0\shortversion\1.3 etc. etc.

I feel such a noob. I had to look up the Q3 source on GitHub to work out where you got MSG_Readbyte from   :embrass 

 

but apparently it was a cod2 demo?

 

Maybe with cod4 it will fail, who knows... because another dm_1 I found doesn't have the same format, apparently.

I would have thought they'd edit it ... "slightly" two games later :P

 

Anyway I gave you a tip, now it's up to you to code it :P

Thank you very much dude, for all your help. Definitely gave me something to work with, instead of random shots in the dark :P

 

 

Oh, and I think this topic has moved well away from a COD4 discussion and is more in Coding territory. Could we get a Staff+ to move it to the right section please?

Link to comment
Share on other sites

Oh, and I think this topic has moved well away from a COD4 discussion and is more in Coding territory. Could we get a Staff+ to move it to the right section please?

 

 

your wish is my command :D

 

/moved done

Edited by DJ aka GDR DJ
  • Like 1
Link to comment
Share on other sites

As I mentioned in the first post, I'll keep updating this topic as I find more information regarding relevant information about COD4 and how it's demos are created. From what I understand they're basically... a log of information received from the server, or something similar.

 

From what I've read Huffman compression is used. Also, I've started reading this:

http://www.tilion.org.uk/2011/11/quake-3-network-format/

The network format for Q3.

Link to comment
Share on other sites

  • Clan Friend

In that demo I wasn't able to read (don't know if it's a Cod 4 demo, actually), I tried to start from the end (since there is a -1, -1 as well) and I see that after each message there is other data following it.

You have a sequence number, then a size, but after 'size' bytes, there isn't the next sequence number as expected, but a sequence of bytes whose size isn't even constant. And after it you have the following sequence.

 

They probably added some extra data there, but how to get its length and how to parse it?

Doesn't sound easy, or maybe it's one of those things which look hard but are easy in reality...

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.