Photo: Dell

At a low point in the romantic movie classic The Princess Bride, Andre the Giant’s character finds his once-proud swordsman friend defeated, drunk and destitute in the woods. The giant picks him up, nurses him to health, and brings him along to help save the day.

That scene should inspire investors eyeing Dell (DELL), the former PC king. The stock has looked like a dog for the past two years, thanks to accounting follies, management miscues, and a resurgent Hewlett-Packard. But with founder Michael Dell back as CEO, the company is showing signs of life, making it a good time to pick up the shares.

Of course, you’ll have to hold your nose – there’s plenty about Dell that stinks on first approach. Dell is still under investigation by the Securities and Exchange Commission for allegedly tweaking its earnings numbers to meet Wall Street targets. Analysts are not too worried about the probe, but it has meant Dell hasn’t filed a complete quarterly financial report in more than a year, making it difficult to get a clear read on costs, profits, and cash flow.

In its core PC business, Dell has been ceding global market share to HP (HPQ) – in the second quarter it was down to 16 percent from 19 percent a year earlier. And as PC buyers move from desktop computers to laptops, Dell is losing some of the advantage it reaped from its build-to-order model. (Dell relies more on overseas manufacturers to help assemble its laptops.)

Now the good news: While the SEC inquiry is worrisome, Dell’s internal investigation has concluded that at worst, the company overstated earnings by $150 million between 2003 and 2006, small change for a company with profits that topped $12 billion during that time.

And though Dell is second to HP globally, the company remained the top PC maker in the United States this spring, with 28 percent of the market, according to research firm IDC. Analysts estimate that Dell’s profit margins are actually higher these days because the average price of PC has been relatively stable for the first time in recent memory. (Results today from Intel (INTC) suggest the PC business overall is healthy, too; Advanced Micro Devices (AMD) reports on Thursday.)

Matthew Kather, senior research analyst at WR Hambrecht, has a buy rating on the stock, with target price of $34. Kather says he expects Dell to catch up with its late regulatory filings in November, giving investors a clear look at its operations. And he sees growth ahead: “They’re on the path to regaining some market share through expanding their distribution strategy into retail.” And as more businesses upgrade their systems to Microsoft (MSFT) Windows Vista, “that will obviously drive corporate PC sales,” he adds.

Most of Dell’s problems seem to be reflected in the share price. Trading at about half its peak level, Dell has a P/E of 19 times estimated 2008 earnings, quite low for a tech stock. (Apple’s (AAPL) forward P/E is 30.) From here, it shouldn’t take much of a turnaround for Dell shares to recover a chunk of lost ground.

A version of this story ran in Fortune magazine.