News for hackers. Stuff that matters.
Re:Hacking the Nintendo DSi Browser by tpmx on Friday March 03, 2023 @03:53PM (#35014850)
> I managed to exploit the Nintendo DSi browser 15 years after it was released

I guess that was inevitable. So much exposed code over so much time.

I remember having a bunch of lunch/dinner discussions about this browser with the two developers actually doing that port in ~2005. It was a super secret and exciting project back then.

We worked in the same small Opera Software office of 30 people or so. They were really frustrated with the code footprint limitations of the DS.

Re:Hacking the Nintendo DSi Browser by mod50ack on Friday March 03, 2023 @04:17PM (#35015129)
The DSi Browser was an updated version of that original DS Browser. Don't know if it was based on the old port, or if it was redone. The DSi was more capable than the original DS, and the browser had to be redone because the old GBA-slot RAM cart was no longer supported. They switched the base to a considerably newer version of Opera. As a major advantage, the browser actually shipped with the DSi, making it much more useful than the two-cartridge getup necessary for the original DS (which, in the end, very few people ended up getting for that system).
Re:Hacking the Nintendo DSi Browser by Wowfunhappy on Friday March 03, 2023 @05:55PM (#35016145)
The DSi browser was also actually good. I preferred it (by a mile) to the 3DS browser. Actually, I liked it more than the browser on my iPod Touch, because it used the dual screens to make it easier to browse websites formatted for desktops. (Responsive design wasn't a thing yet).

The original DS browser, by contrast, was an unbelievably slow nightmare. I'm sure they did what they could with the hardware that was available. But the result was barely usable.

Re:Hacking the Nintendo DSi Browser by tpmx on Friday March 03, 2023 @06:08PM (#35016256)
I'm pretty certain the same team made that DSi update. I think they added one more developer.
Re:Hacking the Nintendo DSi Browser by hbn on Friday March 03, 2023 @04:17PM (#35015120)
Was the DSi browser based on the same code as the DS browser?

The DS browser (which seems to be what you're talking about) was 2 physical cartridges, one that slotted into the regular DS game slot and an 8GB memory expansion cart that went in the GBA slot. The DSi's browser was built in, and the system didn't even have a GBA slot.

Re:Hacking the Nintendo DSi Browser by mod50ack on Friday March 03, 2023 @04:18PM (#35015136)
They were certainly both based on Opera. Don't know to what extent the DSi port was based off its predecessor, though.
Re:Hacking the Nintendo DSi Browser by Matheus28 on Friday March 03, 2023 @04:21PM (#35015195)
8 MB*
Re:Hacking the Nintendo DSi Browser by hbn on Monday March 06, 2023 @02:25PM (#35046288)
Yup, whoops!
Re:Hacking the Nintendo DSi Browser by KeplerBoy on Friday March 03, 2023 @04:48PM (#35015501)
was it really 8 GB? Seems like a lot for 2006-ish.
Re:Hacking the Nintendo DSi Browser by strangecasts on Friday March 03, 2023 @05:34PM (#35015964)
It was 8 megabytes, I suspect it was a typo
Re:Hacking the Nintendo DSi Browser by strangecasts on Friday March 03, 2023 @04:09PM (#35015024)
> They were really frustrated with the code footprint limitations of the DS.

As in the memory or the final binary size? I would have thought memory management was the tricky part -- even with the mandatory 8 MB expansion in the GBA slot -- but I suppose they would have been under even more pressure to fit it onto the smallest cart possible, with the cost of the expansion pack added for every unit

Re:Hacking the Nintendo DSi Browser by tpmx on Friday March 03, 2023 @04:25PM (#35015228)
Now you're making me uncertain. I was pretty certain it was the code/binary footprint. I remember suggesting they look into using any MMU for doing code overlaying/swapping [and the DS doesn't appear to have one...].

The browser code back then was very memory efficient after having gone through so many memory usage optimizations triggered by lots of mobile platform ports.

It was a really long time ago, sorry :)

Re:Hacking the Nintendo DSi Browser by strangecasts on Friday March 03, 2023 @04:45PM (#35015462)
No worries! It does sound likely, it was definitely from a time where people had to do everything they could to fit games onto the cartridges!

The Wikipedia page [1] claims* they had an MMU on the expansion cart - so they could have taken your advice :)

* I couldn't find a source, and AFAICT the DeSmuME emulator [2] seems to treat it like a big chunk of linear memory?

[1] https://en.wikipedia.org/wiki/Nintendo_DS_Browser#Memory_Exp... [2] https://github.com/TASEmulators/desmume/blob/master/desmume/...

E: I forgot about the mobile Opera ports, that also tracks - I'd love to read about the engineering that went into them!

Re:Hacking the Nintendo DSi Browser by tpmx on Friday March 03, 2023 @05:46PM (#35016066)
> E: I forgot about the mobile Opera ports, that also tracks - I'd love to read about the engineering that went into them!

Can't really meaningfully expand on that, most of that happened before I joined in 2004, but I can tell you that the fact that Opera was extremely memory efficient made Opera Mini (250M monthly uniques, 150k web page transcodes/s) economically possible starting 2005.

We needed to keep the browser/window state around for each user until they clicked the next link. If we threw it out, any javascript state would be lost.

Re:Hacking the Nintendo DSi Browser by strangecasts on Saturday March 04, 2023 @09:55AM (#35021158)
That's fair - those are very impressive numbers!

Reading about Mini doing layout specifically for devices with <128px wide displays, I wonder how well today's responsive design frameworks would deal with that...

Re:Hacking the Nintendo DSi Browser by orangewindies on Saturday March 04, 2023 @03:01PM (#35023957)
Mini did some tricks so the "display" was much wider than the device display but text columns were wrapped at device display width. So you you could zoom out and see the whole page but the text was readable when you zoomed in.
Re:Hacking the Nintendo DSi Browser by gsnedders on Saturday March 04, 2023 @10:05AM (#35021266)
As a former colleague who does remember (hi!), it is indeed the case that they had an MMU doing code swapping, along with extra RAM on the cartridge.
Re:Hacking the Nintendo DSi Browser by tpmx on Monday March 06, 2023 @01:42PM (#35045575)
Hi! Do you remember what the limit was that prompted this costly measure? Addressable code space from the CPU? How could there be a limit in the megabytes, not gigabytes? I don't get it.
Re:Hacking the Nintendo DSi Browser by gsnedders on Monday March 13, 2023 @11:25AM (#35136989)
Executable code space from the CPU was the limitation; I forget if this was lower-level software or hardware.
Re:Hacking the Nintendo DSi Browser by razor_router on Friday March 03, 2023 @10:55PM (#35018007)
I'm impressed that someone was still able to exploit the Nintendo DSi browser 15 years after it was released - that's quite the accomplishment! It's certainly commendable that you and the two developers dedicated a lot of time and effort to porting the browser. That said, I do think the fact that the code was exposed for so long played a factor in the exploit happening. With cyber security being such a critical issue nowadays, maybe it would have been best to have more resources available and look into ways to secure it better further down the line.
Re:Hacking the Nintendo DSi Browser by Gigachad on Friday March 03, 2023 @11:54PM (#35018314)
Reads like a ChatGPT comment.
Re:Hacking the Nintendo DSi Browser by dang on Saturday March 04, 2023 @12:18PM (#35022507)
Could you please stop doing this?
Re:Hacking the Nintendo DSi Browser by dekoruotas on Friday March 03, 2023 @05:21PM (#35015843)
DSi is my favourite console for older Nintendo games. Custom firmware gives access to the DS library and it emulates GBA well.
Re:Hacking the Nintendo DSi Browser by vanilla_nut on Friday March 03, 2023 @07:27PM (#35016845)
Agreed. There's something very special about playing it all on Nintendo hardware. Unfortunately a couple of my favorite games have freezing issues when emulated on the DSi.
Re:Hacking the Nintendo DSi Browser by 10729287 on Saturday March 04, 2023 @08:37AM (#35020682)
If you are talking about DS games (so not emulated), they may need to be "AP-Patched".
Re:Hacking the Nintendo DSi Browser by houli on Saturday March 04, 2023 @03:17PM (#35024096)
Twilight menu has all of those patches and applies them on the fly
Re:Hacking the Nintendo DSi Browser by manaskarekar on Friday March 03, 2023 @07:36PM (#35016903)
If you step up to the DSi XL, it’s arguably even better - both displays are IPS.

I use mine with one cart only - Chrono Trigger.

Re:Hacking the Nintendo DSi Browser by ranger207 on Friday March 03, 2023 @07:47PM (#35016975)
Just curious, any reason you prefer the DSi over the 3DS?
Re:Hacking the Nintendo DSi Browser by ace2358 on Friday March 03, 2023 @08:55PM (#35017357)
DSi are quite cheap and available compared to the 3DS which is a lot pricier. And dsi is quite sleek and simple (like the old iPods) compared to the 3ds line which got quite large and heavy (which a lot of People prefer)
Re:Hacking the Nintendo DSi Browser by p1necone on Friday March 03, 2023 @10:18PM (#35017815)
Not OP, but imo the game library on the DS was better (the 3ds also had plenty of great games, just not as many). You do have to sift through an unusually large amount of shovelware to find the good stuff though, similar to the Wii.

Of course you can play DS games on 3ds, but you have to choose between blurry non integer scaling to full screen or crisp native but small with black borders. The games look better running at native res on the big screen of the DSi XL.

Re:Hacking the Nintendo DSi Browser by Gigachad on Friday March 03, 2023 @11:52PM (#35018302)
Personally the DS/i was just a bigger part of my life. The 3DS homebrew scene is a lot bigger but I still just love messing with the exact ds I used when I was in school.
Re:Hacking the Nintendo DSi Browser by frosted-flakes on Saturday March 04, 2023 @12:08AM (#35018371)
In addition to the reasons others have stated, old games are designed with a D-pad in mind, not a circle pad/joystick, and the D-pad on the 3DS is in a slightly awkward position.
Re:Hacking the Nintendo DSi Browser by chris_armstrong on Friday March 03, 2023 @07:21PM (#35016802)
Awesome to know with my limited exploit analysis experience that NOP sleds are still a thing
Re:Hacking the Nintendo DSi Browser by charcircuit on Friday March 03, 2023 @09:03PM (#35017407)
>still a thing

This is targetting a piece of software and operating system from 15 years ago.

Re:Hacking the Nintendo DSi Browser by Willish42 on Friday March 03, 2023 @09:14PM (#35017463)
This is a fascinating write-up. As somebody who's dabbled with homebrew a bunch over the years I've always wondered how one figures out exploits from scratch.

Nintendo is pretty litigious about this sort of stuff but I guess because this is such an old system they're able to get away with documenting exploit process like this.

Does anybody on HN know of other similar eng-focused guides for this sort of stuff out in the wild, or authors to follow?

Re:Hacking the Nintendo DSi Browser by Tijdreiziger on Saturday March 04, 2023 @08:34AM (#35020657)
The Chaos Computer Club archives have some amazing talks on console hacking: https://media.ccc.de/search/?q=console+hacking (most of them are also on YouTube)

One of the prominent figures out of that scene, marcan, is now leading the Asahi Linux (i.e. Linux on Apple Silicon) project.

(Another, bushing, sadly passed away in 2016: https://hackmii.com/ben. RIP.)

Re:Hacking the Nintendo DSi Browser by strangecasts on Saturday March 04, 2023 @09:23AM (#35020923)
The International Journal of Proof of Concept or GTFO (https://www.alchemistowl.org/pocorgtfo/) is a fun compilation of reverse-engineering efforts with a bent towards older systems - issue 0x2 has an article on getting RCE on a Tamagotchi :D
Re:Hacking the Nintendo DSi Browser by userbinator on Friday March 03, 2023 @11:51PM (#35018297)
For those wondering about the hardware: 16MB of RAM, 133MHz ARM9, and 33MHz ARM7. 256MB of internal storage.

In other words, it's comparable to an early 90s PC. The fact that it can run a browser, complete with JS support, seems nearly unbelievable these days.

Re:Hacking the Nintendo DSi Browser by wh0thenn0w on Saturday March 04, 2023 @12:56AM (#35018587)
Keep in mind, it used Opera Mini, so no actual JS was run on the device. It was rendered server side and an "image" (draw instructions, really) was essentially sent as a response.
Re:Hacking the Nintendo DSi Browser by ipwndev on Saturday March 04, 2023 @01:31AM (#35018737)
This is incorrect - you can run base64 bookmarklets without network. It is running a highly stripped down version of Presto. Opera Mini did use 'server side rendering' while this is handled on the device.

https://grumpy.blog/en/nintendo_dsi_browser/

Re:Hacking the Nintendo DSi Browser by userbinator on Saturday March 04, 2023 @02:01AM (#35018853)
Twitter’s mobile site, for instance, is looking pretty good.

That surprised me as I wondered just how much JS capabilities the browser has; then I realised that article was written in 2013, when Twitter was still relatively sane and not the bloated SPA it is today (yet the actual content being displayed is not much different from 10 years ago.)

Re:Hacking the Nintendo DSi Browser by ipwndev on Saturday March 04, 2023 @02:21PM (#35023630)
To me, that is the most heartbreaking part - the only thing that has changed is bloat. Hackernews still works pretty well on the platform.

The old-net kind of works on the DSi's browser, utilizing snapshots. But SSL issues today have also made the browser quite cumbersome.

Re:Hacking the Nintendo DSi Browser by anthk on Saturday March 04, 2023 @03:10PM (#35024038)
Opera mini 4 and 5 supported a bit of JS.
Re:Hacking the Nintendo DSi Browser by pjmlp on Saturday March 04, 2023 @05:34AM (#35019866)
Windows 95 hardware requirements, if anything it is a testament to how bloated everything has become.
Re:Hacking the Nintendo DSi Browser by extrememacaroni on Saturday March 04, 2023 @07:41AM (#35020383)
When you turn off the DSi and forget about it for 6 years, it'll still have plenty of battery left when turned on.

When I turn off my laptop on battery the next day it's dead because for some stupid reason we can't even get turning devices off right anymore.

Re:Hacking the Nintendo DSi Browser by anthk on Saturday March 04, 2023 @03:22PM (#35024141)
Well, Retrozilla runs fine under w98 and 32MB of RAM.
Re:Hacking the Nintendo DSi Browser by Razengan on Saturday March 04, 2023 @01:36AM (#35018755)
Has anyone tried developing for the Steam Deck? Yes "it's just a PC" but I mean making a game optimized for the Deck's screen size and controls, something that many devs get wrong on the Nintendo Switch where the text is too tiny in handheld mode and the UI is too cluttered.

Valve should let the Deck be targeted as a standalone platform in its own right, rather than a PC that just happens to be portable. Let there be a dedicated SDK and APIs that let us just optimize for the Deck without worrying about how a game might look or run on a proper desktop/laptop.

Re:Hacking the Nintendo DSi Browser by browsertasker on Saturday March 04, 2023 @10:14AM (#35021337)
Excellent post, Thanks.