Projects 🔸 Articles 🔸 Categories 🔸

DoujinSoft x RiiConnect24 - A technical breakdown

I've recently dug out the old DoujinSoft codebase to interop with RiiConnect24.
It's made in Java because I use a Swing GUI application as a dependency to handle all the WarioWare proprietary file-format decoding. You expecting me to learn reverse-engineering or something? 🐱‍👓

Thanks to the RiiConnect24 guys giving me the keys to the castle (a fake Wii friend number and some debug tools), I set out to finally give people an easy way to get games from DoujinSoft directly to their console.

d i r e c t l y
papa iwata this one's for you

📧 A quick primer on WiiConnect24 📧

The flowing light on the Wii is timed with the bird call of the Japanese bush warbler.

WiiConnect24 was the cool name given by Nintendo to half of the Wii's networking features. (The other half being Nintendo Wi-Fi Connection) According to marketing, all it does is download data when the Wii is in standby mode, but it actually handles a bit more than that, namely:

The funny thing about WC24 is how it handles messaging: If you ever had a Wii back in 2006 you might have noticed you could add non-Wii devices as friends through their email address, and subsequently send and receive e-mail to/from them.

has anyone ever added a cellphone to their friends tho
PC users would see your Wii represented by a email address.
I always thought it was really cool of Nintendo to implement this extra layer of communication to the console! I mean, they had to do some extra work for this whole email integration to work, right?


The truth is a bit more grounded and the opposite of my assumptions:
All of WiiConnect24's messaging is handled by emails. All of it.

Date: 02 Jul 2019 18:02:00 -0000
Message-Id: <>
X-Wii-AppId: 2-48414541-0001
X-Wii-Cmd: 00044001
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-16be
Content-Transfer-Encoding: base64

AEIAYQB6AGkAbgBnAGE= (decodes to "Bazinga")

A message between two Wiis really is just an email with a few custom headers, as seen above.
The upside is that this makes it extremely easy to understand how a game sends data, and how to fake it.

🤜 Being friends 🤛

For DoujinSoft to be able to send emails/content to other Wiis, said consoles must add our Wii number as a friend.
Surprisingly and (probably)unlike Nintendo's future implementations, the server doesn't track who's friend with who; All negotiation is done directly between the consoles.

A Wii sending a friend request to another will send an email looking a bit like this:

Message-Id: <> 
Subject: WC24 Cmd Message 
X-Wii-AppId: 0-00000001-0001 
X-Wii-Cmd: 80010001 
MIME-Version: 1.0 
Content-Type: multipart/mixed; 


Content-Type: text/plain; charset=us-ascii 
Content-Transfer-Encoding: 7bit 

WC24 Cmd Message 


Content-Type: application/octet-stream; 
Content-Transfer-Encoding: base64 
Content-Disposition: attachment; 



Here, Wii number 7475 3286 1722 5276 sent a friend request to Wii number 2227 5376 9960 6042.
X-Wii-AppId and X-Wii-Cmd are changed from the defaults used in regular messages to inform WiiConnect24 this message is a Friend Request. (And therefore, it's not shown to the user on his console)

If the other Wii sends a similar message the other way then presto! The consoles are friends.

As a result, this is pretty easy to replicate for DoujinSoft: When the user gives us the Wii number to send content to, we send this mail beforehand to act as the friend request.
This approach requires the user to add our number to their console beforehand, which isn't too bothersome.

🚚 Sending the goods over 🚛

If you've read the other article, you know that our final objective is to send WarioWare DIY content to other Wiis through WiiConnect24.
You've probably guessed then that when sending content to your friends from the game, it actually sends... emails.

The example below is for a Record, the lightest content in DIY, weighing at 8KB. Makes for a shorter email here:

Message-Id: <>
Subject: RR
X-Wii-AppId: 0-57413445-3031
X-Wii-IconNew: 57413445
MIME-Version: 1.0
Content-Type: multipart/mixed;

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Content-Type: application/octet-stream;
Content-Transfer-Encoding: base64
Content-Disposition: attachment;



You'll notice X-Wii-AppId changed once again alongside a new header called X-Wii-IconNew, this time to match the title ID of the Wii game, DIY Showcase.

X-Wii-IconNew tells the Wii System Menu that the game's channel icon has to be updated. Here, this is used to show a small envelope when you have content incoming.

The Game/Record/Comic itself is just added as an attachment to the mail. It's compressed using LZ10, a variant of the LZSS compression algorithm Nintendo likes to use in GBA/NDS games.
Past that, it's base64-encoded, as specified in the mail's Content-Transfer-Encoding header. (base64 encoding is a classic when doing stuff with WC24)

Once again, doing this from DoujinSoft is as easy as sending mail over to the Wii console.
Man, that was a bit too easy in hindsight, wasn't it? Let's push this a bit further.

🎁 Bonus Round: Custom Wii Message Board letters 🎁

Remember receiving cute customized letters from Nintendo or other games?
Games or channels, when pushing email to the Message Board, had the option to add custom data to change the envelope, the stationery used, and add a sound effect when opening the message.

This was a bit of an underused feature even back when the Wii was an active console, with most of Nintendo's own big games (Mario Galaxy, Smash Bros. Brawl) sending stuff with the default envelopes.
Some games did use it to great effect, and it always felt a bit special to receive a custom letter.

There's little documentation about the custom stationery, but studying message board exploits quickly shows they're just email attachments as well, similar to DIY's games. 🧐

X-Wii-AppId: 2-354E4541-4142
X-Wii-Cmd: 00042019
X-Wii-MB-NoReply: -
MIME-Version: 1.0
Content-Type: multipart/mixed;

Content-Type: text/plain; charset=utf-16be
Content-Transfer-Encoding: base64


Content-Type: application/x-wii-msgboard;
Content-Transfer-Encoding: base64
Content-Disposition: attachment;



I've cut the actual data here as this stuff is getting real damn long, but I've added a few fun extras to demonstrate what can be done with WiiConnect24 mail:

  • Yet another X-Wii-AppId/X-Wii-Cmd combo: At this point I'll admit I have no idea what this one does and just wholelifted it from messages sent by the Wii.
  • X-Wii-AltName allows you to show a name of your choice on the envelope instead of the name the Wii gave your friend number; Useful for us as DoujinSoft is a household name, god dang it!
  • X-WiiFace is a base64 encoded Mii, that appears on the upper-left side of the envelope. This works for regular and custom envelopes without a hitch: In fact the Wii gives exactly zero fucks what your custom graphics are and will draw on top of it relentlessly.
    lookin cool
  • X-Wii-MB-NoReply disables the "Reply" button for this message.
  • And the final piece, the custom stationery, is stored as an attachment with Content-Type x-wii-msgboard. The graphics themselves are wrapped in a U8 archive(crazy how many file formats you only ever encounter when dealing with Nintendo stuff), and base64-encoded as per the norm.

The result looks like this!

Really gives us that fun, almost-official flair.

Final spare thoughts

  • The envelope notifications from X-Wii-IconNew take region into account, unlike(thankfully) everything else: DoujinSoft's emails are sent using the US title ID, so other regions sadly miss out on the envelope icon for their channel.
    Luckily, the bonus custom letters kinda mitigate that by acting as a notification.

  • LZ10 compression turned out to be a bitch to find proper implementations for; I used a C library which I compiled and bound to the Java code using JNA, turning the DoujinSoft server into an even bigger Frankenstein's monster. 👍

I might write a second, clean server to collect emails from users when I get around to implementing survey box responses and games sent to the store from users' Wiis.


Wiibrew's breakdown of WC24 email
More WC24 details from Wiibrew
Wii mail headers
All the official stationery, ripped by RiiConnect24.
Said stationery in decoded image form if you just want to take a look