You are totally right with respect to the fact that it isn't aboveboard, but one of the biggest problems with our legal system is that you need money to protect your money. Other wise you'll go bankrupt while their attorneys file delay motions causing you to have to pay your attorney more and more.
I was the CTO of a company and built its entire infrastructure for 4% of the business. One day I came into work and the CEO(and majority owner) tells me to put aside everything and start work on a totally separate project. Oh, yeah and the company name is now different. The new project that I'm assigned is much more intensive in terms of volume and uptime requirements and came with no rewards.
So I start building the company in good faith with no real contract in place with the new company with the expectation that we would negotiate while I developed so as to not cause delays. This was a naive decision. Always get the contract first because as soon as real money starts flowing in everyone starts grabbing theirs. Prior friends or acquaintances also get preferential treatment which is how I ended up with the VP of marketing taking assignments from me and yet somehow being given 9x as much equity.
Eventually, after the system was stable and I felt confident in my work quality I asked to negotiate my contract. I was instead let go. The joke was on them though, I revoked their access to the repository and told them to show me the contract that says the software is theirs.