Closed Brankale closed 1 year ago
I'm not seeing the typical issues that were caused by the stream reading/writing change in .NET 6. I'll have to dig in.
Hmm, so I have the library compiled to netstandard2.0
so there must be something up with the commandline program?
I made a few smaller changes that are semi-related to .NET 6 that may help with this. Not a guarantee, but please try it out. I'll try to test locally when possible.
Local testing on a very small 3DS game worked on both decrypt and re-encrypt using the newest .NET 6 build on Windows 10. Hopefully that works for you as well.
If you can upload here the executable in a zip file you would save me a ton of time. If you can't, I'll try to make it myself as soon as I can find the time.
Here you go: net6.0.zip
Unfornately these changes don't solve the issue. However I did further testing and: 1) encryption seems to work fine (both the old and the new version) 2) decryption works only on some games. For example Super Mario 3D Land decryption works but in games like Pokemon Sun/Ultramoon or Zelda Majora's Mask, decryption is not working. 3) I did the test only on one game but it seems that the decryption problem is at the beginning of the file in the first couple of MB (probably the header). Take this info with a grain of salt.
Were the file sizes different as well? I may have to look into write operations if that's the case. It feels like this isn't a decrypt/encrypt library issue at this point, rather something yet harder to track down.
Yes
super mario 3d land was the only one below 1GB (512MB to be specific)
Zelda was 1 GB if I remember correctly and Pokemon games are 4GB in size
I thought about the file size too, but currently i dont have the tools to verify it
Since the .NET 6 is currently buggy, is it possible to remove this version from the github releases tab? I ask for this because this program is used to submit hashes on DAT-o-MATIC for rom dumps verification and game preservation purposes. Since the program can output wrong values a user who is unaware of this problem can accidentally submit wrong data to the website. Alternatively you can put a warning somewhere.
An entirely reasonable ask. Let me see what I can do.
It's been removed from the release page and a note was put up. Good call.
I've been looking into this pretty heavily to see if there's anything in my code that is causing this issue. Unfortunately, I've narrowed it down to (seemingly) the library I use for AES encryption support, where their internal code may not deal properly with byte reading changes in .NET 6.0. I'll be trying to narrow it down even further, but that's the best I have right now.
I may have narrowed it down further to something adjacent to the encryption. There were things happening async that made it seem like the encryption and decryption weren't working.
I think I was able to fix the issue in https://github.com/SabreTools/NDecrypt/commit/7d263886daedb4a4336cd1524d7d664e11314586
Please see the attached build. net6.0.zip
I’ll look into that in the next couple of days as soon as I can. Sorry but i’m pretty busy at the moment
I've tried with a couple of games and the issue seems to be fixed
That's great news! This will probably mean a new stable release. Thank you for your patience.
Officially released as part of https://github.com/SabreTools/NDecrypt/releases/tag/0.2.4
When you try to decrypt a 3DS rom with the .NET 6 version, the final file is corrupted and if you try to re-encrypt it you don't get the original file
.NET 4.8 and 5.0 versions are not affected by this problem.