Worms4Editor/Worms4Editor/Program.cs

36 lines
1.5 KiB
C#

using LibXom;
using LibXom.Blocks;
using LibXom.Data;
using System.Security.Cryptography;
namespace Worms4Editor
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine(XomCompressor.DecompressInt(32767).ToString("X"));
Console.WriteLine(XomCompressor.DecompressInt(98432).ToString("X"));
Console.WriteLine(XomCompressor.DecompressInt(98433).ToString("X"));
Console.WriteLine(XomCompressor.DecompressInt(8388607).ToString("X"));
int id = 0;
for (int i = 0; i < 0x9000; 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(@"SaveGame.xom");
XomFile ps2file = XomReader.ReadXomFile(@"ps2.xom");
XomType type = xfile.GetTypeByName("StoredStatsCollective");
File.WriteAllBytes("StoredStatsCollective.bin", type.Containers.First().Data);
/*foreach(int d in data)
{
Console.WriteLine(d + ": "+ BitConverter.ToString(ps2file.GetContainerById(d).Data).Replace("-", " "));
}*/
}
}
}