Hacking Switch Recognised Through USB

NekoMichi

Retro Collector
OP
Member
Joined
Jun 4, 2015
Messages
1,441
Trophies
1
Location
Minus World
Website
www.youtube.com
XP
2,982
Country
Preface: This is not a hack or anything, just something I observed. Might be useful for homebrew, might be useless.

When plugged into a PC via a USB cable, the Switch console isn't just drawing power to charge, but actually seems to communicate with Windows. When connected via a USB 3 port, under the Devices and Printers section of the Control Panel it is recognised as a Nintendo Switch whereas when I plug it into a USB 2 port it only shows up as an "Unknown Device".

IMG_1536.PNG

The console is recognised as an input device and information such hardware ID is obtainable under the properties menu.

What's interesting about the Switch is that it's the first Nintendo console to use standard connectors instead of proprietary ports and that it allows direct wired communication with a PC.

Again, I'd like to reiterate that this isn't going to let you run unsigned code (i.e. Homebrew) on the Switch. The USB connection does not allow access to the on-board storage or sending commands to the system, but it might be useful for diagnostics. In the past we didn't have direct access to the system so homebrew had to be achieved through indirect vectors such as extdata on an SD card. In the case of the Switch, a direct USB connection may be a potential entrypoint that we didn't have access to in previous generation consoles.
 
Last edited by NekoMichi,

Toad King

Well-Known Member
Member
Joined
Aug 19, 2009
Messages
374
Trophies
0
XP
546
Country
United States
Code:
// USB Descriptor

0x12,        // bLength
0x01,        // bDescriptorType (Device)
0x00, 0x02,  // bcdUSB 2.00
0x00,        // bDeviceClass (Use class information in the Interface Descriptors)
0x00,        // bDeviceSubClass
0x00,        // bDeviceProtocol
0x40,        // bMaxPacketSize0 64
0x7E, 0x05,  // idVendor 0x057E
0x00, 0x20,  // idProduct 0x2000
0x00, 0x01,  // bcdDevice 2.00
0x01,        // iManufacturer (String Index)
0x02,        // iProduct (String Index)
0x03,        // iSerialNumber (String Index)
0x01,        // bNumConfigurations 1

// Manufacturer String: Nintendo
// Product String: Nintendo Switch
// SerialNumber String: SerialNumber

// Config 1 Descriptor

0x09,        // bLength
0x02,        // bDescriptorType (Configuration)
0x22, 0x00,  // wTotalLength 34
0x01,        // bNumInterfaces 1
0x01,        // bConfigurationValue
0x00,        // iConfiguration (String Index)
0xC0,        // bmAttributes Self Powered
0xFA,        // bMaxPower 500mA

0x09,        // bLength
0x04,        // bDescriptorType (Interface)
0x00,        // bInterfaceNumber 0
0x00,        // bAlternateSetting
0x01,        // bNumEndpoints 1
0x03,        // bInterfaceClass
0x00,        // bInterfaceSubClass
0x00,        // bInterfaceProtocol
0x00,        // iInterface (String Index)

0x09,        // bLength
0x21,        // bDescriptorType (HID)
0x00, 0x02,  // bcdHID 2.00
0x00,        // bCountryCode
0x01,        // bNumDescriptors
0x22,        // bDescriptorType[0] (HID)
0x1A, 0x00,  // wDescriptorLength[0] 26

0x07,        // bLength
0x05,        // bDescriptorType (Endpoint)
0x81,        // bEndpointAddress (IN/D2H)
0x03,        // bmAttributes (Interrupt)
0x01, 0x00,  // wMaxPacketSize 1
0x10,        // bInterval 16 (unit depends on device speed)

// HID 1 Descriptor

0x05, 0x06,        // Usage Page (Generic Dev Ctrls)
0x09, 0x20,        // Usage (Battery Strength)
0xA1, 0x01,        // Collection (Application)
0x09, 0x20,        //   Usage (Battery Strength)
0xA1, 0x00,        //   Collection (Physical)
0x05, 0x06,        //     Usage Page (Generic Dev Ctrls)
0x09, 0x20,        //     Usage (Battery Strength)
0x15, 0x81,        //     Logical Minimum (-127)
0x25, 0x7F,        //     Logical Maximum (127)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0x81, 0x06,        //     Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              //   End Collection
0xC0,              // End Collection

So it's just a USB device with one IN endpoint that only sends a single byte, so no controlling the Switch from this. Doesn't look like any developer debug stuff either. There is always the possibility that there's a debug specific USB device mode with completely different capabilities though.

The HID descriptor makes it sound like it's battery status but I'm not familiar with that particular usage stuff in USB so I'm not sure. On my fully-charged Switch I only ever got one packet of 0x00.
 

ARVI80

Well-Known Member
Member
Joined
Feb 25, 2016
Messages
197
Trophies
0
Age
43
Location
UK
XP
315
Country
Has anyone tried vcp drivers to access the usb as a standard com port to see what happens.

See if you can interface and putty the bitch....
 
Last edited by ARVI80,

TheCyberQuake

Certified Geek
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,432
Country
United States
did you try going to a proper usb 3.1 type c connection on a computer to see if anything changes? I would test myself but I'm away from home for a week with no access to my desktop (the only device I have with a USB 3.1 C connection.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    I'll reformat and have a 3tb raid0 m. 2 at least
    +1
  • K3Nv2 @ K3Nv2:
    Lmao that sold out fast
    +1
  • Veho @ Veho:
    Yeet the cat.
    +1
  • K3Nv2 @ K3Nv2:
    Good idea
    +1
  • The Real Jdbye @ The Real Jdbye:
    i thought everybody knew cocktails are like 75% ice
  • Veho @ Veho:
    Yeah but not like this.
  • Veho @ Veho:
    It's not like they're complaining that their Slurpee is 99% ice or something, but if the cocktail calls for "shot of vodka, shot of vermouth, shot of gin, shot of Campari, three shots of juice, squirt of lemon" and ends up being a thimbleful of booze, that's a problem.
  • The Real Jdbye @ The Real Jdbye:
    the funny thing is cocktails in norway are only allowed to have 1 20ml shot of booze
  • The Real Jdbye @ The Real Jdbye:
    so..... yeah
  • The Real Jdbye @ The Real Jdbye:
    we're used to only having a thimbleful of booze
  • Veho @ Veho:
    Booo.
  • The Real Jdbye @ The Real Jdbye:
    same thing if you want whisky on the rocks or something, you can't get a double
  • The Real Jdbye @ The Real Jdbye:
    but you could buy as many shots of whisky (or anything else) as you want and ask for a glass of ice and pour them in
  • The Real Jdbye @ The Real Jdbye:
    it's dumb
  • Veho @ Veho:
    Maybe.
  • Veho @ Veho:
    There was a comparison of the number of Ibuprofen poisonings before and after they limited the maximum dosage per box or per pill (i'll look that up). No limit on the number of boxes you can still buy as many as you want, so people argued it was pointless.
  • Veho @ Veho:
    But the number of (accidental) poisonings dropped because drinking an entire package of ibuprofen pills went from "I need a new liver" to "I need a new box of Ibuprofen".
  • Veho @ Veho:
    Here we have ketoprofen that used to be prescription-only because of the risk of toxic dosages, but then they halved the dose per pill and sell them in bottles of six pills apiece instead of twenty and it doesn't need a prescription any more. Yes you can buy more than one bottle but people simply don't.
  • Psionic Roshambo @ Psionic Roshambo:
    Usually accidentally overdose of ibuprofen here is from people taking like cold medicine then ibuprofen for a headache and the combination is over what they need
    Veho @ Veho: https://imgur.com/gallery/QQkYnQu