• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

w3g reversing

Status
Not open for further replies.
Level 6
Joined
Jun 29, 2011
Messages
181
I've been trying to analyse w3g files and I'm really stucked in the step of the CRC32 header checksum calculation.

http://w3g.deepnode.de/files/w3g_format.txt

Following that tut I have these 40 bytes from a replay header:
57 61 72 63 72 61 66 74 20 49 49 49 20 72 65 63 6F 72 64 65 64 20 67 61 6D 65 1A 00 44 00 00 00 77 1A 00 00 01 00 00 00 E0 3C 00 00 02 00 00 00 50 58 33 57 1B 00 00 00 AB 17 00 80 49 E6 02 00

and the following 4 bytes which is the checksum:
50 25 A0 11

So what I do to calculate the checksum is to get the 40 first bytes, add 4 bytes of zeroes and generate it. But it doesn't work!

I also tried reversing the whole header chain from back
0002E649800017AB0000001B573358500000000200003CE00000000100001A7700000044001A656D616720646564726F63657220494949207466617263726157
and then adding the 8 zeroes (at the end or at the start) and still nothing.

Any lights?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
I am not sure why you care about the checksum in the first place though.
To properly evaluate the file (detect checksum failure) and also to generate valid files WC3 will process (it probably fails with a "damaged" warning if checksum mismatches).

You need to CRC32 the full 0x40 (version 0) or 0x44 (version 1) bytes of the header with the CRC field 0ed.
 
Last edited:
Level 6
Joined
Jun 29, 2011
Messages
181
To properly evaluate the file (detect checksum failure) and also to generate valid files WC3 will process (it probably fails with a "damaged" warning if checksum mismatches).

You need to CRC32 the full 0x40 (version 0) or 0x44 (version 1) bytes of the header with the CRC field 0ed.

Ive tried this and always failed. Could you try with these bytes and tell if it works for you? Or just with a common replay from 1.27 :}
 
Level 6
Joined
Jun 29, 2011
Messages
181
Okay, it was a silly mistake of mine.

I succeeded and I was able to make a replay converser that is actually working (from 1.26 to 1.27) just by changing the game version and then the checksum.

I can post it if requested.

Thanks both for the help.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
I succeeded and I was able to make a replay converser that is actually working (from 1.26 to 1.27) just by changing the game version and then the checksum.
The reason WC3 does not support older replay files is because changes to the game engine could cause some replay files to desync. For example if Blizzard were to change the rate the movement loop updated to support twice as many units moving at once then movement in the replay would quickly out of sync and combat results would start to be different.

Modern RTS games like StarCraft II support this functionality by loading the map and replay file with an earlier game executable version, kept in a version archive of sorts.
 
Status
Not open for further replies.
Top