Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Automated Program Serial Numbers

Automated Program Serial Numbers

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I'm developing a pkg in Visual C++ that will need to have a unique serial number for each copy of the software sent out. The program needs to be aware of its serial number, and it needs to be stored in a place somewhat inaccessible to hinder tampering. The "brute force" method would be to manually change a #define in the code and recompile before each delivery of each copy of the software. Totally unworkable. Does anyone know of a way to do this? I thought of somehow automatically editing the .rc file, but that gets folded in at compile time, so that won't work, either. I need a clever idea.... Thanks!

    P 1 Reply Last reply
    0
    • L Lost User

      I'm developing a pkg in Visual C++ that will need to have a unique serial number for each copy of the software sent out. The program needs to be aware of its serial number, and it needs to be stored in a place somewhat inaccessible to hinder tampering. The "brute force" method would be to manually change a #define in the code and recompile before each delivery of each copy of the software. Totally unworkable. Does anyone know of a way to do this? I thought of somehow automatically editing the .rc file, but that gets folded in at compile time, so that won't work, either. I need a clever idea.... Thanks!

      P Offline
      P Offline
      Paul Ranson
      wrote on last edited by
      #2

      In the dim and distant past when I was creating Novell Netware NLMs I did something like,

      struct SerialNumber
      {
      char sentinel [ 33 ] ;
      char serialno [ 33 ] ;
      } ;

      SerialNumber TheSerialNumber = { "That'll be the day, when you mak",
      "00000000000000000000000000000000" } ;

      Put that somewhere in static space, then write a separate application that searches the exe for the sentinel string (ensure there's only one instance if you're paranoid....) and sets the serial no to whatever is desired. I'd suggest encoding the serial on the way in and way out, this can be something fairly trivial, and perhaps using a likely looking error message as the 'sentinel'. Paul

      L 1 Reply Last reply
      0
      • P Paul Ranson

        In the dim and distant past when I was creating Novell Netware NLMs I did something like,

        struct SerialNumber
        {
        char sentinel [ 33 ] ;
        char serialno [ 33 ] ;
        } ;

        SerialNumber TheSerialNumber = { "That'll be the day, when you mak",
        "00000000000000000000000000000000" } ;

        Put that somewhere in static space, then write a separate application that searches the exe for the sentinel string (ensure there's only one instance if you're paranoid....) and sets the serial no to whatever is desired. I'd suggest encoding the serial on the way in and way out, this can be something fairly trivial, and perhaps using a likely looking error message as the 'sentinel'. Paul

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Thanks, Paul! That may just be the ticket! I need to create a separate exe anyhow, to automate serial number creation in the first place, so this should work nicely. Thanks again!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups