If your credit is bad, you should not borrow money to buy a home. Get your financial house in order before you ask a lender for a mortgage. There are no shortcuts such as credit repair or finding that one mortgage Lender who accepts loans for "500" credit scores!
I'm sorry if I sound rather obnoxious with my advice, but my polite approach doesn't seem to work when I answer these "bad credit" questions here on Trulia. Besides, I've already been down this road. When I blogged and participated in online forums and chats during the BOOM (Craigslist Housing forum, look me up: tcurranmortgage), I held the line on my opinion: buy a home you can afford with a 30 year fixed rate payment. I never wavered from that opinion and I won't waver from this one today.
Take your time to put your finances in order. Learn what a responsible HomeBuyer needs to qualify for and pay for a mortgage loan. Then work on those things---Income, Assets, and Credit---so you can make your dream come true the RIGHT WAY.