d0k3 / Decrypt9WIP

Multipurpose content dumper and decryptor for the Nintendo 3DS
GNU General Public License v2.0
405 stars 59 forks source link

VC GBA Save Injection Quality Control #138

Closed greenDarkness closed 7 years ago

greenDarkness commented 7 years ago

Hello, Thanks for adding GBA save extraction, and injection to Decrypt9WIP. When extracting VC GBA saves from the sysNAND they are extracted flawlessly. However, when injecting saves into a VC GBA game it takes at least 3 tries for the save to be written. Thanks for reading, Merry Christmas, and have a happy New Year!

d0k3 commented 7 years ago

You say it takes three tries? How so? What goes wrong and how do you see something went wrong? Can you show me the log?

greenDarkness commented 7 years ago

At least. I booted the game, saved it, powered off my system, launched Decrypt9, [SysNAND Options], [Miscellaneous...], [GBA VC Inject], entered the unlock sequence, selected gbavc.sav, GBA VC Save Inject: Success, start to reboot, check to see if save was written, nothing changed

(While typing this I tried it again, and I succeeded in two tries)

Decrypt9.txt: Initializing SD card... success Build: Decrypt9WIP (2016/11/13) Work directory: /files9 Game directory: /D9Game sector0x96 Key: loaded, stored 0x03 KeyX & KeyY: automatically set up 0x25 KeyX: loaded, verified, set up 0x18 KeyX: already set up 0x1B KeyX: loaded, verified, set up 0x24 KeyY: automatically set up Finalizing Initialization...

Initialization: success!

You selected [GBA VC Save Inject].

This feature writes to the SysNAND. This may overwrite important data!

If you wish to proceed, enter:

, , , , (B to return, START to reboot) Selected: [GBA VC Save Inject] Encrypting & Injecting GBA VC Save... Use arrow keys and to choose a file gbavc.sav GBA VC Save Inject: succeeded! Press B to return, START to reboot.
d0k3 commented 7 years ago

There actually is not really a way of this write failing. If you say you injected a changed save and it did not turn up changed, that's strange. I'll think of something and will need your help in testing later.

greenDarkness commented 7 years ago

Wow, this is pretty peculiar then. The only reason I even made a post about it is because I asked someone on GBAtemp if it worked for them, and they said it took them several tries as well. I will be more that glad to assist in testing this. Just for reference I'm on the newest nightly build of Luma v6.6-5e4fd532 and I have an Old3DS version 11.0.0-33U. I'm also using the 20161113 release of Decrypt9WIP. If you have any questions, or any test you'd like me to preform just ask. Thanks for taking time to look this over.

greenDarkness commented 7 years ago

Also, the best way to get in touch with me is via Discord if you have it. greenDarkness#9987 is my DiscordTag, feel free to add me. I'm on there pretty much constantly since a friend and I are running a Pokemon League.

urherenow commented 7 years ago

First rule of troubleshooting and reporting bugs is to do so with the LATEST source. In other words, it would be helpful if you could build the latest source on your own to see if the bug may have been fixed or not. Find a post by me on gbatemp and follow the link in my sig for instructions on how to compile stuff. (rxtools related, but applies to all)

pixel-stuck commented 7 years ago

@urherenow there's also d0k3.secretalgorithm.com for nightlies ;)

EDIT: well, looks like that's currently down (should be back up soon)

greenDarkness commented 7 years ago

@urherenow Can you link to your post? I currently don't know anything about compiling (I'm taking C++ this semester). @dark-samus Thanks, hopefully it will be back up soon.

urherenow commented 7 years ago

Really? It was too hard to search for my name on gbatemp? SMH

https://gbatemp.net/threads/noob-proof-guide-to-compile-rxtools-source.392242/

greenDarkness commented 7 years ago

capito27 It's a good thing I didn't since your name on here is different than on GBAtemp. Thank you.

urherenow commented 7 years ago

No... My user name is the same. And if this represents how well you read, or the number of active cells in that knoggin of yours, you're going to have a really hard time with a C++ class. Capito27 started the thread. He gave me access to edit that post since it needed fixing and maintaining.

My name is mentioned near the bottom. My name is also mentioned at the VERY bottom "Last edited by urherenow, Apr 26, 2016 " Furthermore, I said to search for any post by me, and follow the link in my sig. I never said it was my guide.

greenDarkness commented 7 years ago

My apologies, I didn't realize you weren't the author. I had just woken up when I read your post, sorry for misreading. Thanks for the guide.

d0k3 commented 7 years ago

Eh, be nice to each other. There actually is no need to compile, you'll find recent nightlies for all of my stuff here: https://d0k3.secretalgorithm.com/

Maybe you'll also want to try with the latest nightly of GM9? In that case, just copy the savegame into the S:/ drive.

d0k3 commented 7 years ago

Okay, I got an idea on how to reproduce it:

  1. Console turned off completely
  2. Start the GBA VC game, save, return to menu
  3. Boot into GM9 (via that AlbertoSonic rebooter and a button)
  4. Inject the modified save
  5. Reboot from GM9 to homemenu, start the GBA VC game
  6. Failed attempt

If the console is not turned off completely before the attempt, it should work. You can also do it with D9, ofc. Can you check if it is the same for you?

d0k3 commented 7 years ago

Also... when reproducing, this may differ between games. Meaning: Some kind of savehacking protection may be at work here.

greenDarkness commented 7 years ago

Do you recommend using Godmode9 over Decrypt9? I've updated to the 01/03/2017 release of Decrypt9; however, I now have a new problem. After extracting my save, I tested it by importing the battery into VBA, with the corresponding rom. It now says the save has been deleted. The save is fine on the .cia though. This issue never occurred with the 11/13/2016 release.

Initializing SD card... success Build: Decrypt9WIP (2017/01/03) Work directory: /files9 Game directory: /D9Game sector0x96 Key: loaded, stored 0x03 KeyX & KeyY: automatically set up 0x25 KeyX: loaded, verified, set up 0x18 KeyX: already set up 0x1B KeyX: loaded, verified, set up 0x24 KeyY: automatically set up Finalizing Initialization...

Initialization: success!

Selected: [GBA VC Save Dump] Dumping & Decrypting GBA VC Save... Use arrow keys and to choose a name gbavc.sav GBA VC Save Dump: succeeded!

Press B to return, START to reboot. Initializing SD card... success Build: Decrypt9WIP (2017/01/03) Work directory: /files9 Game directory: /D9Game sector0x96 Key: loaded, stored 0x03 KeyX & KeyY: automatically set up 0x25 KeyX: loaded, verified, set up 0x18 KeyX: already set up 0x1B KeyX: loaded, verified, set up 0x24 KeyY: automatically set up Finalizing Initialization...

Initialization: success!

Selected: [GBA VC Save Dump] Dumping & Decrypting GBA VC Save... Use arrow keys and to choose a name gbavc.sav GBA VC Save Dump: succeeded!

Press B to return, START to reboot.

greenDarkness commented 7 years ago

I'm unfamiliar with the AlbertoSonic rebooter. I just download the .cia and I'll report back after following your instructions using Godmode9. Edit1: Successfully extracted my save using Godmode9 on the first attempt. Edit2: I was unsuccessful when attempting to restore my save using Godmode9. I followed the steps provided, but I might have done it incorrectly since I've never used Godmode9 before now. When I restored to my save, I went to the folder gbavc.sav was located in on my sd card. I copied gbavc.sav to the clipboard. Opened SYSNAND VIRTUAL, and then pasted the save there after entering the safety key combo.

greenDarkness commented 7 years ago

Would it help if I provided the .cia? It's a Fire Red Rom hack.

d0k3 commented 7 years ago

Well... the instructions I provided are for making that error happen, not for circumventing it :). Don't provide the CIA here, this is copyrighted. If you only tested it with one game so far, what you could do to help is test it with another game, see if the same error happens. Otherwise, I'm still researching this strange problem.

greenDarkness commented 7 years ago

Ah, I understand. Well I finished Fire Red, so I started on Emerald the other day. Using the 2017/01/03 release of Decrypt9WIP I've been having a hard time getting 1 to 1 saves. For example, When I would extract my Fire Red save sometimes PKHeX wouldn't recognize the save as FR/LG, it would think that it was R/S. When this happens, if I try to load the save in the rom using Visual Boy Advance then it would say that the save had been deleted due to corruption. When extracting Emerald saves, the first time I tried it PKHeX didn't show any errors so I restored it without checking with VBA. It gave me the same "save has been deleted... corrupt."" message. After re-extracting maybe two more times I extracted a save that could be loaded in Visual Boy Advance, so I knew it was a good save. I've got some Metroid and Zelda games as well, if you'd like me to extract saves with those as well just say the word. Also, would it help if I sent you some of the good and bad saves I have?

d0k3 commented 7 years ago

Okay, getting back to this. Good and bad saves only help if they are close to each other, so that a compare still makes sense (i.e. same game, not too much changed in between). It also makes sense to try Metroid and Zelda saves, ofc.

d0k3 commented 7 years ago

Thought about it for a bit, and I now have a test setup.

Preparations: Run the GBA game you want to test. Make an agbsave (= not GBA VC) dump. Name this something you can remember. This will be your "base" agbsave. You need to inject this back before each and every GBA VC SAVE inject attempt.

Testing: As I wrote, inject the "base" AGBSAVE back, then inject the GBA VC save. Then dump the agbsave again (with a different name). Take note if the inject worked or not. To make any kind of assumption, I need two AGBSAVEs, one that worked, and one that did not.

If you need more info, just ask. I think this setup will help us finally get behind this.

greenDarkness commented 7 years ago

Alright, I'll do some save collecting as soon as possible.

greenDarkness commented 7 years ago

I'll work on the AGB Save stuff now.

d0k3 commented 7 years ago

Let me know once you found out something. Also, if reproducing the bug is not possible in this way, I'd like to know, too.

greenDarkness commented 7 years ago

I've been doing a little testing. The first time I extracted my save it was corrupted, and I provide a somewhat detailed report of what I mean by "corrupted". Whenever I inject AGBSAVE_base the gba save injection works perfectly.

greenDarkness commented 7 years ago

I'll provide all the file I've obtained once I'm able to replicate the error. I'll try again either tonight or tomorrow.

d0k3 commented 7 years ago

You can try switching to a different AGBSAVE_base... Just dump the the AGBSAVE before injection the GBA VC save, until you are able to reproduce the error. Maybe that would work?

d0k3 commented 7 years ago

@greenDarkness I assume you haven't been able to reproduce that issue?

greenDarkness commented 7 years ago

@d0k3 I was able to reproduce the issue on my friends 3ds the other day. Due to some unforeseen circumstances I was unable to test this weekend. I'm planning to test mine again tomorrow night; sorry this is taking so long.

d0k3 commented 7 years ago

No problem, just show me your testing results when you're ready :).

greenDarkness commented 7 years ago

Sorry this is taking so long. Some things came up and I've had my hands full till now. I should have some test results for you by Sunday. Thanks so much for being patient.

d0k3 commented 7 years ago

There has been no more information in this issue for a long time, so I'm considering closing it. I myself haven't been able to reproduce it anymore in recent builds of GM9 and D9 (which doesn't have to mean it is solved now).

So... can you still reproduce in recent builds?

d0k3 commented 7 years ago

Alright, closing this now, assuming it is solved. If you have to add something, please reopen this!