Reverse Engineer That USB Device In Style

Proprietary device drivers, dedicated applications, and their ilk are the bane of the open-source hacker. If only we could snoop on every device out there, recording the “secret” USB transactions as they go over the wire, we’d have a chance.

[Emir Mrkaljević]’s tool, usb-rea, aims to make this process a whole lot less painful. The workflow is like this: you start capturing on USB, make an annotation about what action you’re taking, press the button a few times, and then move on to the next action.

sudo modprobe usbmon
usb-rea capture start -o lamp.pcapng
usb-rea mark -m lamp.pcapng.actions.json "brightness 0%"    # then click it in the vendor app
usb-rea mark -m lamp.pcapng.actions.json "brightness 50%"   # ...repeat for 3+ values per setting
usb-rea capture stop
usb-rea report lamp.pcapng -o report.md
usb-rea scaffold lamp.pcapng -o lamp_driver.py
usb-rea dissector lamp.pcapng -o lamp.lua      # Wireshark dissector for the same protocol

Usb-rea records all the USB traffic, timestamps it relative to your actions, and gives you a report, a driver, and a Wireshark protocol dissector out the back side. There is even an MCP file so that you can hand off the grunt work to the bots, possibly enabling this to work closed-loop?

Of course, you don’t want to reinvent the wheel, so it’s fun to see that there’s also a usb-rea lookup command to see if your VID:PID is already in the dataset. Most of the devices are CPU coolers, RGB controllers, and other blinged-out computer peripherals, but we imagine that it’s a lot more broadly applicable. We looked for our mouse on the list, but it’s sadly not there.

Usb-rea is not a silver bullet to bring back abandoned peripherals from the grave, because you still need to run the proprietary driver during the recording. But if you get ahead of the game and document the protocols before the manufacturers abandon them, you stand a chance. Get recording!

Sheet music is displayed on a screen, with the label "AIR" in the center top, and "Bach" to the right.

Reverse Engineering Score Perfect To Rescue Its Files

There are myriad challenges associated with data preservation – bit rot, loss of metadata, and hardware failures, among others – but one of the hardest is making sure that the data remains usable as software goes out of date. [Maarten Tromp]’s father, for instance, had been using the Score Perfect music notation program for years, but since development ceased in 2012, the files would eventually need to be transferred to more modern software. To do this, [Maarten] undertook a four-year project to reverse-engineer the structure of Score Perfect’s files.

Score Perfect was first released in 1990 for Atari and later ported to Windows, and after version four, it switched to a different file format. It had the option to export to MusicXML, but it only exported notes, not chords, lyrics, or other important details. [Maarten] first tried disassembling the program itself to find the file structure; he had hoped that the Visual Basic code might have been compiled to P-code, which is relatively easy to disassemble, but it had been compiled to native code. Interestingly, through version four, the program had been written for Atari and ran in Windows through a simple emulator. It wasn’t fully rewritten for Windows until later. After some investigation into the file-export function with Ghidra, he moved on to reverse-engineering the file format itself.

This consumed the majority of the project’s time. To investigate the file’s structure, [Maarten] would start by creating an empty file in the program, make one change, and compare the difference in the file written. This gradually revealed the organization of information — the file was arranged into blocks containing different kinds of information, such as measures and notes, and tags, which provided supplemental information. Once again, incremental changes revealed the function of most of these, and [Maarten] was eventually able to write a translation program to export Score Perfect files to MusicXML.

We’ve previously seen a similar effort to reverse-engineer the Altium file format. At least in these cases, though, all the necessary information is contained in the files, unlike the reverse-engineering often necessitated by STL files.

Space Invaders On A VFD

When most people think of vacuum fluorescent displays (VFDs), they probably imagine the clock on a microwave or the equalizer on a piece of stereo equipment. But there was a brief period where the glowing phosphor displays were actually used for portable game systems before things like LCD took over.

While the salvaged display that [José Luis Monteiro] and his father have been hacking on certainly isn’t portable, it does play a mean Space Invaders. It’s vertical resolution is a bit tight for the gameplay, but the various sprites look fantastic and the art style works particularly well with the retro VFD vibe.

Just as with their recent efforts to bring Snake to a seven-segment display, a great deal of attention is given to explaining the nuts and bolts of how these vintage displays work. The documentation and source code they’be provided are certainly valuable to anyone else who might be hacking on this type of hardware, but the video they’ve produced is entertaining and informative enough that it’s worth checking out even if you aren’t actively trying to port DOOM over to your old microwave.

If you’re interested in learning even more about these fascinating old school displays, we’ve previously covered some excellent deep dives into the tech.

Continue reading “Space Invaders On A VFD” →

Translating An Old Display To A New One

A quick search through AliExpress will find PCBs that take HDMI or VGA and translate them to DSI lanes for TFT panels, and even boards that translate DSI to HDMI in the other direction. Usually they need dedicated silicon or if you’re doing it yourself, an FPGA, but depending on the display that need not be the case. As an example, [Voltage Ventures] has replaced a defective STN display with a more modern one using nothing more complex than a Raspberry Pi Pico.

The display comes as part of a Samsung cash register that looks as though it comes from the 1990s, which is in keeping with it having a monochrome STN display. A replacement was going to cost a fortune, so some way of translating between the two was in order. It has a 4-bit data bus, so there’s a description of how they sampled the bus and identified the timing used. It’s hardly the highest resolution display by today’s standards, being a meager 320 by 240 pixels. Once the format is known it’s a case of transposing it to monochrome VGA in the microcontroller. Initial work was done with an STM series chip, later this was moved to the RP2040.

We like this project, and it’s a reminder that even something broken and old can still be rescued.

Reading Data From An Unwilling Blood Pressure Monitor

Given the modern trend of interconnecting anything and everything, we have no doubt that somebody sells a blood pressure monitor that will push its measurements out to all sorts of cloud services on your behalf. We’re equally sure that doing so requires you to sign up for some new account or service, and that there may even be a subscription cost hiding in there as well.

Looking to record his vitals on his own terms, [Tomasz Burzy] set out to modify a basic blood pressure monitor so that it would send its data out over WiFi. He succeeds in the end, but as is so often the case around these parts, the journey ended up being just as interesting as the final destination.

Optically detecting which LCD segments are activated.

His initial idea was to tap into the monitor’s PCB with his logic analyzer. He quickly found a test point that let him pull the raw value from the unit’s pressure sensor, and with a little massaging, he even got some code running that turned that into a fair estimation of his actual blood pressure. But it didn’t quite match what the display showed, and doing some research, he found that these monitors generally employ some unknowable Secret Sauce to derive the final result from the raw data.

Efforts to intercept the final number from the device’s main chip before it was sent off to the display driver were stymied by the fact that it was the display driver. The unit was so well integrated, presumably to drive down the cost, that there was a single IC handling essentially all aspects of its operation. So much for the logic analyzer route.

In the end, [Tomasz] took the nuclear option and used a camera mounted to the top of the unit to pull data off the display optically. But instead of a full-fat computer running some computer vision software, he’s able to pull it off on an ESP32-CAM module. How? Because he knows exactly where each segment of the LCD is, he simply needs to check a set array of coordinates in the camera’s image to see if they are lit up or not. This greatly reduces the complexity of the task, and brings it within the capabilities of the lowly microcontroller.

Although we love the idea of developing hacker-friendly medical devices that give up their data without having to jump through so many hoops, we appreciate the effort [Tomasz] put into this, and think it’s a fantastic example for similar reverse engineering efforts.

Continue reading “Reading Data From An Unwilling Blood Pressure Monitor” →

Snake On A Seven-Segment Display Is Gloriously Bad

You’ve no doubt heard the saying, “If something is worth doing, it’s worth doing well.” But there’s actually a counter-perspective to this particular philosophy that says it’s also worth doing things badly, with the general idea being that even a semi-successful attempt at something is better than no attempt at all.

We’re not sure if that’s the principle [José Luis Monteiro] and his father had in mind while working on a way to play the classic Snake on a seven-segment LED display salvaged from an old DVD player, but surely the end result is the same. It’s not so much that the display isn’t a good fit for the eponymous snake, in fact, it actually makes a strange amount of sense. Each of the segments can stand in for a piece of the ever-growing serpent, and they’re already arranged in a roughly rectangular grid that makes moving around straightforward enough.

The issue is that the resolution — such as it is — of the display it pretty unforgiving for anything else. Namely, the “food” that your sake is after is naturally identical to one of its own segments, so it doesn’t take long before it’s all rather confusing visually. But in those brief opening moments, it actually works pretty well.

Even if you’re not interested in Snake, between the documentation, source code, and the video below, this project is a great primer on reverse engineering these types of displays. With a microcontroller, a datasheet, and a bit of patience, you could put together an unattractive and frustrating gameplay experience of your very own! If that’s not the dream, what is?

Continue reading “Snake On A Seven-Segment Display Is Gloriously Bad” →

Pager Converted To Meshtastic Node

Text messaging has been around on cellular networks en masse for around three decades now. It’s so common that it’s difficult to remember a time without it. Its two-way quick messaging is incredibly useful, but for even simpler communications there’s a one-way system that predates it. Pagers are able to receive simple messages, but outside of hospitals are rarely used nowadays. Eventually some added in two-way communications like this Motorola T900, but they’re still mostly obsolete. That’s why [zindustries87] converted it to operate on the Meshtastic network instead.

To get this pager working, a lot of reverse engineering was needed. There is essentially no documentation on the chips in these devices, so the screen and keyboard both were reverse-engineered to work with other hardware. In this case, [zindustries87] found space for a Heltec V4 with an ESP32-S3, a popular Meshtastic node with a small form factor. Some programming was needed to get everything communicating together, but from the looks of things it seems to have basic functionality.

[zindustries87] points out that this is a prototype, and didn’t know going in if the keyboard and screen could be brought back to life, or if the other hardware would fit in the case. But with it working on this level, they plan to add a number of other features in and possibly build a drop-in PCB replacement for these devices. They were once fairly popular so there are plenty around, and they’re a good form factor for a dedicated Meshtastic device that doesn’t need a smartphone to work. The only other ways of bringing pagers back to life involve bootstrapping an entire pager network, and Meshtastic is a bit more useful than that now.