The only ones I know are right are the head, foot, MapName, and ScenarioPath XD
Code for teh shits in giggle:
Code: Select all
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace CougarTest
{
public class Map
{
private mapHeader _header;
public mapHeader Header
{
get { return _header; }
set { _header = value; }
}
public Map(string FileName)
{
FileStream fs = new FileStream(FileName, FileMode.Open);
BinaryReader br = new BinaryReader(fs);
this.Header = new mapHeader(br);
}
}
public class mapHeader
{
public char[] head;
public int version;
public int filesize;
public int zero;
public int indexOffset;
public int metaStart;
public int unknown;
public char[] mapOrigin;
public byte[]unknown1;
public char[] build;
public byte[] unknown2;
public int unknown3;
public int offsetToStrangeFileStrings;
public int unknown4;
public int offsetToSomething;
public int scriptReferenceCount;
public int sizeOfScriptReference;
public int offsetToScriptReferenceIndex;
public int offsetToScriptReferenceStrings;
public byte[] unknown5;
public char[] mapName;
public int zero1;
public char[] scenarioPath;
public byte[] zero2;
public int unknown6;
public int fileCount;
public int fileTableOffset;
public int fileTableSize;
public int filesIndex;
public int signature;
public byte[] zero3;
public char[] foot;
public mapHeader(BinaryReader br)
{
br.BaseStream.Position = 0;
this.head = System.Text.UnicodeEncoding.UTF8.GetChars(br.ReadBytes(4));
this.version = br.ReadInt32();
this.filesize = br.ReadInt32();
this.zero = br.ReadInt32();
this.indexOffset = br.ReadInt32();
this.metaStart = br.ReadInt32();
this.unknown = br.ReadInt32();
this.mapOrigin = System.Text.UnicodeEncoding.UTF8.GetChars(br.ReadBytes(32));
this.unknown1 = br.ReadBytes(224);
this.build = System.Text.UnicodeEncoding.UTF8.GetChars(br.ReadBytes(32));
this.unknown2 = br.ReadBytes(20);
this.unknown3 = br.ReadInt32();
this.offsetToStrangeFileStrings = br.ReadInt32();
this.unknown4 = br.ReadInt32();
this.offsetToSomething = br.ReadInt32();
this.scriptReferenceCount = br.ReadInt32();
this.sizeOfScriptReference = br.ReadInt32();
this.offsetToScriptReferenceIndex = br.ReadInt32();
this.offsetToScriptReferenceStrings = br.ReadInt32();
this.unknown5 = br.ReadBytes(36);
br.BaseStream.Position = 408;
this.mapName = System.Text.UnicodeEncoding.UTF8.GetChars(br.ReadBytes(32));
this.zero1 = br.ReadInt32();
br.BaseStream.Position = 444;
this.scenarioPath = System.Text.UnicodeEncoding.UTF8.GetChars(br.ReadBytes(64));
this.zero2 = br.ReadBytes(192);
this.unknown6 = br.ReadInt32();
this.fileCount = br.ReadInt32();
this.fileTableOffset = br.ReadInt32();
this.fileTableSize = br.ReadInt32();
this.filesIndex = br.ReadInt32();
this.signature = br.ReadInt32();
this.zero3 = br.ReadBytes(1320);
this.foot = System.Text.UnicodeEncoding.UTF8.GetChars(br.ReadBytes(4));
}
}
}