mirror of
https://github.com/SabreTools/NDecrypt.git
synced 2026-02-06 21:29:33 +00:00
.NET 6 version wrongly decrypts 3ds roms #7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Brankale on GitHub (Jul 2, 2022).
Originally assigned to: @mnadareski on GitHub.
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.
@mnadareski commented on GitHub (Sep 27, 2022):
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.
@mnadareski commented on GitHub (Sep 27, 2022):
Hmm, so I have the library compiled to
netstandard2.0so there must be something up with the commandline program?@mnadareski commented on GitHub (Sep 27, 2022):
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.
@mnadareski commented on GitHub (Sep 27, 2022):
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.
@Brankale commented on GitHub (Sep 27, 2022):
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.
@mnadareski commented on GitHub (Sep 27, 2022):
Here you go:
net6.0.zip
@Brankale commented on GitHub (Sep 28, 2022):
Unfornately these changes don't solve the issue. However I did further testing and:
@mnadareski commented on GitHub (Oct 4, 2022):
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.
@Brankale commented on GitHub (Oct 4, 2022):
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
@Brankale commented on GitHub (Oct 10, 2022):
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.
@mnadareski commented on GitHub (Oct 10, 2022):
An entirely reasonable ask. Let me see what I can do.
@mnadareski commented on GitHub (Oct 10, 2022):
It's been removed from the release page and a note was put up. Good call.
@mnadareski commented on GitHub (Oct 27, 2022):
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.
@mnadareski commented on GitHub (Oct 28, 2022):
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.
@mnadareski commented on GitHub (Oct 28, 2022):
I think I was able to fix the issue in
7d263886daPlease see the attached build.
net6.0.zip
@Brankale commented on GitHub (Oct 28, 2022):
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
@Brankale commented on GitHub (Oct 29, 2022):
I've tried with a couple of games and the issue seems to be fixed
@mnadareski commented on GitHub (Oct 30, 2022):
That's great news! This will probably mean a new stable release. Thank you for your patience.
@mnadareski commented on GitHub (Oct 31, 2022):
Officially released as part of https://github.com/SabreTools/NDecrypt/releases/tag/0.2.4