Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set checksum for NWC24Config during creation #11353

Merged

Conversation

noahpistilli
Copy link
Contributor

In the KD request IOCTL_NWC24_REQUEST_GENERATED_USER_ID, the nwc24msg.cfg and nwc24msg.cbk have many of their fields edited, such as the Wii Friend Code and creation stage.

However, the checksum was not being written, causing whatever calls the request to delete the edited data and revert back to the default files.

By writing the checksum, the Wii Number is properly written along with the creation stage and increment id, which should allow for IOCTL_NWC24_REQUEST_REGISTER_USER_ID to properly be handled with the default Wii NAND in the future.

@AdmiralCurtiss
Copy link
Contributor

AdmiralCurtiss commented Dec 20, 2022

Sounds reasonable, but two things:

  • Is it necessary to write the backup file too? What exactly is the behavior of that on console, if you know it?
  • WriteCBK() and WriteConfig() are identical apart from the path; you can probably refactor that to one common function that you pass the path to.

@noahpistilli
Copy link
Contributor Author

It doesn't seem to be necessary to write the backup file, however that is what the console does when IOCTL_NWC24_REQUEST_GENERATED_USER_ID is called. I haven't observed any different behaviour if the file is not written, albeit there isn't much to observe as I do not know when IOCTL_NWC24_REQUEST_REGISTER_USER_ID is called.

Copy link
Contributor

@AdmiralCurtiss AdmiralCurtiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested.

@AdmiralCurtiss AdmiralCurtiss merged commit 4bc94e4 into dolphin-emu:master Dec 29, 2022
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants