Help to generate serial number...

Discussion in 'Questions (Windows Mobile)' started by belotrei, May 29, 2007.

  1. belotrei

    belotrei Member

    Is there any good idea to generate serial number for a software? I've tried using hardware library and want to generate serial number from getdeviceid but it seems not working for all devices (including me) --> empty string. Is there any way that can be used to generate serial number and unique for each device?

    I want to try this one but don't know how... :
    How to read the owner name from the registry. It seems like ascii (64 00 34 00 55 20 etc...,) (not text.)

    **But if someone change the owner name to the owner name that already registered so he can use the serial number with the registered name. Hmm... yeah, at least there's some protection... :sign0161:

    Need help...
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I recommend you to use the device name which is stored under LocalMachine\Ident\Name.
    The Owner Name value doesn't always exist.
     
  3. belotrei

    belotrei Member

    Erel, that can be used. But... that's not a unique name. It can be same for many devices (because it is an original device name (if not yet changed, factory setting)). And however, the users can change it to whatever he wants. The protection seems useless with this method, isn't it? Just need one serial number, share it and change the device name to the registered one...

    Any better idea?

    Btw, thanks Erel.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    I don't think it is useless.
    Anyway you can check if the owner name exists and if it does, read it and calculate the sum of all bytes or convert it to a string (assuming you are not showing the string to the user).
     
  5. Cableguy

    Cableguy Expert Licensed User

    I have searched for all key in my registry for the machine serial number, that is found in the back sticker...No success!!!!
    I'M Sure that that can be found in some part of the regestry or even in some hidden file...But where?
     
  6. belotrei

    belotrei Member

    Erel, maybe i'll try your sum of the owner name bytes method. But still find a better method... Actually what Cableguy said is exactly the best way to generate serial number for protection. Can't be cheated.. Yeah, but unfortunately until now I still haven't found way to read the machine serial number out...
     
  7. petrbury

    petrbury Member Licensed User

    Cableguy, I'd like to ask you, why are you sure, that this SN is somewhere in PDA ?
    Have you found some information about it ?
    Petr
     
    Last edited: May 30, 2007
  8. Cableguy

    Cableguy Expert Licensed User

    No I have not, but from my (short) experience with cellphone cranking, i came to notice that most manufacturers hardcode the information and it was aaceessible by the introduction of a pre-formated code...like for imei we entered *#06# and it shows up in the screen....but how to tap into it?
     
  9. petrbury

    petrbury Member Licensed User

    Hmm, maybe somebody knows it and will let it know. It would be usefull, I think.
    Petr
     
  10. Cableguy

    Cableguy Expert Licensed User

  11. Erel

    Erel Administrator Staff Member Licensed User

    That is the API that GetDeviceID (in the Hardware library) uses.
    However it is not supported on all devices.
     
  12. dzt

    dzt Active Member Licensed User

    I thing that there is not "ONE and ONLY ONE" secure and reliable way of getting unique device ID of a WindowsCE device (I mean pocketpc2002, pocketpc2003, windows mobile 5.0 etc.) of every manufacturer.

    I even believe that not all devices HAVE a unique ID.

    That's why WindowsCE apps generally don't use device ID for protection but only these targeting specific device.

    There are many many pages on the internet about, and as you read you are becoming more confused.

    Take a look at:
    http://blogs.msdn.com/windowsmobile/archive/2006/01/09/510997.aspx
    and
    http://blogs.msdn.com/jehance/archive/2004/07/12/181116.aspx
     
  13. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Here's another subtly different approach to the problem...
    http://msdn2.microsoft.com/en-us/library/ms901392.aspx

    Most devices have a storage card, but if one isn't installed then you could revert back to the device ID or username. It might give more reliable results than the device ID method.

    Regards,
    RandomCoder
     
  14. Cableguy

    Cableguy Expert Licensed User

    About the way to go to get a "registration model" I'm thinking on this tipe of logic:

    Save a String in the regestry
    prompt the user abou its name(name)
    Generate a random string and use name to crypto it then the has to e-mail my company and reference the crypted result wich will be again crypted to match a specific String and then return it to the user who must enter it in the aproiate field, the the program recrypt the given string with the one returned in the random generated string and if it matches the saved regestry string the the serial number entered is valid..its a bit confusing but is a unique way of making sure it stays legal...

    Logic:
    save registry key, say "Cableguy"
    Pronpt the user for name, say "Paulo Gomes"
    Generate a ramdom string, say "xpto"
    Crypt "Paulo Gomes" with crypto key "xpto"
    Result is the registration key to send to software co. along with the User Name
    With this registration key and User name we, the software co, create a serial key that when crypted with the key "registration key" cames out as "cableguy".

    So unless we have two devices giving exactly the same random string, it is unlikelly that two users get the same serial number....

    its a bit like the activation key from microsoft...
     
  15. RandomCoder

    RandomCoder Well-Known Member Licensed User

    I have another even better idea....
    Why not keep it open source for all to enjoy and improve :sign0060:

    Regards,
    RandomCoder
     
  16. belotrei

    belotrei Member

    Wuiiihh... lots of ideas.. Cableguy, that's nice. But if the registry is hacked, can it be cheated?

    Randomcoder, yeeahhh open source sounds cool too, but that's another story.. Hope Microsoft and Basic4ppc can be an open source project... :sign0188:
    (Just kidding Erel...) :sign0060:

    Btw, Mozilla Firefox is a very good open source project... :)
     
  17. geryjohn

    geryjohn New Member

    Yup! I've got the same problem like belotrei. In fact, is there any (whatever) key in pda which can be used to generate serial number protection? But that key must fulfill 3 conditions :
    1. Unique
    2. Unchangeable by user.
    3. Retrieve/readable by basic4ppc. (this one is a must, of course... hehe..) :sign0060:
    4. Always exists in every pda.

    Thanks.

    Edit : add 4th condition..
     
    Last edited: Jun 7, 2007
  18. dzt

    dzt Active Member Licensed User

    No!

    :eek:
     
  19. geryjohn

    geryjohn New Member

    Thanks dzt.. At least i don't need to keep think and trying about this impossible thing anymore... :sign0161:
     
  20. Cableguy

    Cableguy Expert Licensed User

    I think the best choice is to make a demo app with some restrition of usage and then have the user purchase a full version app....
     
Loading...