Exploding Frogs Posted May 24, 2022 Posted May 24, 2022 (edited) Pokemon X claims my save is corrupted, but PKHeX loads it just fine. Here's what happened: 1) Edited save data. Mostly just editing items and Pokemon, but since I was on a breeding spree, decided to edit O-Powers so I could use S- and MAX-level Powers--in particular, the Hatching Power. Selected Max Everything box. 2) Restored save (via Checkpoint, if that's relevant.) Attempted to load save. Game informs me that save is corrupt. 3) Did a few rounds of editing corrupted save (which loads fine in PKHeX, as mentioned) to see if removing the O-Powers will "uncorrupt" it. No dice. 4) Replaced corrupted save with backup of unedited save. 5) Tried the O-Powers thing again, just to check if it really was that and not an error elsewhere in the process. Save registered by game as corrupt. 6) Attempted to replace corrupted save with unedited backup. Found that backup no longer existed. Realized that I had inadvertently moved the file instead of copying it. 7) Used Time Machine (I'm on a Mac, and run PKHeX via a Windows 7 VirtualBox) to recover backup. 8 ) Restored save. Attempted to load save. Game informs me that save is corrupt, which is surprising since this is after all a backup from before the save was edited. 9) Used Time Machine to recover earlier backup of save, accepting that I'd have to lose a few hours of progress. 10) Restored save. Attempted to load save. Game informs me that save is corrupt. This is rather alarming. 11) Used Time Machine to recover even earlier backup from a month before this whole fiasco happened. Attempted to load save. Game informs that save is corrupt. At this point, it becomes clear that I have no save data that the game will recognize as uncorrupted. At some point during all this mess (I don't recall exactly when) I tried erasing my save data with D-Pad Up+B+X, saving, and then restoring the old save data with Checkpoint. This did not fix the problem, but it occurs to me that it might have in some way made things worse. I also took the opportunity to check if Checkpoint was the problem by backing up and restoring the new save, but the new save loaded normally. From what I've searched online, it is probably not anti save restore at work, because my game is a physical copy of Pokemon X, not a digital copy. Unless Pokemon XY has some other form of save "protection" that my save keeps tripping? Attached is a copy of my save. I would really rather not lose this save, though since it loads in PKHeX I can at least salvage my Pokemon if worst comes to worst. main Edited May 24, 2022 by Exploding Frogs
Exploding Frogs Posted May 24, 2022 Author Posted May 24, 2022 (edited) 40 minutes ago, theSLAYER said: How are you sending the save to your device? With the SD card. I didn't even know there was any other way to do it until I started searching on this topic. Edited May 24, 2022 by Exploding Frogs
theSLAYER Posted May 24, 2022 Posted May 24, 2022 40 minutes ago, Exploding Frogs said: With the SD card. I didn't even know there was any other way to do it until I started searching on this topic. Yeah FTP. Next, usually you’ll restore a folder with a save in it. during restore, is the save named “main” (no extension, no other name), and the only file in that folder? In addition, you said you managed to restore a new save just fine, only this file is causing issues? And PKHeX is loading it fine?
Exploding Frogs Posted May 24, 2022 Author Posted May 24, 2022 Yes to all. Name is correct, (lack of) extension is correct, no other files in the same folder, PKHeX doesn’t have any problems with the file, and Pokemon X doesn’t have any problem with new game saves even after they’ve been backed up and restored with Checkpoint.
theSLAYER Posted May 24, 2022 Posted May 24, 2022 3 minutes ago, Exploding Frogs said: Yes to all. Name is correct, (lack of) extension is correct, no other files in the same folder, PKHeX doesn’t have any problems with the file, and Pokemon X doesn’t have any problem with new game saves even after they’ve been backed up and restored with Checkpoint. Give me some time. I'll try restoring the file to my game to see if the same issue occurs. If it does, I'll proceed to extract your mons. Do you have another save that already has progress? I can just plop the mons in. Preferably all the mons you want to keep in that save is in the last box or something. (With party containing nothing but trash)
Exploding Frogs Posted May 24, 2022 Author Posted May 24, 2022 (edited) 1 hour ago, theSLAYER said: Give me some time. I'll try restoring the file to my game to see if the same issue occurs. If it does, I'll proceed to extract your mons. Do you have another save that already has progress? I can just plop the mons in. Preferably all the mons you want to keep in that save is in the last box or something. (With party containing nothing but trash) I have already extracted my mons myself. The file loads correctly in PKHeX, so there was nothing stopping me from doing so. Thank you for the offer, though. I am more interested in finding out what exactly is causing my game to register this save file as corrupt (including Time Machine-recovered backups from before it started registering as corrupt, bizarrely enough) and if anything can be done to fix that: Should I switch to JKSM instead of Checkpoint, perhaps? Or would the Partial Savefile Fix Tool work? I haven’t tried deleting the secure value because I am under the impression that physical carts don’t use it, but is there some similar security measure that the save file is tripping? Stuff like that. Edited May 24, 2022 by Exploding Frogs
theSLAYER Posted May 24, 2022 Posted May 24, 2022 Quote I am more interested in finding out what exactly is causing my game to register this save file as corrupt (including Time Machine-recovered backups from before it started registering as corrupt, bizarrely enough) and if anything can be done to fix that. If data is written to somewhere the game doesn't expect there to be data, then it'll be corrupt. What the cause is tho, I can't say. Too many things can go wrong. 4 minutes ago, Exploding Frogs said: Should I switch to JKSM instead of Checkpoint, perhaps? They both work similarly. Haven't had issues with either. 4 minutes ago, Exploding Frogs said: Or would the Partial Savefile Fix Tool work? You mean the tool I made? Your save can load fine in PKHeX, so it won't need it. It's only for those that used some kind of FTP with the wrong settings, and a byte or 2 going missing. Those files can't be opened by PKHeX. 5 minutes ago, Exploding Frogs said: I haven’t tried deleting the secure value because I am under the impression that physical carts don’t use it, but is there some similar security measure that the save file is tripping? Stuff like that. It's not any of that. Also, just because PKHeX loads a file, doesn't mean some sectors aren't invalid. In any case, you could try to swap out blocks till you figure out the cause (being which block), then proceed to narrow it down.
Exploding Frogs Posted May 24, 2022 Author Posted May 24, 2022 9 hours ago, theSLAYER said: In any case, you could try to swap out blocks till you figure out the cause (being which block), then proceed to narrow it down. This sounds promising. How would I go about doing this?
theSLAYER Posted May 24, 2022 Posted May 24, 2022 1 hour ago, Exploding Frogs said: This sounds promising. How would I go about doing this? Use hex editing. Block by block replace your save’s blocks, until it is able to load. Make sure you sue PKHeX to fix checksums after such an edit. Should be able to find block size and offset checking PKHeX’s older commits
Exploding Frogs Posted May 24, 2022 Author Posted May 24, 2022 45 minutes ago, theSLAYER said: Use hex editing. Block by block replace your save’s blocks, until it is able to load. Make sure you sue PKHeX to fix checksums after such an edit. Should be able to find block size and offset checking PKHeX’s older commits Sounds great, except for the part where I know nothing about hex editing and thus have no idea what you just said. I’m willing to learn, mind you, I just have no idea where to even start. Sorry if I’m being obtuse, but could you point me in the right direction?
theSLAYER Posted May 24, 2022 Posted May 24, 2022 1 hour ago, Exploding Frogs said: Sounds great, except for the part where I know nothing about hex editing and thus have no idea what you just said. I’m willing to learn, mind you, I just have no idea where to even start. Sorry if I’m being obtuse, but could you point me in the right direction? I probably can try to provide an example with photographs later, when I’m back at my PC. Maybe in 12 hours time lol
Exploding Frogs Posted May 26, 2022 Author Posted May 26, 2022 On 5/24/2022 at 4:13 PM, theSLAYER said: I probably can try to provide an example with photographs later, when I’m back at my PC. Maybe in 12 hours time lol It has now been 48 hours, so I hope I don’t come across as impatient or ungrateful when I ask if this is still a thing that is going to happen.
theSLAYER Posted May 26, 2022 Posted May 26, 2022 15 minutes ago, Exploding Frogs said: It has now been 48 hours, so I hope I don’t come across as impatient or ungrateful when I ask if this is still a thing that is going to happen. Right sorry I’ve been busy with work and basically got home and fell asleep. Hmm, I should be able to get it done over the weekends, thanks for the reminder :3
theSLAYER Posted May 27, 2022 Posted May 27, 2022 https://github.com/kwsch/PKHeX/blob/754b87a4f09b2aa5718e205e55d8d41722c498d7/PKHeX.Core/Saves/SAV6.cs Sav6 offsets. Specifically, these are the block offsets in an XY save. So let's say you want suspect the Trainer1 block to be the bad block, you can import it in by copying the data over from a fresh save, using a hex editor. I'll be using the program called HxD for this. So I loaded the save into HxD, now to select the range. For example, if I'm selecting the Trainer1 block, it should be from 0x1400 (as per shown above) to 0x17FF (0x1800, the next block, and minus by 1). You can Ctrl+E to select block (in HxD), then indicate the area. Now, the prompt will close after you select OK. Double check you selected the right area. Copy the data. (Ctrl+C) Now, go to the other save, and go to the same location and place your cursor there. In this example, it'll be 0x1400. To go to that location, you can Ctrl+G and type in the value. Once you're at the location, you can Paste write (Ctrl+B) Once done, export the file from HxD. Then load that edited file into PKHeX. Then export it from PKHeX. (this is to fix checksums). Now check it in the game, see if it loads. If not, rinse and repeat for each block. I recommend doing half of the entire save, then keep halving.
Exploding Frogs Posted May 27, 2022 Author Posted May 27, 2022 2 hours ago, theSLAYER said: I recommend doing half of the entire save, then keep halving. Um, bad news on that front. I did the first half of the save, and it was rejected as corrupt. Then I did the second half of the save, and it was also rejected as corrupt. Yes, even though the fresh save as a whole loads with no trouble. I then tried replacing the entire save at once with the data of the fresh save. (That is, I used Control + E to select the entire fresh save file from 00000 to 655FF, then copied and paste wrote from 00000 on the old save.) This was still rejected as corrupt. But the fresh save itself still loads fine. Even after being imported into and then exported from PKHeX. I’m starting to wonder if perhaps there is no file corruption; the game cart (which, I reiterate, is physical—not a digital download) is just refusing to accept this one file. Is that a thing that can happen? Did you ever check if you could load the save in question? Because knowing whether this issue is specific to my game/console/SD card would be quite helpful right now.
theSLAYER Posted May 27, 2022 Posted May 27, 2022 2 minutes ago, Exploding Frogs said: I’m starting to wonder if perhaps there is no file corruption; the game cart (which, I reiterate, is physical—not a digital download) is just refusing to accept this one file. Is that a thing that can happen? No. Did you correct the checksum with PKHeX as I said? That's a very important step. If you don't correct the checksums, then hex edits you do will make the save look corrupted. 2 minutes ago, Exploding Frogs said: Did you ever check if you could load the save in question? Because knowing whether this issue is specific to my game/console/SD card would be quite helpful right now. Not done yet.
Exploding Frogs Posted May 27, 2022 Author Posted May 27, 2022 4 minutes ago, theSLAYER said: Did you correct the checksum with PKHeX as I said? That's a very important step. If you don't correct the checksums, then hex edits you do will make the save look corrupted. Yes, I did. 6 minutes ago, theSLAYER said: Not done yet. Well, that won’t be necessary anymore. I have fixed the problem. Shortly after my previous post, I thought to myself, “if copy-paste-writing the data from the new file to the old still has the old file read as corrupt, what will happen if I copy-paste-write from the old file to the new, which has never yet been rejected?” And, well, it worked. Even though it had no right whatsoever to do so. ??? In any case, thanks for all your help. I’d have never stumbled upon this…solution(?) if not for your suggestion to swap out blocks. 1
theSLAYER Posted May 27, 2022 Posted May 27, 2022 5 hours ago, Exploding Frogs said: Yes, I did. Well, that won’t be necessary anymore. I have fixed the problem. Shortly after my previous post, I thought to myself, “if copy-paste-writing the data from the new file to the old still has the old file read as corrupt, what will happen if I copy-paste-write from the old file to the new, which has never yet been rejected?” And, well, it worked. Even though it had no right whatsoever to do so. ??? In any case, thanks for all your help. I’d have never stumbled upon this…solution(?) if not for your suggestion to swap out blocks. May I ask, which block caused corruption? glad that you resolved it :3
Exploding Frogs Posted May 27, 2022 Author Posted May 27, 2022 2 minutes ago, theSLAYER said: May I ask, which block caused corruption? glad that you resolved it :3 It doesn't seem to have been any block. The file itself was being rejected, as far as I can tell, since copying all the data in the file (00000 to 655FF) and Ctrl+B at 00000 in the the new file had the game accepting it as not corrupt. Somehow. For some reason there was an actual difference between that and just using the old file.
theSLAYER Posted May 28, 2022 Posted May 28, 2022 47 minutes ago, Exploding Frogs said: It doesn't seem to have been any block. The file itself was being rejected, as far as I can tell, since copying all the data in the file (00000 to 655FF) and Ctrl+B at 00000 in the the new file had the game accepting it as not corrupt. Somehow. For some reason there was an actual difference between that and just using the old file. There shouldn't be meta data on the file of any sort. Perhaps the file itself had a checksum issue or something In any case, still glad you resolved it :3
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now