deviant ART

[x]

~WindyPower:iconWindyPower:

Wind, Guide Me.  

  • Status: Member
  • Web Developer
  • Male/Canada
  • Invisible
  • Deviant since Oct 15, 2005, 7:49 AM
  • 166 Deviations
  • 33 Scraps [browse]
  • 2,822 Deviation Comments
  • 1,178 Deviant Comments
  • 10 News Comments
  • 13,234 Pageviews

[Wii Hack] Tiny DNS Server in Python

Journal Entry: Mon Mar 24, 2008, 5:24 PM
I've recently stumbled upon a video featuring the Wii Shop Channel being used as a web browser.
The trick is here is to get your Wii to use a custom DNS server which returns, on purpose, an invalid IP for the Wii Shop website. As a result, the Wii Shop Channel, which is in fact a stripped-down version of the Wii Browser, goes on that site instead of the normal Wii Shop.

As you might expect, the temptation was too great; I had to fiddle with this myself. After failed attempts at getting some DNS server software running on my computer, I decided to make my own. I taught myself Python and, within about 3 hours, had a custom little DNS server running on my machine.
Here's the code:
import socket
import sys

def getip(domain):
if domain[-12:]=='shop.wii.com':
return '71.18.85.26'
# Some elif's could be added here in order to remap other IPs.
else:
return socket.gethostbyname(domain)
def char(x):
return chr(int(x,10))
print 'DNS server launched'
sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.bind(('',53))
try:
while 1:
data,addr=sock.recvfrom(1024)
index=12
domain=''
curcode=ord(data[index])
while curcode!=0:
domain+=data[index+1:curcode+index+1]+'.'
index+=curcode+1
curcode=ord(data[index])
domain=domain[:-1]
ip=getip(domain)
print 'Domain requested: '+domain+', IP returned: '+ip+'.'
ret=data[:2]+'\x81\x80'+(data[4:6]*2)+('\x00'*4)+data[12:]+'\xc0\x0c'+('\x00\x01'*2)+('\x00'*3)+'\x3c\x00\x04'+str.join('',map(char,ip.split('.' )))
sock.sendto(ret,addr)

except KeyboardInterrupt:
print 'Shutting down server'
sock.close()
Here's the colored and correctly tabbed code. (click me instead of having to suffer deviantArt's sucky support for code!)

Now what happened is that, occasionally, the Wii Shop showed a blank page, sometimes not. In either case, it showed an error message about the page having "timed out".
That's a problem I couldn't solve, despite changing the "fake" IP or giving the same IP for any host instead of just *.shop.wii.com.

Since I do have the full, official Wii Browser on my Wii, this might seem pointless. But as a geek and as it could be helpful to some people out there, I just had to try. So I'm launching this code just like a bottle in the sea. It's a project that you guys might want to catch, and if you do, thank you~
Anyone can also use this code if needed, it's a simple and very short DNS server.

Now, what if I, instead of tricking the Wii's DNS server settings, what about... The proxy settings? :plotting: Will look into those next weekend...

  • Mood: Mesmerized
  • Listening to: Daft Punk - Aerodynamic
  • Reading: My daily RSS feeds are longer than a book
  • Playing: Lol playing, I wish I still had time for that

Devious Information

  • Current Age: 16
  • Current Residence: \/\/!11 |\|07 7311, 637 !7 ?
  • Interests: Programming stuff
  • Favourite movie: None, I hate sopa operas...
  • Favourite poet or writer: Axidus, and his uber-awesome HS's.
  • Operating System: Multiple
  • MP3 player of choice: N/A
  • Wallpaper of choice: Just one color...
  • Favourite game: Zelda/Mario/Metroid, you know, classical Nintendo games...
  • Favourite gaming platform: GameCube, Wii, DS~
  • Personal Quote: ...
  • Tools of the Trade: Photoshop, Paint Shop Pro, Ultra Fractal, Apophysis, Flash, Dreamweaver, Camtasia, POVRay,openCanvas

deviantART Notice

Devious Comments

Hidden By Owner
~MyShiningCollection:iconMyShiningCollection: Mar 12, 2008, 2:40:24 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
*emmejay-fwz:iconemmejay-fwz: Feb 25, 2008, 4:26:22 AMComment hidden by Owner
This comment is hidden and not visible to general public.
~horny-cow:iconhorny-cow: Feb 7, 2008, 9:02:50 PM
Hey Windy, you don't remember me, but I just decided to check up with ya, it's Moo :icononigirixgurl91: on a new account :wave: I love your new fractals,you've really improved, you are so talented! :D

--
"...If I was completely predictable, but trying to be random, I would be Family Guy."--The Ninja from 'AskaNinja.com
Hidden By Owner
~berrywhitesnow:iconberrywhitesnow: Dec 27, 2007, 2:01:34 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~DarkIgnis:iconDarkIgnis: Dec 18, 2007, 2:33:03 PMComment hidden by Owner Mood: Love
This comment is hidden and not visible to general public.
Hidden By Owner
~WindyPower:iconWindyPower: Dec 16, 2007, 2:31:38 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~DarkIgnis:iconDarkIgnis: Dec 9, 2007, 11:48:17 PMComment hidden by Owner Mood: Love
This comment is hidden and not visible to general public.
Hidden By Owner
*RCPage:iconRCPage: Dec 8, 2007, 3:06:13 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
=Pyritie:iconPyritie: Oct 30, 2007, 1:12:17 AMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
=Pyritie:iconPyritie: Oct 27, 2007, 1:44:03 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~Viirus007:iconViirus007: Oct 27, 2007, 3:07:51 AMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
*yuki-yue:iconyuki-yue: Sep 2, 2007, 7:38:44 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~rosiejanet:iconrosiejanet: Aug 25, 2007, 9:33:22 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~WindyPower:iconWindyPower: Aug 25, 2007, 8:40:08 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
*Fraxa:iconFraxa: Aug 17, 2007, 4:17:31 AMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~WindyPower:iconWindyPower: Aug 12, 2007, 2:31:38 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~AttentionSpanOfNone:iconAttentionSpanOfNone: Jun 12, 2007, 5:31:52 PMComment hidden by Owner Mood: Joy
This comment is hidden and not visible to general public.
Hidden By Owner
~kosplay:iconkosplay: Jun 8, 2007, 4:10:29 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~WindyPower:iconWindyPower: Jun 8, 2007, 2:50:13 PMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~kosplay:iconkosplay: Jun 6, 2007, 11:48:35 AMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~JaanekX:iconJaanekX: Jun 1, 2007, 4:50:33 AMComment hidden by Owner Mood: Noble
This comment is hidden and not visible to general public.
Hidden By Owner
~WindyPower:iconWindyPower: Jun 1, 2007, 4:47:26 AMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~WindyPower:iconWindyPower: Jun 1, 2007, 4:46:41 AMComment hidden by Owner
This comment is hidden and not visible to general public.
Hidden By Owner
~kosplay:iconkosplay: May 30, 2007, 1:50:57 PMComment hidden by Owner
This comment is hidden and not visible to general public.