I'm writing a H2 editor for practice. Extracting meta-data is a cakewalk but when it comes to injecting, how am I supposed to do that in a map with a different file-layout. Let's say I extract "objects\weapons\rifle\battle_rifle\battle_rifle.weap" from coagulation. The meta starts at offset 37659788 and is 1580 bytes large. If i want to insert this data in for example ascension, where would I start writing the meta-data? (imagine that this tag doesn't exist in ascension). Writing it at the above location will eventually screw up already existing map data.
EDIT: Basically what I want is the theory behind chunk-adding.
What you want to do is not chunk cloning its adding a new tag to a map. You need to add a new Index entry, a new file name, a new file index entry, and the tags meta. Then you need to re calculate the reflexive pointers for the meta and finally pad anything that needs to be padded.
Ah of course... Does anyone know where you can get the map file-format documentation? I can't get hold of the H2 White Paper since all links I've tried are broken. If anyone has it, please upload it somewhere.
UberAnalyzeTool has a pretty good layout for maps in it. Just open a map and put your mouse over the colored bars and it should tell you what it's called, the offset, and the size.