
33 Cal.2d 223 (1948)
JOHN M. HENRY, Respondent,
v.
GENERAL FORMING, LTD. (a Corporation) et al., Defendants; CHARLIE MARSALISI, Third Party Claimant and Appellant.
L. A. No. 20724. 
Supreme Court of California. In Bank.  
Dec. 28, 1948.
 Third party claim proceeding. Judgment against claimant reversed.
 John L. Bisher, Jr., and S. L. Kurland for Third Party Claimant and Appellant.
 Thomas W. Hughes for Respondent.
 SHENK, J.
 This is an appeal by third party claimant from an adverse judgment in a third party claim proceeding.
 On March 21, 1947, the present action was commenced by the plaintiff against various corporations and individuals including Kenneth L. Morehouse (herein referred to as defendant), who were makers and guarantors on an unsecured promissory note in the principal sum of $5,000. On April 28th, 1947, pursuant to a levy under a writ of attachment the sheriff took possession of a 1947 Buick sedan registered in the name of defendant as legal owner. Third party claim proceedings instituted by Charlie Marsalisi followed and a hearing was had to determine ownership and right to possession of the vehicle. The following undisputed facts appeared.
 On April 9th, 1947, the defendant was notified by the Buick dealer that he was next on the list for the purchase and delivery of a new car. Defendant was unable to finance the purchase. On April 19th, he sold his purchase rights to Charlie *225 Marsalisi, a used car dealer, for $200. Marsalisi's agents, with a check covering the amount of the purchase price, accompanied the defendant to the Buick agency and consummated the transaction by the use of Marsalisi's check as the consideration and the defendant's name to designate the transferee on the registration and title papers. The defendant immediately turned over to Marsalisi's agents the possession of the vehicle and papers. It is conceded by the plaintiff that the defendant did not own any interest in the vehicle which stood on Marsalisi's used car lot until taken by the sheriff. The judgment that the defendant was the owner and entitled to possession of the automobile rested on a determination that asserted violations of the Vehicle Code required that result.
 Section 186 of the Vehicle Code provides: "No transfer of the title or any interest in or to a vehicle registered hereunder shall pass and any attempted transfer shall not be effective unless and until the parties thereto have fulfilled" requirements for registration then specified. No contention is made that the registration requirements were not discharged in the transfer of title to the defendant; but neither he nor Marsalisi complied with the requirements of the code to show registration of the vehicle in Marsalisi as owner. Section 178 provides that the registered owner is released from liability for negligence when, upon making a transfer, he complies with certain requirements. Section 140 makes it a misdemeanor "for any person to drive or move, or for an owner knowingly to permit to be driven or moved" upon the highway a vehicle which is required to be registered and which is not registered or for which the appropriate registration fee has not been paid. Section 230 makes violation of any of the provisions for registration a misdemeanor.
 Section 31 of the Penal Code defines as a principal one who aids or abets the commission of a crime, whether felony or misdemeanor. Section 659 of the same code provides that whenever an act is declared a misdemeanor a person aiding or abetting is also guilty of a misdemeanor.
 [1] The plaintiff invokes the general principle declared in Kyne v. Kyne, 16 Cal.2d 436, 438 [106 P.2d 620], that the courts will leave culpable parties where they are at the outset of the litigation. Lacking that support for the judgment the facts are controlled by the well-settled rule that an attaching creditor, seeking to subject the property of a debtor to the payment of his debt, obtains a lien only upon the title or *226 interest which the debtor has, and where no actual interest is shown the attaching creditor gets nothing by virtue of his levy. The lien attaches to the real and not the apparent interest of the debtor. (Kinnison v. Guaranty Liquidating Corp., 18 Cal.2d 256, 259-260, 263 [115 P.2d 450] and cases cited; Jensen v. Hugh Evans & Co., 18 Cal.2d 290 [115 P.2d 471]; Carpenter v. Devitt, 49 Cal.App.2d 473, 475 [122 P.2d 79]; Willard H. George, Ltd. v. Barnett, 65 Cal.App.2d Supp. 828 [150 P.2d 591].) [2] A resulting trust was created by the consideration for the vehicle being furnished by Marsalisi, whereupon he owned the beneficial interest and the defendant held the legal title as trustee. (Goes v. Perry, 18 Cal.2d 373, 379 [115 P.2d 441] and cases cited.)
 [3] It may be assumed that there has been a violation of the provisions of the Vehicle Code invoked by the plaintiff, as to which prosecution on a charge of misdemeanor might ensue as against both the defendant and the third party claimant. But it does not follow that the violation has the consequence claimed by the plaintiff. In no case relied on has it been so held. On the contrary similar assumed violations of the Vehicle Code have never been deemed to affect the actual property interest in the vehicle where it was necessary in pertinent proceedings to determine the issues of title and right of possession. (Boles v. Stiles, 188 Cal. 304 [204 P. 848]; Kenny v. Christianson, 200 Cal. 419 [253 P. 715, 50 A.L.R. 1297]; Carpenter v. Devitt, supra, 49 Cal.App.2d 473; Dennis v. Bank of America etc. Assn., 34 Cal.App.2d 618 [94 P.2d 51].) In Willard H. George, Ltd. v. Barnett, supra, (65 Cal.App.2d Supp. 828), the contention that the rights of a third party claimant who held the beneficial interest was forfeited by noncompliance with the registration requirements was expressly rejected.
 The present contention relating to the effect of culpable participation in an act of noncompliance with registration requirements declared to be a misdemeanor was not considered in the foregoing cases. Extended consideration, however, is not necessary to demonstrate its lack of merit.
 [4] In his argument the plaintiff assumes "illegality" of the "contract." He talks of the "illegal transaction" and "illegality" of the transaction. The assumption may not be indulged. The code provisions do not aim at tainting with illegality the sale and purchase of an automobile which is the only contract or transaction involved. The requirements deal solely with registration of ownership to give notice of *227 the transfer after the purchase has been consummated. Therefore cases such as Kyne v. Kyne, supra (16 Cal.2d 436), involving wagering and similar unlawful transactions, are inapplicable. The legal consequences of violation of provisions for registration are to be resolved by the express provisions of the Vehicle Code. The failure of the passing of title or ineffectiveness of an attempted transfer thereof declared to follow noncompliance ( 186), and "illegality" of the purchase and sale transaction are distinct and unrelated factors in the sense that the latter without more does not flow from the former. The requirements for registration of title and ownership, as indicated by the code provisions, were enacted in the interest of the public welfare to protect innocent purchasers and afford identification of vehicles and persons responsible in cases of accident and injury. (Parke v. Franciscus, 194 Cal. 284 [228 P. 435].) Unquestionably as between the plaintiff and the defendant the facts do not give rise to an estoppel, and the plaintiff, as a general creditor of the defendant, is not one for whose protection the ownership registration requirements were intended. There is no principle of law pursuant to which the property of the third party claimant may be taken from him and given to another who concededly has no right or interest therein.
 The foregoing necessitates the conclusion that the court should have adjudged the third party claimant to be the owner and entitled to the possession of the automobile and renders unnecessary discussion of other points.
 The judgment is reversed.
 Gibson, C.J., Edmonds, J., Carter, J., Traynor, J., Schauer, J., and Spence, J., concurred.
