How to Steal Gasoline Using Assembly Language

A true story from 1990s Russia about how engineers used Assembly language to bypass an electronic fuel dispensing system during a gasoline shortage — while still paying for every drop.

Strictly speaking, the title of this article is wrong. We didn't steal gasoline — not with Assembly language, not with a power drill. We didn't steal it at all. It's just that life forced us at a certain point to get a little creative and redistribute a small portion of that gasoline into our personal fuel tanks, while honestly paying for every last drop.

How It All Began

In the mid-1990s, our city was experiencing a severe gasoline shortage. There wasn't enough fuel even for emergency vehicles — police cars, ambulances. The municipal administration decided to implement an automated fuel distribution system across the city's gas stations.

The system worked on plastic cards. Each organization received cards with a monthly fuel allocation. When you inserted the card at the gas station, the system would check the remaining balance and dispense the authorized amount. The whole thing ran on Intel 8086 and 80286 computers clocked at up to 16 MHz, operating under MS-DOS.

The Breakdown

Our organization's allocation was laughably small — not enough to cover even basic operational needs. Meanwhile, the equipment at one of the stations broke down, and they called us in to fix it. This was our chance.

We arrived at the station with our toolkit, which included a 5.25-inch floppy disk drive. We connected it to the station's computer — a machine with a 20 MB hard drive — and began our "repair work."

The Assembly Solution

First, we copied the station's software to our floppies for analysis. Back at the office, we disassembled the code and studied how the fuel dispensing system worked. The key discovery: the system used a simple file-based database to track card balances and fuel transactions.

We wrote a modified keyboard driver in Assembly language. This wasn't just any driver — it included a hidden keystroke logger and, more importantly, a hook into the file access interrupt vectors. When a specific key combination was pressed, our code would intercept the fuel dispensing routine and authorize a release of 10-20 liters without requiring a card.

We also hid a text editor and an Assembly translator on the hard drive in locations that the station's regular software wouldn't touch.

Installation

During the next "maintenance visit," we installed our modified driver. The installation was straightforward — just replacing the keyboard driver in CONFIG.SYS and adding our TSR (Terminate and Stay Resident) program to AUTOEXEC.BAT.

After completing the official repairs, we ran SPEEDDISK.EXE to defragment the drive — ostensibly as part of maintenance, but actually to ensure our hidden files were scattered across the disk in a way that wouldn't be obvious to casual inspection.

The Operation

The scheme worked like clockwork. We would drive up to the station, the attendant would press the secret key combination, and the system would dispense fuel. The attendant received a cash payment from our group, which they would put into the register to cover the discrepancy. Everyone was happy — we got our gasoline, the attendant got a tip, and the accounting balanced out.

The Moral

I want to emphasize once more: we did not steal gasoline. Every liter was paid for in full. What we did was bypass an electronic rationing system that was preventing us from purchasing fuel that was physically available. In a time when the official allocation system was broken and people couldn't fuel their cars, we found a technical solution that let the market work as it should have.

Looking back, it was a beautiful hack. A few hundred bytes of Assembly code, loaded as a keyboard driver, gave us access to a resource that bureaucracy had made artificially scarce. The 8086 processor had no memory protection, no privilege levels to speak of — the entire address space was open. Writing a TSR that intercepted INT 09h (keyboard) and INT 21h (DOS file operations) was textbook stuff. But applying it to get gasoline? That was pure 1990s ingenuity.