Sitemap
Mohammed Saeed Al-huraibi

Mohammed Saeed Al-huraibi

A Tiny USB Stick Was Slowly Killing My Friend’s Computer

7 min readJun 10, 2026

--

His software license was trapped on a dying dongle the company wanted $300 to fix. So I rebuilt it on a $15 Raspberry Pi.

It started on a tea break.

A friend of mine a neuroscience researcher, over in the labs was standing with me after lunch, drinking tea, telling me about his computer. Not the usual complaining. The tired, given‑up kind.

“I can’t get my work done anymore,” he said. “Every time I plug in the license stick for my analysis software, Windows slows to a crawl. And when the software finally sees the stick, it crashes.”

I’m a software engineer by training, and DevOps is my day job which has nothing to do with fixing dying USB sticks. But I’ve always loved the place where software meets hardware: the Linux kernel, drivers, the low‑level layer where code actually touches metal. So even though this wasn’t mine to fix, I should have said something normal, like “have you tried a different port?”

Instead I said the four most dangerous words an engineer can say:

“Can I see it?”

“Two grams of old plastic. Ten years of service. A couple of days of my free time.”

💸 A tiny stick worth $300

The stick he handed me is small. It’s also more than ten years old.

His expensive analysis software won’t run unless this exact stick is plugged in the stick is the license. No stick, no work.

It had died once before, about seven years in. They sent it back to the company, hoping for a new one. They got the same old stick back, just repaired. Three years later, here it was, dying again the slowness, the crashes.

And fixing it again would cost about $300. Repair it or replace it, the company charges the same: three hundred dollars for one little worn‑out stick.

He was stuck. I was excited. I took the stick back to my desk like a kid with a new toy. It didn’t end up taking long just a couple of days, here and there, whenever I had free time. But what a couple of days.

🐌Why it was so slow

The stick only acted up on Windows, because Windows is nosy it pokes at every drive all the time. So I plugged it into a Linux machine and just watched it read. Read‑only, of course rule one of working on a license stick is never write to it.

Most reads took 5 milliseconds. Normal. Then one read took thirty‑one seconds:

read #07 :  31048 ms      ← 31 seconds. for 4 kilobytes.

The system logs showed why. Every so often the stick just stopped answering. The computer would reset it, wait, and try again for up to 220 seconds before giving up:

usb reset … device not responding
I/O error, sector 9248
…gave up after 220 seconds

That’s the whole problem in one sentence:

A healthy drive fails instantly, but this dying one went silent freezing the system for up to 220 seconds. Stuck in the resulting bottleneck, the software crashed.

The flash memory inside was just worn out. Old and tired.

Easy fix, right? Copy the license to a new stick. Done by the next tea break.

It was not done by the next tea break.

📋 Attempt #1: the copy that didn’t work

I copied everything off the old stick onto a new one. Every single byte. The two were identical.

I plugged the copy into his software.

“No dongle found.”

I tried again. Same thing.

The software wasn’t reading the files on the stick. It was checking something about the stick itself something I’d copied perfectly, and it still wasn’t enough. There was only one way to find out what. I was going to have to open the software up and read its mind.

🧠 Attempt #2: reading the software’s mind (the fun part)

I’m not a reverse engineer by training. By the time I cracked this, I had the search history of one.

The software was a Java program. I pulled it apart and decompiled it turning the compiled app back into readable code and went looking for anything about licensing. I found it fast: a class named, more or less literally, DongleAPI. It handed the real work to a deeper layer a native engine, compiled machine code and asked it one question: “Is the right stick plugged in?”

So I opened that machine code in a disassembler and read the raw instructions until I hit the part that mattered. And there it was, in plain text inside the program:

"USBSTOR\DISK&VEN_"            ← ask Windows to list the USB drives
SetupDiGetDeviceInstanceId ← read each drive's hardware serial number

In plain English: the software wasn’t just reading the files. It asked Windows itself to list the USB drives and report their hardware serial numbers the unique ID burned into the chip at the factory and checked that number against the license.

Get Mohammed Saeed Al-huraibi’s stories in your inbox

Join Medium for free to get updates from this writer.

That was the whole secret. My perfect copy failed because I’d copied the files. The software wanted the serial number and you can’t copy a serial number with a file copy.

This was the best part of the whole project. A couple of days of poking at someone else’s program, and it finally gave up its one secret. I may have said “gotcha” out loud, alone, at my desk.

🧪 Attempt #3: proving it before building anything

Before I spent a cent, I wanted proof. So I made a throwaway Windows virtual machine and used a neat trick: virtual machines let you invent fake hardware. I told it, “here is a USB stick, and its serial number is exactly this,” gave it the license file, and held my breath.

The software turned green. Licensed. Happy.

Then I removed the fake stick, and it dropped back to “no license.”

Now I knew the recipe for sure: right serial number + the license file = it works. I just needed a real, physical thing that could lie about its serial number.

🚧The Kingston dead end

“Easy,” I thought. “I’ll just change a spare USB stick’s serial number.”

I had a Kingston stick in a drawer. I looked up its controller chip the little brain inside that runs the flash. It was a model so locked down by the maker that there is basically no tool to change its serial. Of all the sticks in all the drawers, I’d grabbed the one that can’t be told to lie.

Dead end but now I had a much better idea.

🦸The $15 hero

If I needed something that could pretend to be any USB stick, I didn’t need a flash drive. I needed a tiny computer.

A Raspberry Pi Zero costs about $15. It’s a full computer the size of a stick of gum. And it can run in gadget mode where it stops being a computer and pretends to be a USB device: a keyboard, a network card, or a flash drive with any serial number I choose.

So I told it: “Be a flash drive. Use this serial number. Hold this license file.”

Press enter or click to view image in full size
“The hero. Smaller than the problem it was about to fix.”

It did not go smoothly. The short list of what went wrong:

  • The Pi vanished from my WiFi for an hour. The little Pi only works on 2.4 GHz WiFi, and I’d given it the 5 GHz network.
  • The whole thing refused to start because one word in one settings file said host instead of peripheral. One word.

Then it worked:

USB dongle ACTIVE    serial = ●●●●●●●●●●●●    read-only

I plugged the Pi into a computer. Fifteen seconds later, a USB drive appeared same serial number, same license file. The software took one look and unlocked. No slowness. No crashing.

One nice bonus: I set the Pi to only ever read its memory card, never write to it. Reading doesn’t wear flash out writing does. So this little thing should keep working long after the software it unlocks is gone.

🤝 The handoff

I gave the Pi to my friend.

He plugged it in and uploaded his files to run his analysis the same work that used to freeze his machine for hours and crash. This time it was instant. So fast he just stared at the screen.

Then he looked up, kind of shocked, and grinned: “Wait it just works now?”

A $300 problem, solved for $15. But the money isn’t the part I remember. The part I remember is his face. He could do his research again. Honestly, it felt like I’d saved his life.

That’s the thing nobody tells you about this job: sometimes the whole reward is a friend saying “it just works now” and meaning it.

💡What I learned

  • A “slow computer” is often one dying part holding everything else hostage.
  • Reading flash memory is fine. Writing is what wears it out so anything that runs all day should be read‑only and live in RAM.
  • A Raspberry Pi can pretend to be almost any USB device. It’s a small computer in a costume.
  • Take the weird problems, and help your friends. This wasn’t even my problem. I did it because it was a great problem and a friend was stuck and it was the most fun I’d had with a computer in ages.

💻 The code

I cleaned up the Raspberry Pi side into a simple, general project, so you can do this for your dying USB stick just plug in your own serial number and your own files:

👉 github.com/Mohammed-Alhuraibi/usb-serial-dongle

If some software you depend on is trapped on a dying USB stick, this might bring it back to life. It did for my friend for fifteen dollars instead of three hundred.

👏If this helped you, a clap or a share helps others find it. And if you’ve ever lost six hours to a one‑word bug, tell me in the comments.

--

--