It is a violation of the Vehicle Code to sell a vehicle without its passing a smog test first. If you can prove the vehicle could not really pass a smog test (and it sounds like you might be able to), then the sale was illegal and arguably void. It also sounds like the person who sold the vehicle may have hidden some serious defects from you as well. If you can prove that, you may have a claim for fraud. Under either circumstance you could push to rescind the contract. The issue you may have is that the sale is two years old, so there will be an argument to made that the problems with the vehicle occurred after your purchase. Depending on the amount of your purchase, you might want to file in small claims court. You might also consider contacting an attorney who can draft a demand letter on your behalf. However you proceed, please take action immediately as there are statutes of limitations which preclude you from suing if you take too long. I wish you the best of luck!
The above is general legal and business analysis. It is not "legal advice" but analysis, and different lawyers may analyze this matter differently, especially if there are additional facts not reflected in the question. I am not your attorney until retained by a written retainer agreement signed by both of us. I am only licensed in California. See also avvo.com terms and conditions item 9, incorporated as if it was reprinted here.