No announcement yet.

uSD copy protection

  • Filter
  • Time
  • Show
Clear All
new posts

  • uSD copy protection

    ~We are evaluating the uLCD-32PTU device.
    Program is already running from uSD and updates are made by replacing the uSD but we need some kind of copy protection to 'flag' the program to a specific device.
    -> Is there a built in copy protection mechanism to use?
    my attempt is to 'hardcode' a serial number or HW id into source code and verify against it at startup.
    -> How can we retrieve a 'unique' Id from the device?
    Later I'd want to replace the Id in source and build automatically.
    -> Is a command-line compiler available or any other way to automate the build process?

    many thanks in advance!

  • #2
    The idea would be to write 'something' on the uSD 'somewhere' that your program could read back (using media commands). You could put this on an unused part of the uSD card, or you could create a RAW partition and put it somewhere in there. Your program would then read and compare this during startup.

    Pitfall 1. A fully Cloned card will have the same information
    Pitfall 2. A carefully comparison of the .4xe will reveal the 'magic number', but not its location. A simple obfuscation of the number will suffice, but, of course a compare of two cards will quickly locate it. Of course this could also be obfuscated by writing one or more random sectors and using that as additional obfuscation.

    Another idea is to use the Serial number of the uSD card. This cannot be copied, but it will mean your program is tied to the uSD in that it will need its serial number reading before the program can be created.

    A combination of the two above ideas will probably help even more.

    There is no Windows program, that I am aware of, that can read the uSD's serial number. *nix, on the other hand tends to display it as part of the cards properties.

    The uSD tester tool in Workshop reads and displays the serial number on the Display. Immediately after running this utility you can find the source to it in C:\Users\Mark\AppData\Local\Temp\temp4D.4dg

    Information on the command line compiler and how to create .4xe(s) from it can be found here


    • #3
      Thanks for your suggestions! The protection does not need to be water proof, it should prevent "normal" end customers to pass over the uSD content to another device neither to upload it somewhere.
      Your first Suggestion sounds practical but i think i need it the other way around:

      Is this possible:
      - download a small lib ie. a single function returning the id (int, string, whatever) into device's Flash - of course 'something' must be unique and therefore changed for each device.
      - running the prog (with the same hardcoded id) from uSD calling the function from Flash to compare the ids
      - put 'something' into Flash and use the media functions you mentioned from uSD program...


      • #4
        You can't call a Flash program from a uSD program (which must, by definition be a RAM program).

        But since you need a Flash 'Stub' program to load and call a uSD program you can have the unique ID in the stub program and pass it to the uSD (RAM) program as a parameter


        • #5
          Thank you, I think this will solve my issue!
          Is there any documentation for creating / modifying the stub program?


          • #6
            Hmm, not really.

            If you want to see the Genie Stub program, create a Genie program, run the 'Boot uSD' utility and then look in C:\Users\Mark\AppData\Local\Temp\temp4D.4dg for the source. There's not much to it.


            • #7
              that works, thank you!

              now i'm trying to automatically build the 4d Project with 4dcompiler.exe which as i found in another thread doesn't create the .4fn file. Unfortunately most links in these other threads are broken but i found a 'hint' to an executable somthing like "4fn_4xe.exe".

              is it still available / how could i build the Project to get the .4fn file?


              • #8
                The link I gave above had another link to how to convert the compiler output into the .4fn file.

                That second link was to the old forum site that seems to be no longer available.

                I updated the particular link to point to the thread in the new forum.

                Everything from the old forum is on the new forum, unfortunately it looks like some of the links have not been converted, which makes it just that little bit harder to actually use them.

                The old forum seems to have reappeared, so old links are working again, for a while at least


                • #9
                  Many thanks for your Support and to Patrick who kindly posted his Compiler!