I need to get HDD serial number to use it as a key for licensing a software. I used diskid32 code in this url: http://www.winsim.com/d
Basically you're relying on data that's not strictly reliable to begin with. Drives may change over the lifetime of a computer; all the while getting exactly the right serial number isn't even important to your product.
One easy hack I can think of is to normalize the serial number, e.g. by sorting the digits; this will make more drives look alike, but I doubt it will become an issue.
Another way of looking at the problem is that the application should provision for serial number changes; the user could be informed about the licensing issue (for whatever reasons) and asked to contact the support department with a generated code (not necessarily the serial number itself). Given this code, support can then create a new license for the customer.