Turning Piracy into Profits: a Theoretical Investigation