Admin

DSiWare Exploit Sudokuhax Release

Update: 28/01/2011 Nintendo removed Sudoku from the EUR/AU and USA DSi Shop. At the time of the USA Sudoku removal, there was 234 injection requests from the client software, and 1684 client software release archive downloads. The download/request ratio is large because there was several downloads per minute, while each user took several minutes to buy Sudoku and inject Sudokuhax, thus there was one injection request every couple minutes. Current download and injection stats are available here.

Update: 02/02/2011 USA Sudoku was removed from NUS, EUR Sudoku is still available on NUS but both aren’t available from any of the DSi Shop regions. None of the Sudoku regions were updated on NUS yet. And at this time when trying access the Sudoku page from DSi Shop “Account activity”, it displays an error saying this software was removed due to certain circumstances.

Update: 03/24/2011 USA Sudoku was updated and is now available on DSi shop again. EUR/AU Sudoku was not yet updated. On roughly 03/30/11, EUR/AU Sudoku was updated and is now available on DSi Shop. This update fixes all the Sudoku string bugs, and the game will check for Sudokuhax and delete it when detected. Sudokuhax is dead for this updated Sudoku version.

As you may remember we started looking at the DSi about two years ago. Despite some early attempts using savegame hacks for hybrid card games we eventually resorted to more complex attacks that involved soldering many wires to tiny points on the PCB to be able to trace and modify the RAM. However, doing this is not feasible for the average homebrew user so we used the knowledge we gained through these complicated attacks to get more information about the whole system which allowed us to experiment with DSiWare games in the end. We also learned how to create savegames so we can now do what we did three years ago with the Wii: Savegame hacks!

In early December we managed to get DSi mode code execution by exploiting the DSiWare application ‘Sudoku’ by EA. Sudoku is only available for regions USA and EUR/AU. Exploiting DSiWare is interesting because in DSi mode the DSi SD card slot is accessible, the whole 16MB RAM is available, and the CPU is clocked 2x higher than DS-mode. The max size of the embedded code that can be loaded directly via this exploit is limited so a small payload was needed to chain load to another application. Initially a wifi loader was used, but this was switched to load from the DSi SD card slot. The SD card loader boots /boot.nds from the SD card directly from Sudokuhax.

Sudokuhax will then be injected into the Sudoku application via client software. The client software uploads DSi-specific data from the Sudoku application to a web server, then injects the retrieved data into the Sudoku application.

Copy the output binary to SD card with the same filename as the original.

Launch Sudoku, then press button A or touch screen at the Sudoku title screen.

Now boot.nds on SD card will be run.

The data uploaded by the client software includes the anonymous DSi-unique console ID, and other data required for modifying the Sudoku binary on SD card. This data is used for logging unique web server requests.

The client software is available here. The tracker for the client software and Sudokuhax is available here. Client software source code licensed under GNU GPLv2 is available here.

SifJar: We’re working on a libnds patch for DSi sdmmc. SD card can’t be used with old homebrew via DLDI since the MMC bus is arm7 only, homebrew will need rebuilt with latest libnds once support is added.

popoffka: Only if Nintendo doesn’t block it by then, and only on USA/EUR 3DS since Sudoku is USA/EUR only. But it’s likely(a guess) 3DS has a DSi-mode, where 3DS-only hw is disabled.

Fantastic work guys, this exploit was really easy to do, and now I’ve managed to test some homebrew.

First I tried WordUp.nds, it’s a puzzle game.
Didn’t work, it was stuck on the enable/disable highscore screen.
Then I tried a version of NESDS with an injected NES rom, it just failed to boot.
Next I tried Phidias, a painting homebrew. That would get to the canvas size option, but couldn’t get past it.
Then I tried Pocket Physics, I was able to get into the main game in that, but then that’s when I realised, the touch screen wasn’t working!

Weird huh? This exploit and the touch screen just don’t seem to agree! Button inputs work just fine though.

@nitro2k01 : to late lol. alot of us have the nds now and im sure the important ppl have more methods to get in aside from this & the hacks from wntrmute
AND, im not sure if they’d do anything since they are earning money on this.
and if they do; why not just delete the game?

[…] Team Cyclops released the firmware and tools for their card YellowStar made an announcement over on hackmii.com of a DSiWare savegame exploit which allows us to boot code from the internal SD card on the DSi. […]

[…] Perhaps most exciting for homebrew developers, this breakthrough brings the DSi’s hardware upgrades (over the original DS) into play. “In DSi mode, the DSi SD card slot is accessible, the whole 16MB RAM is available, and the CPU is clocked 2x higher than DS-mode,” Twiizers notes in on post on HackMii. […]

[…] Perhaps most exciting for homebrew developers, this breakthrough brings the DSi’s hardware upgrades (over the original DS) into play. “In DSi mode, the DSi SD card slot is accessible, the whole 16MB RAM is available, and the CPU is clocked 2x higher than DS-mode,” Twiizers notes in on post on HackMii. […]

The game was pulled from the Australian shop at around the same time as the European shop. I guess you guys don’t care since the two seem to be identical to each other but I think it’s worth updating the first sentence for completeness’ sake and to not get any Australian’s hopes up.

How portable is this exploit (to other games)?
Also: Shouldn’t you be able to release a redistributable installer now? This will be legal because the Sudoku game won’t work, it will have been recompiled/edited/whatever to load your code.
For you to get the keys, all you have to do is find the encryption key based off of the DSi Browser and then you can re-encrypt your exploited sudoku.
I could just be speaking out of my ignorance though…

oldtopman: If you’re asking something like “can you make a injection app, which generates the the content key and encrypts the copyrighted .nds and sudokuhax”, then no. Tad(DSiWare exports) content crypto uses AES engine F(X^Y) where F is an unknown function implemented in AES engine, thus it can’t be de/encrypted on PCs.(linux/win32 etc) Also, we can’t do something like that without leaking a DSiWare .nds(however arm7i/arm9i bins would be still encrypted, decrypted bins are required for booting it) and it’s illegal to redistribute copyrighted software like that.

winmaster: See comment #6, 3DS DSiWare probably would have 3DS-hw disabled. Thus there’s not much point in 3DS DSiWareHax for using 3DS-hw directly from the exploit. Slot1 access via DSiWareHax is impossible. Hw that is disabled can never be enabled again without a hard-reset.(power button etc)

Well, with how fast Nintendo pulled the affected game from its market, DSiWare-based exploits are going to be a hell of a lot harder. But hey, at least EA sold 200 more copies of this game in the span of a few hours, and Nintendo made a small commission from each one!

winmaster: We currently are not aware of any title launching vulns that could allow a DSi HBC. And you can’t modify launcher/sysmenu or any title since the RSA signatures are verified on launching, the .nds itself is signed. I’m assuming that launcher disables slot1 automatically during title launching, regardless of bits in the header.
Any specific reason why you want slot1 access?

This might sound like a stupid question, but would it be possible for a DSi homebrew to switch to DS mode and allow loading older non-DSi homebrew? a lot of homebrew is now either abandoned (and closed source) or wont easily (or at all) compile with recent dkp builds.

Thought: DSDownloadPlay must have slot1 access because Pokemon Black and White can use it to access your savedata on a Diamond/Pearl/Platinum card, so shouldn’t there theoretically be some way to launch a title without disabling slot1?

BTW, everyone says that exploiting DSDownloadPlay is impossible, but I don’t think I’ve ever seen a reason why except for the fact that it would be DS mode, which is undesirable.

winmaster: Yes that does have slot1 access but it’s ds-mode so exploiting it is rather pointless. There’s no reason why dlplay second-stage wmb loaders couldn’t be exploited. I actually have an exploit for a WMB bin but releasing it doesn’t have much point for DSi-mode since WMB is DS-mode. I can’t legally release it if I wanted to: would need to redistribute the copyrighted JP DS Station WMB bin, and people would need to either setup a softAP or change their router SSID/WEP key.

Zachary: What exactly do you mean? We’re working on more exploits, we can’t do much about Nintendo removing the targets so fast besides more hax.(Would be nice to exploit a popular DSiWare, presuming that Nintendo would care enough about profits to not remove it.)

Nathan: Currently since we’re not aware of any vulns that could allow a DSi HBC, so just load full DSi-mode homebrew from SD card, which Sudokuhax already does.

spinal_cord: Only launcher/sysmenu can activate DS-mode, DSiWare exploits can’t access the registers for that since the titles’ arm7 crt0 disables access to those registers. Even if that was possible, the loaded homebrew couldn’t access SD card in ds-mode and would have to use flash card for FAT.

spinal_cord & yellows8: In addition to what yellows8 said, even if it were possible to switch to DS mode, surely a flash card couldn’t be used for FAT because slot-1 can’t be accessed once DSiWare has been launched? Or would that be negated by theoretical DS mode activation?

RuinPf: That’s the first I’ve heard of that fail, but apparently other people have been getting the same server decryption fail error since release day: there’s a total of 75 hits for that error. We’ll work on this elsewhere, send me an email to the address on here: http://dsibrew.org/wiki/DSiWare_VulnList

igeek5: Yeah we’re looking for more exploitable games. Sudoku had a savedata ASCII string buffer overflow. Flipnote uses UCS-2(UCS-2 isn’t exploitable) we haven’t found anything in flipnote and opera there’s nothing useful in savedata either. Basically we managed to exploit Sudoku not free titles because Sudoku used sprintf and strcpy, the free titles use UCS-2 for strings if anything.

I was browsing the DSi Shop today and I noticed several other EA titles on there.

Considering that EA has already produced a title that was exploitable, why don’t we take a look at some of their other titles on the DSi Shop and see. I think I recall a Texas Hold ‘Em software there too or something like that. Not to mention there is other software in the 200 points section that is shovelware basically, and would likely be easy to exploit. I hope someone takes a look into that. XD

You didn’t catch my intent proper, if I were skilled enough to test these vulns myself I would. :/

However I don’t have skill to test them, and I likely wouldn’t know a vulnerability even if it slapped me in the face and raped me unless there were an already compiled program to plug the data into that plugs code in wherever it can and returns a visible “You found an exploit!” message. >_<

Pachi: “If you know of DSiWare that has English-only string(high-scores, player name, high-scores that use username from system settings, etc) input, mention it on IRC EFNet #dsidev.” You’d only need to get some targets, we’d modify the tads(.bin files exported from data management) for you.

DsProjekts: Exported DSiWare from data management are locked to the console it was exported from, attempting to copy someone else’s old Sudoku tad to your DSi will not work.(Tad header MAC address and tmd/srl console-unique keys would be different)

Tux: Did you mean DSiWare? Other DSiWare can be exploited of course.(But I doubt the DSiWare which comes with XL is exploitable, not much in the saves for those) DSi photo app uses .jpg not .bin.(And no-one managed to crash the photo app either)

DsProjekts: The only way to get you a vulnerable Sudoku tad would be to re-encrypt the console-unique encrypted sections, but we can’t do that with a web server. And we won’t do that manually either, just wait for other dsiwarehax.

Yes other dsiwarehax should work on 3DS though in dsi-mode.(With eshop in late May) Transferring hax via the DSi->3DS system transfer should work, but if they changed the dsiware SD card export format/keys 3DS uses, hax couldn’t be injected that way for a long while.

Yeah once you update to 1.4.4 *all* means of DSi-mode code exec are dead unless you already had DSiWareHax prior to 1.4.2. With 1.4.2+ the only way to get DSiWareHax, is to solder your DSi to dump NAND, and extract dev.kp from it.