Jump to content

How do I mass convert .pk6 files to .pk7 while still keeping the file name?


Recommended Posts

For example, I have Adamant.pk6, but I have over 300+ but just with a different name, I wanna convert all of those files to .pk7 while still keeping that file name. I have attached the beast of .pk6s that need to be converted to .pk7. there are many, and when I mean many, I mean MANY. i can't just drop the folder into a gen 7 pkhex window, dump all the boxes to a folder and change the names manually, no no that would take a great deal of time. it already took me almost two hours to complete the old one.

Link to comment
Share on other sites

there aren't any tools that do exactly what you want, here's some rough c# that will do what you want (using PKHeX.Core.dll)

var path = @"your path goes here";
var files = Directory.EnumerateFiles(path, "*", 0);

foreach (var f in files)
{
  	var fi = new FileInfo(f);
  	if (fi.Extension != ".pk6")
      	continue;
  	if (!PKX.IsPKM(fi.Length))
      	continue;
  
	var data = File.ReadAllBytes(f);
	var pk6 = new PK6(data);
	var pk7 = pk6.ConvertToPK7();
	File.WriteAllBytes(f.Replace(".pk6", ".pk7"), pk7.DecryptedBoxData);
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...