Live data from Hacker News

USB Reverse Engineering: Down the Rabbit Hole

devalias.net

1–10 of 48 posts

Re: USB Reverse Engineering: Down the Rabbit Hole

#2
What a weekend find! This is a nice piece in a puzzle I'm trying to solve related to a consumer audio device with upgradeable firmware.

The platform of the device is used for both a prosumer audio device, a professional device, as well as other consumer devices. On top of that, the prosumer device appears to have different functionality enabled based on the part of the world you buy the device, but my hypothesis is that the hardware is the same, regardless of region, and the firmware just implements a dark pattern to limit functionality (perhaps to avoid additional FCC certifications, support incidents, etc.).

Anyway, I've spent a few nights extracting the firmware from other regions, found a great presentation where the company details the hardware and platform, and discovered that the audio capabilities of the hardware for the prosumer device approach that of the professional device (higher sampling frequencies and resolution during recording).

My hope was to be able to flash the device with a modified file system that enabled the features, but ran into the firmware appearing to be encrypted, but potentially decrypted on the host before being pushed to the device. I've been decompiling the drivers to see if I could dump keys or the decrypted payloads, but also thought about sniffing the USB I/O and dumping that way. It looks like this is a nice intro to help me on my way.

Re: USB Reverse Engineering: Down the Rabbit Hole

#3
post #2

What a weekend find! This is a nice piece in a puzzle I'm trying to solve related to a consumer audio device with upgradeable firmware. The platform of the device is used for both a prosumer audio device, a professional device, as well as other consumer devices. On top of that, the prosumer device appears to have different functionality enabled based on the part of the world you buy the device, but my hypothesis is t…

Sounds like a really interesting project! Hopefully you manage to figure it out. Glad I could help start your own rabbithole of a journey! ;p

Re: USB Reverse Engineering: Down the Rabbit Hole

#4
this is a great writeup, definitely falls into something I've been dreaming of building, but was planning to hack around the usb part of it (using a usb-uart adapter), but now I'm thinking maybe I do it right! should make for a great weekend.

unfortunately, it seems that the pre-req article is down, so here's the cached copy: http://webcache.googleusercontent.com/search?q=cache:https:/...

Re: USB Reverse Engineering: Down the Rabbit Hole

#5
I've sunk countless hours looking for a way to emulate USB devices in software under Windows. Two years ago there were many different ways. Today there are zero ways that I know of, apparently all removed within the last two years by an astounding tragic coincidence.

To elaborate on this section:

http://devalias.net/devalias/2018/05/13/usb-reverse-engineer...

- There are two versions of the USB/IP drivers. The initial version has a bug where disconnection of a device causes a blue screen. This version is signed by ReactOS, and so you can install this version's drivers without needing to jump through any hoops under Windows. Then there's a patched version that does not cause the bluescreen. Great! Except that this version is not signed by ReactOS. Okay, maybe we can get ReactOS to sign it -- nope, they discontinued their driver signing program because of new regulations by Microsoft put in place within the last year (https://www.reactos.org/wiki/Driver_Signing). You can also no longer install unsigned drivers on Windows 10 by putting your machine into test mode. This capability was silently removed by Microsoft within the last year. You can still put your device into test mode, but the driver signing checker will still block installation. This is a damn shame because USB/IP is a great project, and it even has a signed driver but the patched version of the driver is not signed. This is infinitely frustrating.

- Microsoft used to have this perfect thing called UDE (https://docs.microsoft.com/en-us/windows-hardware/drivers/us...). They removed it last year.

- Kernel mode drivers for Windows now have to go through this signing process (https://docs.microsoft.com/en-us/windows-hardware/drivers/in...) as of last year. As mentioned before, this is why ReactOS discontinued their driver signing program as it's too difficult to meet these new requirements.

I have read every forum post, stack overflow post, Windows technical docs, everything I could possibly find for a way to do stable, pure software emulation of USB devices on Windows. They all evaporated within the last year or two. So frustrating as I really really want to build out something but there's simply no way to do it.

At this point I have resorted to attempting to hook every Windows system call related to USB device initialization and spoofing them but have been met with no success thus far.

I should note that the reason I want to do this in software is because I want to distribute the end result to a relatively large amount of potential users as GPL'd software. For this reason hardware emulation or patching / downgrading Windows isn't an option sadly.

Does anyone know of something I missed?

Re: USB Reverse Engineering: Down the Rabbit Hole

#6
post #5

I've sunk countless hours looking for a way to emulate USB devices in software under Windows. Two years ago there were many different ways. Today there are zero ways that I know of, apparently all removed within the last two years by an astounding tragic coincidence. To elaborate on this section: http://devalias.net/devalias/2018/05/13/usb-reverse-engineer... - There are two versions of the USB/IP drivers. The initia…

Then there's a patched version that does not cause the bluescreen. Great! Except that you can no longer install unsigned drivers on Windows 10 by putting your machine into test mode.

Patching out the signing check itself may not be too difficult... and if the file the signing check is in is also signed and verified by something else, then patch that... it's patches all the way down. I remember doing this with Vista a long time ago. When the signing check fails it fails with a very distinctive error code/message, so I searched for that in all system files and went "down the rabbit hole" of patching out a few checks. I don't remember the details but there was less than a dozen bytes that needed to be changed. Previous cracking experience certainly helps. ;-)

Re: USB Reverse Engineering: Down the Rabbit Hole

#7
post #5

I've sunk countless hours looking for a way to emulate USB devices in software under Windows. Two years ago there were many different ways. Today there are zero ways that I know of, apparently all removed within the last two years by an astounding tragic coincidence. To elaborate on this section: http://devalias.net/devalias/2018/05/13/usb-reverse-engineer... - There are two versions of the USB/IP drivers. The initia…

This might be a dumb question but why not downgrade Windows?

Re: USB Reverse Engineering: Down the Rabbit Hole

#8
post #2

What a weekend find! This is a nice piece in a puzzle I'm trying to solve related to a consumer audio device with upgradeable firmware. The platform of the device is used for both a prosumer audio device, a professional device, as well as other consumer devices. On top of that, the prosumer device appears to have different functionality enabled based on the part of the world you buy the device, but my hypothesis is t…

Sounds like a real classic market segmentation tactic.

I recall reading about a oscilloscope or something that had two models, one monochrome and slightly worse performance, one color and slightly better better.

Turns out that if you flashed the firmware of the latter onto the former, the performance improved to match the latter's.

Basic thing is that by doing this, the marketing people has calculated that they may reach a larger total customer pool than by only offering the more expensive variant.

Re: USB Reverse Engineering: Down the Rabbit Hole

#9
post #5

I've sunk countless hours looking for a way to emulate USB devices in software under Windows. Two years ago there were many different ways. Today there are zero ways that I know of, apparently all removed within the last two years by an astounding tragic coincidence. To elaborate on this section: http://devalias.net/devalias/2018/05/13/usb-reverse-engineer... - There are two versions of the USB/IP drivers. The initia…

This might be a dumb question but why not downgrade Windows?

I want to distribute the end result to a large amount of users, and asking them to do things like downgrade Windows or put their device in test mode (which doesn't even work anymore) is too much overhead.

Re: USB Reverse Engineering: Down the Rabbit Hole

#10

this is a great writeup, definitely falls into something I've been dreaming of building, but was planning to hack around the usb part of it (using a usb-uart adapter), but now I'm thinking maybe I do it right! should make for a great weekend. unfortunately, it seems that the pre-req article is down, so here's the cached copy: http://webcache.googleusercontent.com/search?q=cache:https:/...

Glad I inspired you to hack it the right way! Thanks for sharing the cached link :)
Post reply on HN