ROM Hack Suggestion Pokemon Quest editor?

SilverfalconLP

Well-Known Member
Member
Joined
Dec 23, 2013
Messages
111
Trophies
0
Age
40
XP
913
Country
im look git this
Code:
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
 
namespace PqCrypt
{
    public static class Program
    {
        public static readonly byte[] Key = Encoding.UTF8.GetBytes("C7PxX4jPfPQ2SmzB");
        public static readonly byte[] Iv = Encoding.UTF8.GetBytes("nSdhdc3ecDDEM7fA");
        public static readonly byte[] ChecksumKey = Encoding.UTF8.GetBytes("chikuwa-hanpen");
        public static readonly int SaveLength = 0x80000;
 
        static void Main(string[] args)
        {
            if (args.Length != 3)
            {
                PrintUsage();
                return;
            }
 
            switch (args[0])
            {
                case "d":
                    var encSave = File.ReadAllBytes(args[1]);
                    File.WriteAllBytes(args[2], DecryptSave(encSave));
                    break;
                case "e":
                    var decSave = File.ReadAllBytes(args[1]);
                    File.WriteAllBytes(args[2], EncryptSave(decSave));
                    break;
                default:
                    PrintUsage();
                    return;
            }
        }
 
        private static void PrintUsage()
        {
            Console.WriteLine("Usage: pqdecrypt d <enc_save_in> <dec_save_out>");
            Console.WriteLine("       pqdecrypt e <dec_save_in> <enc_save_out>");
        }
 
        private static byte[] EncryptSave(byte[] save)
        {
            // Recalculate hash
            var hash = new HMACSHA256(ChecksumKey);
            var checksum = hash.ComputeHash(save, 0x38, save.Length - 0x38);
            Array.Copy(checksum, 0, save, 0x14, 0x20);
 
            // Encrypte head and body chunks
            var encryptedLength = save.Length + 15 & ~0xF;
            var head = Encrypt(BitConverter.GetBytes(encryptedLength), 0, 4);
            var body = Encrypt(save, 0, save.Length);
 
            // Concat the 2 chunks
            var encrypted = new byte[SaveLength];
            Array.Copy(head, encrypted, 16);
            Array.Copy(body, 0, encrypted, 16, body.Length);
            return encrypted;
        }
 
        private static byte[] DecryptSave(byte[] saveEnc)
        {
            var length = BitConverter.ToInt32(Decrypt(saveEnc, 0, 16), 0);
            return Decrypt(saveEnc, 16, length);
        }
 
        private static byte[] Encrypt(byte[] data, int index, int length)
        {
            using (var aes = Aes.Create())
            using (var encryptor = aes.CreateEncryptor(Key, Iv))
                return Transform(data, index, length, encryptor);
        }
 
        private static byte[] Decrypt(byte[] data, int index, int length)
        {
            using (var aes = Aes.Create())
            using (var decryptor = aes.CreateDecryptor(Key, Iv))
                return Transform(data, index, length, decryptor);
        }
 
        private static byte[] Transform(byte[] data, int index, int length, ICryptoTransform decryptor)
        {
            using (var ms = new MemoryStream())
            using (var cs = new CryptoStream(ms, decryptor, CryptoStreamMode.Write))
            {
                cs.Write(data, index, length);
                cs.FlushFinalBlock();
                return ms.ToArray();
            }
        }
    }
}
 
Last edited by SilverfalconLP,

Firecube247

Member
Newcomer
Joined
Jun 10, 2017
Messages
22
Trophies
0
Location
Hamburg
XP
643
Country
Germany

Thank you for the info! Here's the compiled version and a tutorial. (only for Windows atm)

1. Download this file.

2. Put the PqCrypt.exe in a folder with your save file.

3. Shift and Right-Click on an empty space in the folder.

4. Click open command prompt here.

5. Write this in the command line:
PqCrypt.exe d <path to your encrypted save file> <output path for the decrypted file>

Example: PqCrypt.exe d C:\Users\xxxxx\Desktop\folder\user C:\Users\xxxxx\Desktop\folder\decrypteduser

6. Edit the decrypted file with a Hex editor.

7. Encrypt it like this:
PqCrypt.exe e <path to your edited decrypted save file> <output path for the edited encrypted file>

Example: PqCrypt.exe e C:\Users\xxxxx\Desktop\folder\decrypteduser C:\Users\xxxxx\Desktop\folder\user

8. Inject it with any save file manager

9. Done! :)
 

Lykon

Well-Known Member
Newcomer
Joined
May 26, 2018
Messages
70
Trophies
0
Age
36
XP
142
Country
Italy
I compiled it a couple of hours ago and it seems to be working. I was trying to figure out the hex structure.
I can see my Pokémon names in the hex file. Unfortunately I have no idea of what to edit yet. Is there any template for 010 Editor?
 
Last edited by Lykon,
  • Like
Reactions: P4RI4H

P4RI4H

Well-Known Member
Member
Joined
Mar 10, 2018
Messages
104
Trophies
0
Location
Earth
Website
www.twitter.com
XP
403
Country
United States
I compiled it a couple of hours ago and it seems to be working. I was trying to figure out the hex structure.
I can see my Pokémon names in the hex file. Unfortunately I have no idea of what to edit yet. Is there any template for 010 Editor?

Unfortunately, right now I only have Ubuntu on my system. Installing a Virtual Win7 system now. In the meantime, here are a couple dumped saves using Checkpoint. 1 has 140 Tickets, 2 has 90, taken 2 minutes apart. Should be minimal changes between the two.

Edit: Should probably mention these are still yet to be decrypted since I was not 100% sure that running the decrypt program with wine worked. Haha
 

Attachments

  • user 1.zip
    30.8 KB · Views: 166
  • user 2.zip
    30.8 KB · Views: 176
Last edited by P4RI4H,
  • Like
Reactions: Firecube247

Lykon

Well-Known Member
Newcomer
Joined
May 26, 2018
Messages
70
Trophies
0
Age
36
XP
142
Country
Italy
I have decrypted them for you. Unfortunately I now am on 5.1.0 (I turned off airplane mode and misclicked on update, because I'm such a genius), so I can't test myself.
 

Attachments

  • dec.zip
    9.5 KB · Views: 192
Last edited by Lykon,

Garblant

Well-Known Member
Member
Joined
Apr 1, 2016
Messages
726
Trophies
0
Age
25
Location
Alola
XP
508
Country
United States
Unfortunately, right now I only have Ubuntu on my system. Installing a Virtual Win7 system now. In the meantime, here are a couple dumped saves using Checkpoint. 1 has 140 Tickets, 2 has 90, taken 2 minutes apart. Should be minimal changes between the two.
I dumped my save via Checkpoint too. I would share it, but since I shilled out for all of the dlc, I'm not sure what would occur if someone that doesn't have dlc were to inject the save file onto their system...
 

Firecube247

Member
Newcomer
Joined
Jun 10, 2017
Messages
22
Trophies
0
Location
Hamburg
XP
643
Country
Germany
Unfortunately, right now I only have Ubuntu on my system. Installing a Virtual Win7 system now. In the meantime, here are a couple dumped saves using Checkpoint. 1 has 140 Tickets, 2 has 90, taken 2 minutes apart. Should be minimal changes between the two.

Perfect! I think I found the place where tickets are stored.

140 Decimal = 8C Hexadecimal
90 Decimal = 5A Hexadecimal

EDIT: Seems like your save file is very different from mine. What region is your game?

Your save:
Unbenannt.PNG


My save:
Unbenannnt.PNG
 
Last edited by Firecube247,

Lykon

Well-Known Member
Newcomer
Joined
May 26, 2018
Messages
70
Trophies
0
Age
36
XP
142
Country
Italy
I don't have that address on my old file backup, uhm...
Maybe the value is moved down by the number of Pokémon and items you have stored, so it's not a fixed address.

I should have 280 tickets on this one, no DLCs, very few Pokémon.
 

Attachments

  • out.zip
    3.7 KB · Views: 182

Firecube247

Member
Newcomer
Joined
Jun 10, 2017
Messages
22
Trophies
0
Location
Hamburg
XP
643
Country
Germany
I don't have that address on my old file backup, uhm...
Maybe the value is moved down by the number of Pokémon and items you have stored, so it's not a fixed address.

You're probably right. The ticket counter should be a couple of lines above the line where your username is after a 01.
 

Lykon

Well-Known Member
Newcomer
Joined
May 26, 2018
Messages
70
Trophies
0
Age
36
XP
142
Country
Italy
280=118. My username is Lykon (of course).

If we also find a way to edit ingredients this game is basically completely open, since you can have all the upgrades with tickets and spam recipes/Pokémon with ingredients+tickets.

Of course, a reliable way to alter moves and stats would be even better.
 

Attachments

  • Cattura.PNG
    Cattura.PNG
    8.4 KB · Views: 461
Last edited by Lykon,

P4RI4H

Well-Known Member
Member
Joined
Mar 10, 2018
Messages
104
Trophies
0
Location
Earth
Website
www.twitter.com
XP
403
Country
United States
  • Like
Reactions: Firecube247

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
Thank you for the info! Here's the compiled version and a tutorial. (only for Windows atm)

1. Download this file.

2. Put the PqCrypt.exe in a folder with your save file.

3. Shift and Right-Click on an empty space in the folder.

4. Click open command prompt here.

5. Write this in the command line:


6. Edit the decrypted file with a Hex editor.

7. Encrypt it like this:


8. Inject it with any save file manager

9. Done! :)
Just tried it with mono on macOS, unfortunately, while the app compiles and runs, it doesn't provide proper output. The decrypted files are cut off at about 11KB.
 

ExploitTnT

Devy | YT: DevRin | dev_settings
Member
Joined
Jul 30, 2017
Messages
150
Trophies
0
XP
270
Country
Austria
My friend wants his save everything Max does somebody know how to do it?
 

Attachments

  • user.zip
    11.7 KB · Views: 164

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: 455