Rodolfo Rodriguez Cabrera didn't set out to mastermind a global counterfeiting ring. All he wanted was to earn a decent living doing what he loves most: tinkering with electronics. That's why he started his own slot-machine repair company in Riga, Latvia. Just to make a little cash while playing with circuit boards.

Born and raised in Camagüey, Cuba, Cabrera always had an affinity for technical pursuits. Once, after winning a student essay contest in 1976, he was given a personal audience with Fidel Castro. When the dictator asked the 10-year-old what he wanted to be when he grew up, Cabrera confidently replied, "An architectural engineer."

Nine years later, after becoming obsessed with airplanes as a teenager, Cabrera won a scholarship to Riga Civil Aviation Engineers Institute, home to one of the Soviet Union's finest aeronautical-engineering programs. While working toward his degree, he fell in love with an older Latvian woman, and though he was expected to return to Cuba after graduation to serve Castro's regime, Cabrera decided to stay in Riga and build a new life designing and working on aircraft.

But soon after Cabrera completed his degree, Latvia broke free from the dying Soviet Union. The newly independent country had no aerospace industry of its own, and thus no aerospace jobs. Instead of fixing jet engines, Cabrera was forced to make money repairing radios and telephones. In 1994 he accepted a gig with a company called Altea, servicing the boxy videogame consoles found atop Eastern European bars, where they offer drunks the chance to waste a few coins answering trivia questions or playing Tetris.

How One Man Hacked His Way Into the Slot-Machine Industry

by Brendan I. Koerner (37.9 MB .mp3)Subscribe: Wired Features PodcastAs Latvia became more open and prosperous, slot machines began to pop up in the nation's bars, clubs, and supermarkets, creating new repair opportunities for Altea. Though he wasn't much of a gambler, Cabrera was drawn to these devices. He spent hours dissecting slot electronics to learn everything he could about how they worked. The deeper he plunged, the more he came to regard slot machines as his true professional calling. So in 2004, Cabrera used his modest savings to found his own repair company, FE Electronic.

Cabrera was particularly fond of the slots made by Nevada-based International Game Technology, which he considered by far the industry's most advanced. Like all slots, IGT's machines are powered by proprietary circuit boards equipped with rows of memory cards; those cards, in turn, contain each game's unique software. To prevent piracy, the boards are designed to reject memory cards unless they're accompanied by a security chip programmed with an uncrackable authorization code.

Like any good hacker, Cabrera decided to express his admiration for IGT's technology by trying to beat it. Using blueprints meant to assist casino service personnel, he figured out a way to solder a half-dozen jumper wires between the memory cards and the motherboards, completing circuits that circumvented the machine's security. This gave him the ability to load any IGT game he wanted onto the boards. If he was given a used Pharaoh's Gold machine, for example, he could convert it to a Cleopatra II by swapping in freshly programmed memory cards.

However innocent his initial intentions, Cabrera quickly saw the business potential in this breakthrough. He knew that converting machines without IGT's OK wasn't legal. But this was Latvia, he figured, where capitalism is wild and woolly. Surely no one would notice if he made a few bucks on the side by hacking IGT's tech.

There was a time when casinos only grudgingly tolerated slot machines. In the early years of Las Vegas, slots were relegated to the perimeter of casino floors, where they were expected to gobble up coins from women waiting on their blackjack-playing husbands. The machines' mechanical gears required constant maintenance, and the games were magnets for cheats. Scammers became adept at techniques like affixing coins to fishing lines or covertly prying open service doors to monkey with the reels.

But a salesman named William "Si" Redd had the foresight to realize that digital technology would eventually transform slots into a revenue powerhouse. In the early 1970s, Redd was the independent Nevada distributor for the Bally Manufacturing Corporation of Chicago, which made the popular Money Honey slot machine. Flush with cash from sales of that game and others like Big Bertha, Redd started acquiring tiny startups that were pioneering videogames, which at the time were considered little more than engineering novelties. One of his acquisitions, Raven Electronics of Reno, was developing a video blackjack machine; another, Nutting Associates of Mountain View, California, had created Computer Space, a primitive forerunner of Asteroids.

Redd planned on using these startups' know-how to help create video slot machines, which would replace fickle gears with reliable circuit boards. Such machines would require less maintenance and be less susceptible to cheating than their analog predecessors. In the midst of Redd's buying spree, Bally offered to purchase his distributorship. Redd agreed with one condition: that he be allowed to retain the video-related patents he had acquired. Bally myopically took the deal, and Redd went off to found the A-1 Supply Company—later renamed International Game Technology.

Just as Redd had foreseen, IGT's video machines were a boon to casinos. In 1971, slots generated 36 percent of Nevada's gaming revenue; by 1981, with digital slots on the rise, that figure was up to 44 percent. But slots didn't truly become America's favorite casino pastime until a Norwegian mathematician named Inge Telnaes came up with the most brilliant gambling innovation since the point spread.

The problem with slot machines, as Telnaes saw it, was that their jackpots were limited by the number of reels they could use. Since players expected each reel to have no more than 10 to 15 symbols, a machine needed many reels to make the odds long enough to justify a huge payout when all the cherries or bells settled into a row. But the more reels a machine had, the more players were reminded of the fact that their quest for riches would likely end in futility; no one wanted to try their luck on a machine with dozens of reels (or, alternatively, hundreds and hundreds of symbols on enormous reels).

Telnaes' solution to this conundrum was US Patent Number 4,448,419, awarded in 1984. His invention called for slot machine results to be determined not by the spinning of reels but by a random-number generator. The reels on such a machine would display only a visual representation of the generator's results, lining up when a winning number spit forth or (far more frequently) settling into a losing mishmash of symbols. The patent made possible the development of slot machines that could offer extremely long odds—and thus enticingly massive jackpots—while still appearing to have just a few tumblers. IGT wisely purchased Telnaes' patent in 1989, thereby guaranteeing itself a steady stream of royalties as its competitors adopted random-number generators, too.

Photo: Getty

By 1990, slot machines accounted for a full two-thirds of Las Vegas' gaming revenue, a percentage that has remained fairly constant ever since. Slots took over the prime casino real estate previously reserved for blackjack and roulette; three-quarters of gaming-floor acreage in Las Vegas is now inhabited by slots. And IGT grew into the industry's Goliath, with annual revenue of close to $2 billion and a coveted spot on the S&P 500 index. Roughly half of America's 833,000 slot machines are produced at IGT's manufacturing plant in Reno.

Armed with detailed intelligence regarding gamblers' behavior, IGT's designers now tailor each new machine to appeal to a specific type of player. "One of the things that really defines how a game plays is volatility of the math model," says Chris Satchell, the company's CTO, who previously filled the same role at Microsoft's videogame division. Some games, he explains, are based on algorithms that produce frequent but small payouts, ensuring that risk-averse players are able to play for long stretches before losing their bankrolls. High-volatility games, by contrast, offer large jackpots but long odds of winning and are thus designed to attract gamblers who want a quick shot at a big score. Creating those varied experiences, while still ensuring that the house always wins a predictable amount over the long run, requires the expertise of professional mathematicians. IGT scours the nation's graduate mathematics programs in search of talent who would rather develop slots software than devise Wall Street trading algorithms.

Slots manufacturers have recently come to view game consoles as a serious threat to their business; they fear that younger gamblers in particular might prefer to stay home and play L.A. Noire than trek to a casino. So to give players the illusion that they're doing something more interactive than clicking on a random-number generator, many slots now offer periodic bonuses like free spins or minigames. These can be customized to an individual player's preferences, based on information stored on their casino loyalty cards, which are inserted into the machine during play. The systems that determine how and when these bonuses kick in have become the subject of fierce patent wars between IGT and its competitors, particularly Bally; the two companies have been locked in litigation for much of the past decade.

Among digital devices, slots are unique in the amount of regulation they must endure. Government overseers rely on several testing facilities—the largest of which are run by the Nevada Gaming Control Board, the other by Gaming Laboratories International of Lakewood, New Jersey—to verify that new machines perform exactly as their manufacturers promise. For starters, the devices must pay out as stipulated on their spec sheets; if a slot is designed to return 92.3567 cents of every dollar played over its lifetime, it better deliver precisely that amount over thousands upon thousands of laboratory spins. The machine must also prove capable of standing up to the ravages of power outages, 20,000-volt shocks, and numerous spilled daiquiris. "You need to be as secure as banking applications and as robust as military applications," Satchell says. "Because if there's a customer issue, you have to be able to trace what happened." If a casino's losses are found to have been caused by faulty software, the machine's manufacturer could be on the hook for reimbursement.

Since slot software is so difficult and costly to perfect, companies such as IGT jealously guard their programs as trade secrets of the highest order. "The industry considers intellectual property the most significant asset they have," says David Schwartz, director of the Center for Gaming Research at the University of Nevada, Las Vegas. A company like IGT simply won't stand for anyone stealing its lifeblood.

With his hack of IGT's circuit boards, Rodolfo Rodriguez Cabrera had stumbled into a terrific opportunity. He knew that the most-devoted slots players care a great deal about novelty, which is why IGT and its competitors roll out hundreds of new games every year. Casinos must periodically refresh their floors with updated machines or risk losing loyal customers to competitors who understand that IGT's The Hangover is now a much more desirable game than IGT's Dick Clark's Bloopers. But new machines typically start around $10,000. Cabrera realized he could make a tidy profit by buying used slots, updating them with fresh games, then reselling them to budget-conscious casinos in Europe.

Russia was then gearing up to outlaw most casinos, which meant cheap used machines were flooding into the Baltics. The big challenge for Cabrera would be to develop an extensive library of IGT games; pirating code was not his forte. He solved that issue by hiring a local to write a software-cracking program called IGT Quad Clone, which allowed Cabrera to rip the software from any IGT memory card to a Windows-based computer, using a standard USB connection. The game program could then be flashed onto new cards with a plug-and-play programming device that Cabrera had purchased from a Russian merchant, no questions asked.

A mugshot of Rodolofo Rodriguez Cabrera, whose slot machine counterfeiting ring quickly became a global operation.

Photo: US Attorney's Office, District of Nevada

Soon Cabrera was doing a brisk trade selling his refurbished machines to customers throughout Europe. As FE Electronic began to thrive, Cabrera came up with a clever way of fattening his profit margins even more: Instead of buying and revamping used machines, he would simply manufacture his own. All the necessary parts were readily available on the secondhand market: IGT's stock cabinets and proprietary circuit boards, as well as generic components like LCD monitors and power supplies. When Cabrera added up all the expenses, including printing glass signage to make the games look authentic and even faking IGT serial number plates, the cost was still considerably less than buying a genuine used machine from Russia.

Demand for these new machines was so strong that Cabrera had to go on a hiring spree; FE Electronic's staff ballooned to 20 employees; most spent their days soldering jumper wires onto IGT's proprietary circuit boards. Cabrera, meanwhile, continued to hone his mastery of the machines. He figured out a way to make the games work with just four or five memory cards each, instead of the 16 cards IGT normally uses. Cabrera took pride in the fact that he was improving the technology of a company he held in the highest regard.

In early 2006, shortly after returning from a gaming expo in London, Cabrera received a phone call from an American named Henry Mantilla. A former project manager at the Palms in Las Vegas, Mantilla had recently moved to Cape Coral, Florida, to join Aqua Gaming, a company that sells refurbished slot machines worldwide. He had heard through the industry grapevine that Cabrera had a special knack for fixing damaged IGT circuit boards. Might the company study how Cabrera performed his craft? Cabrera readily agreed.

Nearly a year later, in January 2007, Mantilla and his boss, Aqua Gaming president Charles Frost, paid a visit to FE Electronic. It was a huge moment for Cabrera, a chance to expand his booming business to a whole new hemisphere. When his guests arrived that day, Cabrera beckoned them through a service door and up a flight of stairs. The trio entered a spacious workshop where tiny plumes of white smoke hung in the air—the product of multiple soldering irons making connections simultaneously. Four employees sat hunched over a workbench, tweaking electronics; others had their heads buried in slot-machine cabinets, installing LCD monitors and button sets. In the room stood 40 finished machines, each indistinguishable from a genuine IGT product.

Cabrera ushered Frost and Mantilla into a side room, where he popped open a briefcase. Inside was the burner he used to load IGT software onto new memory cards. He boasted to the Americans that he could duplicate any IGT game on the market. Frost snapped photographs of the counterfeiting equipment as the Spanish-speaking Mantilla translated Cabrera's spiel.

"IGT realized something was wrong when sales of its slots plummeted in Peru."The Americans' visit didn't end with a major deal, but Mantilla and Cabrera managed to develop a warm bond. Several weeks after his return to the US, Mantilla called Cabrera to discuss his frustrations with Aqua Gaming. He wasn't happy at his job, and he yearned to strike out on his own. Mantilla suggested that Cabrera could assist with that plan by making him FE Electronic's exclusive US distributor, in exchange for 50 percent of all sales. He stressed that his language skills would come in handy when dealing with Latin American clients, and that he still had strong contacts in Las Vegas.

Cabrera was wary of partnering with someone who was just starting out, but he was won over by Mantilla's genial charm. Mantilla was a young father with a good heart and something to prove; Cabrera figured he would be plenty motivated to move product. He agreed to make Mantilla's new company, Southeast Gaming, his sole representative in the Americas.

Just as he'd promised, Mantilla started doing extraordinary business right away. FE Electronic shipped containers full of machines to Mantilla in Florida or directly to brokers on the Eastern Seaboard and in Latin America with whom he had set up deals. The two men faithfully split the proceeds right down the middle; during their first year in business together, Mantilla wired at least $400,000 to Cabrera's Hansabank account in Riga, a fortune by Latvian standards. Few slots dealers could resist the lure of prime IGT machines for pennies on the dollar.

IGT realized something was amiss in mid-2007. Sales of its machines were suddenly plummeting in Peru. The company began to suspect that counterfeit slots were to blame. When its engineers took apart several suspicious machines pulled from casino floors, they found circuit boards that had been modified with jumper wires and off-brand memory cards. IGT quickly discovered that the Peruvian casinos were getting these slots from suppliers who dealt with customers all over the world, including the US. "This was no small problem," says Robert Melendres, IGT's chief legal officer. "This was millions of dollars in business."

Meanwhile Cabrera and Mantilla had developed a problem of their own: They had so many orders to fill that they could barely keep pace. Building and shipping machines was both time consuming and expensive, with each cargo container full of merchandise costing around $30,000 to send across the Atlantic. So Mantilla branched out into a less cumbersome line of business: selling Cabrera's pirated software so slot dealers could build their own machines—any established refurbisher would be able to easily get fresh cabinets and signs. He sold the programs preloaded onto memory cards, along with detailed instructions on how to do the jumper-wire hack to make the cards work.

With his newfound wealth, Cabrera moved into a sparkling modern apartment in a neighborhood just east of downtown Riga. His first marriage had dissolved years earlier, and he decided to try again, this time with his longtime girlfriend, Olga, a gorgeous woman 15 years his junior. Cabrera made a triumphant return to Cuba for the wedding, which offered him a chance to show his extended family just how prosperous he had become. Henry Mantilla and his wife, Vanessa, were there to toast the happy couple's future together.

On the afternoon of April 15, 2009, Cabrera decided to take a short break from work to hit the gym. When he returned, he found a fleet of vans from Latvia's Ministry of the Interior blocking FE Electronic's driveway. Thirty cops in body armor were streaming in and out of the building, wheeling out dozens of slot machines.

Cabrera was baffled by the number of police officers. He immediately wondered if the Latvian government had mistaken him, a tax-paying small-business owner, for some sort of mafioso. But then he noticed that one of the cops standing watch over the front door had dark brown hair—something of a rarity in Latvia, where much of the population is blond. As the man turned to speak to a colleague, Cabrera saw a can of Coca-Cola jutting from a side pocket of his backpack. That was when Cabrera understood what was going on: the Americans had come for him.

As Cabrera glumly watched his business get stripped bare, the brown-haired cop's fellow FBI agents in the US were busy raiding Southeast Gaming and three other companies suspected of receiving or selling FE Electronic merchandise.

IGT had provided the FBI with the locations of alleged counterfeit machines, and the bureau had quickly traced them through various middlemen all the way back to Southeast Gaming. Apparently Mantilla hadn't been too careful in his dealings. "He asked if I wanted to buy some cloned boards—he said, 'Look, we reverse-engineer these,'" says Nevin Moorman, owner of East Coast Slots of Pompano Beach, Florida, who had been approached by Mantilla. "I said I wouldn't touch that shit with a 10-foot pole—I'm too pretty and I ain't that big, so I don't want to go to prison."

The FBI had little trouble luring Mantilla into doing business with an informant, a Las Vegas slot dealer who repeatedly purchased preloaded memory cards from Southeast Gaming. Mantilla grew to trust this informant so much that he eventually offered him one of Cabrera's burners. He was willing to do so because he needed help; Southeast Gaming had too many orders to fill, so he wanted someone to assist with burning software onto memory cards. "That raised the stakes," says Thomas Dougherty, a trial attorney with the US Department of Justice's Computer Crime and Intellectual Property Section. "It created a lot more urgency, in that we were concerned about them transferring the ability to counterfeit these devices so others could flood the market."

Cabrera spent just two days in Latvian custody before being released. His lawyers advised him that the worst punishment he faced was community service. But then in August 2009, Cabrera was suddenly rearrested and sent to Riga Central Penitentiary, where he was informed that he was likely to become the first criminal ever extradited from Latvia to the US.

Cabrera was astonished. He knew his business ran afoul of the law, but it wasn't like he was causing anyone physical harm.

What Cabrera failed to understand was that his operation had exposed a major vulnerability at a multibillion-dollar company—"one of the major corporate citizens of Nevada," as Dougherty calls IGT. And there is nothing that slot manufacturers fear more than losing control of their code. An example had to be made of the Cuban-Latvian hacker.

"I never thought that I would ever go on a vacation to the US," Cabrera says in Spanish, chuckling slightly. We are sitting in a visitor's room at a jail in Haskell, Texas, separated by a thick pane of Plexiglas. A wiry, neatly groomed 45-year-old who looks like a Latin version of Scotty from Star Trek, Cabrera explains that this is the 10th detention facility he's passed through since arriving in the US. The worst of the lot was a privately run prison in Eden, Texas, where his fellow inmates rioted over poor conditions and had to be subdued with tear gas.

The lowest moment, though, came right after he and Mantilla were sentenced in Las Vegas last August. Having pled guilty to conspiracy to produce and sell counterfeit IGT slot machines, the former partners were handed identical sentences: two years in prison and a $151,800 fine. (Had they gone to trial, they would have risked getting up to 45 years each.) Cabrera was then suited up in a straitjacket, chained to some other inmates, and loaded into a prisoner transport van for a ride to Chaparral, New Mexico, where he was to be processed into the federal penal system. During the 15-hour trip across the boiling-hot desolation of western and southern Arizona, he just stared at the scrub brush, wondering how his life had gone so awry.

Having been credited with time served for the months he spent in Latvian custody, Cabrera is now awaiting deportation back to Riga. But that process has proven more complicated than anyone anticipated. Though he moved to Latvia in 1985, Cabrera never became a citizen; he instead kept renewing his residency permit every five years. His latest permit expired while he was incarcerated, meaning that he can't go home. Cabrera had a Cuban passport, but it was seized upon his arrival in the US. He is now stateless.

As he waits to see whether the US and Latvia can sort out his immigration status, Cabrera spends 23 hours a day locked in his cell. The isolation has given him plenty of time to ponder how he got into this mess. "I am a person who can fix things," he says. "And there is a time when a person who can fix things, when he has been doing it long enough, realizes he can do something more, too. And the moment you realize that is the moment you've just done something illegal."

If Cabrera does make it back to Latvia, he vows to take his career in a radically different direction; he claims that he would like to help gambling addicts, though he is vague on the specifics. He does not believe that his retirement from slot counterfeiting is any great cause for celebration at IGT, however. "What I was doing, it is a common thing," he says with a shrug. "If you studied electronics, you could do it, too." Especially if you love to tinker.

Contributing editor Brendan I. Koerner (brendan_koerner@wired.com) wrote about US manufacturing in issue 19.03.