Tuesday, January 8, 2013

Resetting and Unlocking a Nintendo DSi Parental Control Lock

So I inherited a nintendo DSi, and it had a parental lock code on it. I tried to brute force either the unlock code or the security question, but no luck. So I turned to Google and found this :
Wii Parental Control password reset tool .

Yes, it does say it is for the Wii, but Nintendo uses the same algorithm for the DSi.

To reset the Parental Control Lock for the Nintendo DSi
Go to:
System Settings -> Parental Controls -> Yes Change Parental Controls -> Pin I forgot -> security question I forgot ->  Get the Inquiry Number and write it down

Go to 
And enter the Inquiry Number as the Confirmation Number
And select the date that the DSi is currently set to.

This gives you an unlock code and you can enter it into the next screen on the DSi
Go back to the DSi and hit OK

Enter the unlock code and you will have access to the parental control panel where you can edit the PIN or turn it off completely.

Here is the code that actually calculates the algorithm, thought it was neat to see how the website works :

# Wii parental control password reset tool
# Copyright 2008-2009 Hector Martin Cantero <>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 or version 3 of the License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
import time, urlparse
def application(environ, start_response):
start_response("200 OK", [("Content-type","text/html")])
yield """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<title>Wii Parental Control Password Resetter</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
.title {
font-size: 18pt;
font-family: sans-serif;
.response {
font-size: 16pt;
font-family: sans-serif;
.error {
color: red;
font-size: 16pt;
font-family: sans-serif;
<div class="title">Wii Parental Control password reset tool</div>"""
uri = environ["REQUEST_URI"]
qs = urlparse.urlparse(uri).query
form = urlparse.parse_qs(qs)
ctime = time.time()
def opt_date(delta):
t = time.gmtime(ctime + delta * 3600 * 24)
if delta == 0:
selected = ' selected="selected"'
selected = ""
return '<option value="%02d%02d" %s>%s</option>'%(t.tm_mon,t.tm_mday,selected,time.strftime("%a, %d %b %Y",t))
class CRC32:
def __init__(self):
def crc32(self, input, crc=0xffffffffl):
count = len(input)
i = 0
while count != 0:
count -= 1
temp1 = (crc >> 8) & 0xFFFFFF
temp2 = self.table[(crc ^ ord(input[i])) & 0xFF]
crc = temp1 ^ temp2
i += 1
return crc
def gentable(self):
self.table = []
for i in range(256):
crc = i
for j in range(8):
if crc & 1:
crc = (crc >> 1) ^ 0xEDB88320l
crc >>= 1
def error(s):
return '<div class="error">%s</div>'%s
def process():
int(form["number"][0]) #validate
if len(form["number"][0]) != 8 or not all([x in "0123456789" for x in form["number"][0]]):
raise ValueError()
return error("Please provide a valid 8-digit confirmation number")
int(form["date"][0]) #validate
if len(form["date"][0]) != 4 or not all([x in "0123456789" for x in form["date"][0]]):
raise ValueError()
return error("Invalid date")
fullnum = form["date"][0] + form["number"][0][4:8]
crc = CRC32().crc32(fullnum)
code = ((crc ^ 0xaaaa) + 0x14c1) % 100000
return '<div class="response">Your unlock code:<span class="code">%05d</span></div>'%code
if form.has_key("submit"):
yield process()
yield """
<div class="form">
<form action="/parental.wsgi">
<p>Confirmation Number:
<input name="number" type="text" size="9" maxlength="8" value="" /></p>
<p>Current Date in your timezone:
<select name="date" size="1">"""
yield opt_date(-1)
yield opt_date(0)
yield opt_date(1)
yield """</select><br /></p>
<p><input name="submit" type="submit" value="Get Reset Code" /></p>
<a href=""><img
alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
<a href="">
<img style="border:0;width:88px;height:31px"
alt="Valid CSS!" />
<br />
<a href="parental.txt">Source code</a>


  1. Saved Christmas. Stupid shop selling second-hand DSis without checking for PINs...

  2. Nintendo PIN resets now make you pay $0.50 to get the master key, which is extremely annoying when you cant access a credit card.

  3. using nintendo 3ds, the inquiry code has an extra two digits. I forgot my pin, and dont have a credit card. pls halp!

  4. Mine had two extra digits as well. Did you find a solution?

  5. This actually worked. But what if it's used for malicious purposes?

  6. It's giving me 5 numbers and it's only got 4 sspots... this clearly does not work

  7. Someone please tell us what the algorithm is! This source code is confusing and I need someone to translate the source code into readable English that anyone can read and understand. I want to be able to look at the 8-digit code on the Parental Controls screen, do some work in my head, and figure out the master key, instead of having to go to that website, so I need the algorithm. Please translate this source code into an algorithm in the English language!