but there may be textures and other files. I made a console application that changes the extension depending on the first 4 bytes of 'magic'. maybe [.mesh, *.dds, *.gis], other files will remain unchanged.
just drop a file or directory on it and it will scan all the files in the folder.
tested on "_Unknow" folder.
source code:
Code: Select all
using System;
using System.IO;
using System.Text;
namespace ConsoleRenamer
{
internal class Program
{
static void Main(string[] args)
{
if (args.Length > 0)
{
bool flag = File.GetAttributes(args[0]).HasFlag(FileAttributes.Directory);
string[] files = Directory.GetFiles(flag ? args[0] : Path.GetDirectoryName(args[0]));
foreach (string file in files)
{
uint magic;
using (BinaryReader br = new BinaryReader(File.OpenRead(file), Encoding.UTF8))
magic = br.ReadUInt32();
switch (magic)
{
case 1397311314:
rename(file, ".gis");
break;
case 542327876:
rename(file, ".dds");
break;
case 3150479412:
rename(file, ".mesh");
break;
}
}
}
Console.ReadKey();
}
static void rename(string name, string ext)
{
File.Move(name, Path.ChangeExtension(name, ext));
Console.WriteLine($"{name} >> {ext}");
}
}
}

