Hacking WIP XCI2TitleConverter - Automated process for XCI to Title

javilobo8

Well-Known Member
OP
Newcomer
Joined
May 10, 2018
Messages
90
Trophies
0
Age
30
Website
lobobot.com
XP
502
Country
Spain
Hello! I have just created a tool to create a title folder from a XCI file.

Hactool and your own Switch keys (all of them) are required.

ddea55573bf41c95226577d200f6f893.png


Hope this is useful for you.

https://github.com/javilobo8/XCI2TitleConverter

Releases:

1.0.0
  • Initial release
1.1.0
  • Add NPDM patching (thanks to @Falo )
  • Add more target titles
1.2.0
  • Some refactor
  • Add more target titles
1.3.0
  • Refactor process
  • Add threads
  • Show version info
  • Fix bug that entering title id manually doesn't count xD
1.4.0
  • Improove Threads
  • Block form while processing
  • Launch console and redirect hactool output to there.
  • Fix npdm bug

TODO

Thanks to @jmmc for developing a xci-to-title in java for Mac/Linux users!
I’ve created a tool in Java based on this to be multiplatform (Windows/Linux/macOS)

You just need java to run the .jar file.

src: https://bitbucket.org/jmmc95/xci-to-title/src/master/

Jar: https://bitbucket.org/jmmc95/xci-to-title/downloads/XCIToTitle.jar

For Mac and Linux you have to compile the hactool yourself, it’s very easy. And the key.txt
 
Last edited by javilobo8,

thomasnet

Well-Known Member
Member
Joined
Mar 6, 2016
Messages
175
Trophies
0
XP
579
Country
France
To modify the title id in the NPDM, just search the title id in little-endian (0100f8 becomes f80001) and replace it with the new game's title id.
 
  • Like
Reactions: javilobo8

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
Germany
I want to translate it, but I'm not so experienced with C#.

Code:
        public static void patchNPDM(string fPath, ulong targetTitleId)
        {
            byte[] data = File.ReadAllBytes(fPath);

            int aci0RawOffset = BitConverter.ToInt32(data, 0x70);

            if (data[aci0RawOffset] != 0x41 || data[aci0RawOffset + 1] != 0x43 || data[aci0RawOffset + 2] != 0x49 || data[aci0RawOffset + 3] != 0x30)
                throw new Exception("ACI0 magic bytes not found. did you select the right file (main.npdm)?");

            byte[] TitleIdBytes = BitConverter.GetBytes(targetTitleId);

            Array.Copy(TitleIdBytes, 0, data, aci0RawOffset + 0x10, TitleIdBytes.Length);

            File.WriteAllBytes(fPath + "_patched.npdm", data);
        }

call it like this: "patchNPDM("main.npdm", 0x010079F00671C000);"
 

javilobo8

Well-Known Member
OP
Newcomer
Joined
May 10, 2018
Messages
90
Trophies
0
Age
30
Website
lobobot.com
XP
502
Country
Spain
Code:
        public static void patchNPDM(string fPath, ulong targetTitleId)
        {
            byte[] data = File.ReadAllBytes(fPath);

            int aci0RawOffset = BitConverter.ToInt32(data, 0x70);

            if (data[aci0RawOffset] != 0x41 || data[aci0RawOffset + 1] != 0x43 || data[aci0RawOffset + 2] != 0x49 || data[aci0RawOffset + 3] != 0x30)
                throw new Exception("ACI0 magic bytes not found. did you select the right file (main.npdm)?");

            byte[] TitleIdBytes = BitConverter.GetBytes(targetTitleId);

            Array.Copy(TitleIdBytes, 0, data, aci0RawOffset + 0x10, TitleIdBytes.Length);

            File.WriteAllBytes(fPath + "_patched.npdm", data);
        }

call it like this: "patchNPDM("main.npdm", 0x010079F00671C000);"
Awesome, thank you so much. I was doing other way (potato), but yours is better.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: Brb