Heretic121 Posted October 10, 2013 Share Posted October 10, 2013 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 1 Quote Link to comment Share on other sites More sharing options...
Clan Friend SunLight Posted October 10, 2013 Clan Friend Share Posted October 10, 2013 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? Quote Link to comment Share on other sites More sharing options...
Heretic121 Posted October 10, 2013 Author Share Posted October 10, 2013 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. Quote Link to comment Share on other sites More sharing options...
Clan Friend SunLight Posted October 10, 2013 Clan Friend Share Posted October 10, 2013 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 Quote Link to comment Share on other sites More sharing options...
Heretic121 Posted October 10, 2013 Author Share Posted October 10, 2013 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 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 Anyway I gave you a tip, now it's up to you to code it Thank you very much dude, for all your help. Definitely gave me something to work with, instead of random shots in the dark 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? Quote Link to comment Share on other sites More sharing options...
DJ aka GDR DJ Posted October 10, 2013 Share Posted October 10, 2013 (edited) 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 /moved done Edited October 10, 2013 by DJ aka GDR DJ 1 Quote Link to comment Share on other sites More sharing options...
Heretic121 Posted October 10, 2013 Author Share Posted October 10, 2013 your wish is my command Orly? I'll have to remember that for the future Quote Link to comment Share on other sites More sharing options...
Heretic121 Posted October 10, 2013 Author Share Posted October 10, 2013 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. Quote Link to comment Share on other sites More sharing options...
Clan Friend SunLight Posted October 11, 2013 Clan Friend Share Posted October 11, 2013 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... Quote Link to comment Share on other sites More sharing options...
MiFi Posted November 19, 2013 Share Posted November 19, 2013 Hi, I have more info: - based original Q3 engine C code (IW changed some things for CoD but the base is the same) - try it for your self he done amazing work, http://cod4dm.altervista.org/ This guy is amazing, still i don't get it how he could get info from dm_1. Bye Quote Link to comment Share on other sites More sharing options...
MiFi Posted November 19, 2013 Share Posted November 19, 2013 ss; http://shrani.si/f/3A/Yi/2CA0Bick/xd.png Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.