Worms4Editor/Worms4Editor/Program.cs

34 lines
1.3 KiB
C#

using LibXom;
using LibXom.Blocks;
using LibXom.Data;
using System.Security.Cryptography;
using System.Text;
namespace Worms4Editor
{
internal class Program
{
static void Main(string[] args)
{
/* int id = 0;
for (int i = 0; i < 0x7FFFFF; i++) {
int d = XomCompressor.DecompressInt(id);
if (d != i) Console.WriteLine("FAIL; " + i.ToString("X") + " id " + id.ToString("X") + " d " + d.ToString("X"));
else Console.WriteLine("PASS; " + i.ToString("X") + " id " + id.ToString("X") + " d " + d.ToString("X"));
id = XomCompressor.NextCompressedInterger(id);
} */
XomFile xfile = XomReader.ReadXomFile(@"Original.xom");
//XomFile ps2file = XomReader.ReadXomFile(@"ps2.xom");
XomType type = xfile.GetTypeByName("StoredStatsCollective");
XomContainer container = type.Containers.First();
File.WriteAllBytes("StoredStatsCollective.bin", container.DecompressToBytes());
for(int i = 0; i < xfile.XomStrings.Length; i++)
{
XomString str = xfile.XomStrings[i];
Console.WriteLine(str.Id.ToString("X") + ": " + str.Value);
}
}
}
}