The first step was putting my laptop's wireless card into monitor mode and sniffing packets with Wireshark. This was harder than expected, but eventually I figured out I had to disable Ubuntu's NetworkManager so that I could control what frequency the card was listening on. My Wii and DS seem to be communicating on channel 7, but GBATEK says that it randomly chooses 1, 7, or 11, so that might come up later.
After I clicked CONNECT TO DS in My Pokemon Ranch, the Wii started transmitting a bunch of beacon frames (broadcast messages intended to make devices aware of the existence of an access point; in NiFi, the host in a connection pretty much is an access point that the other device is associating with). The important part of the frame (besides the transmitter's MAC address) is a vendor specific tag (tag ID: 221) with the OUI 00:09:BF. This is Nintendo's vendor ID and this tag is where they transmit their special data.
The tag value in all of these frames is 136 bytes long. Each one starts with the OUI, then 00:FF:FF, and then what appears to be two random bytes. I haven't yet figured out if those bytes mean anything. Then, the rest of the bytes in the tag is some kind of data payload. I observed 10* different payloads, broadcast cyclically in the same order. My methodology was to capture ~100 packets, isolate this tag value, remove the first eight bytes to eliminate the random part, and then sort/uniq.
Again, I'm not yet sure what the data in these tags mean yet, nor how they are processed by the DS. But it seems reasonable to guess that if I wanted to spoof a Wii running My Pokemon Ranch, I could broadcast beacon frames with properly crafted 802.11 headers and just loop through the 10 payloads I isolated. Hopefully what that would do is cause the CONNECT TO WII option to appear on the main menu of the Gen 4 DS games. I don't even really need to know Why these payloads do that, as long as they Do do that.
Here are the 10 payloads (no 802.11 frame, and the first eight bytes are dropped):
Payload 1
Code: Select all
010001088602400069367001f0010800 ......@.i6p.....
86024000000000009ffc00096200586f ..@.........b.Xo
20496255c461466eeb7ea418ac009e01 IbU.aFn.~......
ff7b8c31fa00b7000000000000001011 .{.1............
11111111111111222222112222321122 .......""".""2."
22331122324311223344113243541111 "3."2C."3D.2CT..
11111111111122333333334344444344 ......"3333CDDCD
555544556166556166666466c7881111 UUDUafUaffdf....
Code: Select all
010001088602400069367001f0010800 ......@.i6p.....
86024000000000019375010962001111 ..@......u..b...
11111111333333224444343355554434 ....333"DD43UUD4
6616554466661655887c664611111101 f.UDff.U.|fF....
11111111222222112322221133222211 ....""".#"".3"".
34232211443322114534231111324345 4#".D3".E4#..2CE
11324465113354611143546611431576 .2De.3Ta.CTf.C.v
114365c6114365861143656666878888 .Ce..Ce..Ceff...
Code: Select all
010001088602400069367001f0010800 ......@.i6p.....
8602400000000002607202096200b688 ..@.....`r..b...
8888878888888888b86788886b6688b8 .........g..kf..
660a8878a69966660699888878668888 f..x..ff....xf..
886b88888878768b888866b68888a066 .k...xv...f....f
8b88996a878899606666543423115644 ...j...`ffT4#.VD
23111645331166453411675134116c56 #..E3.fE4.gQ4.lV
34116856341166563411114365661143 4.hV4.fV4..Cef.C
Code: Select all
010001088602400069367001f0010800 ......@.i6p.....
8602400000000003f25f030962006596 ..@......_..b.e.
11436506114315a61143546611335461 .Ce..C...CTf.3Ta
11324465113243456666069999a9a699 .2De.2CEff......
9909660a999960669099096a9a999999 ..f...`f...j....
a6999999660a999999606666996a9a99 ....f....`ff.j..
a066909966069999a6909909999999a9 .f..f...........
9999996a9999a0666656341169563411 ...j...ffV4.iV4.
Code: Select all
010001088602400069367001f0010800 ......@.i6p.....
86024000000000040c63040962006056 ..@......c..b.`V
34116a51341166453411164533115644 4.jQ4.fE4..E3.VD
23115434231111324354112233441122 #.T4#..2CT."3D."
32431122223311222232112222221111 2C.""3.""2."""..
11111011111164660a90556166664455 ......df..UaffDU
61664344555533434444223333331111 afCDUU3CDD"333..
11111111111109a06646666616556616 ........fFff.Uf.
Code: Select all
010001088602400069367001f0010800 ......@.i6p.....
86024000000000057483050962005544 ..@.....t...b.UD
55554434444434333333332211111111 UUD4DD43333"....
11111111453423114433221134232211 ....E4#.D3".4#".
33222211232222112222221111111111 3"".#"".""".....
11111101000357006900690000000000 ......W.i.i.....
00000000000000000000020050006f00 ............P.o.
6b0065006d006f006e00200046006100 k.e.m.o.n. .F.a.
Code: Select all
010001088602400069367001f0010800 ......@.i6p.....
860240000000000659f3060962007200 ..@.....Y...b.r.
6d000000000000000000000000000000 m...............
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
000000000000000000004e0049004e00 ..........N.I.N.
540045004e0044004f00000000000000 T.E.N.D.O.......
Code: Select all
010001088602400069367001f0010800 ......@.i6p.....
860240000000000796f6070962000000 ..@.........b...
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
Code: Select all
010001088602400069367001f0010800 ......@.i6p.....
8602400000000008aff6080948000000 ..@.........H...
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
Code: Select all
010001088602400069367001f0010800 ......@.i6p.....
8602400002000009fdff010001000000 ..@.............
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
00000000000000000000000000000000 ................
Additionally: even though these are beacon frames, there's no SSID attached, because it's not a real access point. Also thank goodness these connections are completely unencrypted. Not even WEP.
This is the first thing I want to try out. After the beacon frames, I also saw a standard access point association (Authentication packet back and forth and then Association Request / Association Response). The DS tried connecting to a strange SSID, but the GBATEK doc I linked earlier seems to suggest this SSID might not matter?
And then after that there's a ton of packets between the Wii and DS which Wireshark considers malformed because they do not adhere to any regular packet type. Nintendo just made up their own protocol I guess. And the prospect of getting information out of this landslide of packets is kind of daunting but I'll try my best. The first thing I'll probably do with that is try to find byte sequences that match the data structure of Pokemon I know are on the cartridge.