You need to do some reverse engineering to the software you want to crack, run it using some program like OllyDbg or something like that and find the code check part and skip it or decipher the "license code" pattern and then create a software with a high level programming language (like C#, java, etc) that generates random codes using the pattern you discovered with the reverse engineering.