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: 170
  • user 2.zip
    30.8 KB · Views: 179
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: 194
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: 183

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: 463
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: 167

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • SylverReZ @ SylverReZ:
    @RedColoredStars, I'm a cat person so this game must be for me. :D
  • Xdqwerty @ Xdqwerty:
    @RedColoredStars, sounds kinda neat
  • RedColoredStars @ RedColoredStars:
    @SylverReZ It's short but adorable imo. Im a HUGE cat lover.Can be completed in a couple of hours if just going for the main goals. But can be stretched out a good deal by exploring and doing everything there is to do and see.
    +2
  • Xdqwerty @ Xdqwerty:
    @RedColoredStars, like a cat gta?
  • SylverReZ @ SylverReZ:
    @RedColoredStars, Reminds me of a similar game called "Neko Atsume", similar to Nintendogs but you look after cats.
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, wasnt there an official nintendogs game with cats for the 3ds?
    +1
  • Xdqwerty @ Xdqwerty:
    ill have no wifi for a bit so see ya later
    +2
  • RedColoredStars @ RedColoredStars:
    Gross. lol
  • SylverReZ @ SylverReZ:
    @Xdqwerty, Ok seeya.
  • SylverReZ @ SylverReZ:
    @RedColoredStars, I've got a fairly dark sense of humor lol.
  • BigOnYa @ BigOnYa:
    So a man goes to the doctor because his boner wont go down. As he is laying in the hospital bed, with his thing propped up in the air, a fly is flying around and landing on the tip and bothering him, so he calls in the nurse. The nurse comes in, swats at the fly but can't quite reach it, so she climbs his boner to get better aim. After a few tries of swatting and sliding back down, she says sorry I cant get it. He says keep going, a few more tries, and I can shoot the fly down.
    +2
  • AncientBoi @ AncientBoi:
    Can I get his ☎️ # :shy::blush:
    +2
  • AncientBoi @ AncientBoi:
    oowpf What a work out it would be to help the guy get back down to normal :)
  • K3Nv2 @ K3Nv2:
    I don't know why pizza hut has fries now
  • AncientBoi @ AncientBoi:
    You're joking right?
  • AncientBoi @ AncientBoi:
    But also by the same token, I wouldn't mind if they had potato wedges instead :)
  • BigOnYa @ BigOnYa:
    Taco bell, and Mcdonalds both sold pizza, so its fair
  • AncientBoi @ AncientBoi:
    I knew of Taco Bell doing so, but Mickey Dees?
  • BigOnYa @ BigOnYa:
    yea years ago, small personal pizzas
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    McDonald's pizza was pretty good 🥰
    +1
  • BigOnYa @ BigOnYa:
    Pepsi owns Taco Bell, and Pizza Hut, so that made since Pizza hut pizza was sold in Taco bells.
  • BigOnYa @ BigOnYa:
    Pepsi, and it's companies, did not pull out of Russia like most did, even tho they orig said they would, so I boycott them. (Except when drunk at 2am and Taco bell is only place open.)
    BigOnYa @ BigOnYa: Pepsi, and it's companies, did not pull out of Russia like most did, even tho they orig said...