I'm not actually commenting on either A) or B), just on menloparkbum's comment that it's common for contractors to retain ownership.
I don't really want to get into the ethics of it, because I don't think ethical debates are particularly fruitful. (I took a course in meta-ethics in college, which makes me particularly suspicious in attempts to ground ethical judgments in factual statements or logical debate.) I'll tell you that I wouldn't do it; it sounds dodgy enough that I wouldn't really want to get involved with it. Ultimately, most ethical judgments come down to gut feelings about right or wrong.
I will say that right or wrong, I think it's stupid. You're opening yourself up to big legal liability. If acquirers or investors find out about it (and they will - that's what due diligence is for), they will nix the deal. Heck, I'm spending about $1K to have a lawyer draw up a release to make sure all IP I developed for my startup while employed belongs to me, and I didn't take any source code from my employer (I'm using a completely different technology platform and am in a completely different area of business.) It's just something I don't want to fuck around with.