I don't think it's a good idea to buy a software company for the aim of making money. First, it'd be little difficult to understand the schema of a company which is already running and further it's even more difficult to analyse such company from outside or by just looking at the statistics.
I must say, it's better to invest in a start-up because they are little bit flexible and simple at the beginning to understand. Also, you get more chance to hit the jackpot.
Any good already running software company might be not interested to sell unless there's some problem. So, just stick to the start-ups.