You may want to consider Software Protection and Licensing from a vendor and not roll it yourself.
The high end versions of these solutions accomplish binary protection and encryption quite well and can require things like a token or hardware dongle to utilize the software.
Additionally given you've been pirated already, from a business perspective a freemium model might be helpful for converting pirate customers to real customers.
You may want to consider Software Protection and Licensing from a vendor and not roll it yourself.
The high end versions of these solutions accomplish binary protection and encryption quite well and can require things like a token or hardware dongle to utilize the software.
Additionally given you've been pirated already, from a business perspective a freemium model might be helpful for converting pirate customers to real customers.
Hope it works out for your business!