Archive: Generate Random Serial Number


Generate Random Serial Number
Hi All

Does any body have a plugin or an algorthim which will allow me to generate a random serial ID about 10 characthers long, each time the installer is executed

cheers

Carlos


You can get the current time using System.dll (search the forum for time and system, there are some topics about this) and pass it on to MD5. It's fairly random.


Yeah thanks for the info, is there any way to decode the the MD5 string. Back to the original form


No, MD5 is one way. If you want something you can decode back you can try the new Base64 encoder/decoder plug-in dselkirk wrote.


Originally posted by kichik
... and pass it on to MD5.
Oops, I missed that one. I created an NSIS MD5-plugin myself last week :eek:

Didn't know there was one already... :)

Does anybody have this compiled in a dll form, has i dont have VC on my actual development machine!


QueryPerfomanceCounter gives 13 decimal digits for me (10 hours uptime, 1 ghz). That value can vary from computer to computer and from time to time, but that could be enough to use much simplier methods to get your serial. (see other random thread for QPC system call).


Compiled version.


how come there is no documentation on the syntax (tried forum and wiki)?


It was probably in the original source file which is now lost. A quick disassembly shows it has two functions - Encode and Decode. Both accept a string in the stack and return the result on the stack as well.


I just open sourced a Visual Studios 2010 project built in C# using .NET 4 to make random serial numbers.

The project is open source and free to download to make random serial numbers or just random C# strings.

Video Tutorial
http://tiny.cc/glp77

Download Link
http://tiny.cc/dxcib