Shop OBEX P1 Docs P2 Docs Learn Events
How can I protect a part of a source code ? — Parallax Forums

How can I protect a part of a source code ?

markustermarkuster Posts: 184
edited 2007-09-14 15:48 in BASIC Stamp
I have developed a Source code for BS2.

The source code is simple , move some servos
and the source turns on and off an speaker alarm from one minute
to five minutes just changing a Pause.


I will send this Source code to a frind.
My friend doesn't know anything about Basic Stamps
and I am afraid she could modify all the Source code.

My question is how can I protect the souce code and show
the Pause only , or blocked some Source lines .

Or show a part of the source code.

( I don't know)


Thanks , Mark
PS: Generate a single executable is not a solution.

Comments

  • pwillardpwillard Posts: 321
    edited 2007-09-13 15:59
    Migrate your application to an SX/28 maybe?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
  • JonathanJonathan Posts: 1,023
    edited 2007-09-13 16:04
    It sounds like you are not worried about her stealing your code, just modifying it so it won't work, right?

    If this is the case, she can always re-load the original code, or you can resend it. As long as she saves the code with a different name, there should be no problem.

    If you are worried about code protection from theft, it is impossible to *completely* protect the program. But, if your friend can't even modify the code corecctly, she sure won't be able to steal it. If this is the case, just send her a pre-programmed Stamp.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • LilDiLilDi Posts: 229
    edited 2007-09-13 16:10
    You could also write protect the file in Windows
  • kb2hapkb2hap Posts: 218
    edited 2007-09-13 16:37
    What about· "File->Generate Object Code" in the PBasic software?

    She wont be able to see any of the source and if you really want here to be able to change

    timers an such just set some serin/debugin commands and have her enter them through a terminal viewer.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-09-13 16:46
    +1 to the "File->Generate Object Code".
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-09-13 17:04
    +2 to the "File->Generate Object Code". You say thought that a single executable is not a solution. Why not? You can write your program to include a menu that would allow your friend to modify certain parameters, like the Pause.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • markustermarkuster Posts: 184
    edited 2007-09-14 01:04
    Thanks Tracy and DTQ


    I would like to use a menu and
    Generate Object Code
    but I how can I add a menu ?

    Do you know where can I find this information
    or an example ?

    Thanks Mark.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-09-14 05:56
    MArk, Here is a sample menu. It runs when the program starts up, so if the user has a terminal attached, the UI the interaction can take place. There is a timeout on the SERIN command so that the program won't lock up if no terminal is attached or if the user simply walks away. The program simpy continues after 30 seconds into the main program, using the existing pause parameter read from the eeprom. Here there are only two active choices but there is a template for additional choices.

    pauseLoc  DATA 1000  ' default pause of 1 second is stored in eeprom as DATA
    choice VAR byte
    zzz VAR Word   ' this variable will hold the active pause value
    wy VAR Word
    
    top:
     ' intitialization goes here
    menu:
      SEROUT 16, $54, [noparse][[/noparse] CR, "1)set_PAUSE   9)run_Program",CR,">"]
      SERIN 16,$54, 30000, main, [noparse][[/noparse] dec1 choice]
      ON choice GOTO menu, set_Pause, menu, menu, menu, menu, menu, menu, menu, main
      ' choices 1 & 9 are implemented
    
    main:
      READ pauseLoc, WORD zzz   ' fetch the pause value, here, or read it in later when needed
      ' rest of program goes here.
      END
    
    set_Pause:
      READ pauseLoc, WORD zzz
      SEROUT 16,$54, [noparse][[/noparse] CR,"Pause value=", DEC wx ]
      SEROUT 16,$54, [noparse][[/noparse] CR,"enter new Pause value, 0 to leave as is> "]
      SERIN 16,$54,30000, menu, [noparse][[/noparse]DEC wy]
      IF wy>0 AND wy<>zzz THEN WRITE pauseLoc, WORD wy
      GOTO menu
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 9/14/2007 6:02:56 AM GMT
  • markustermarkuster Posts: 184
    edited 2007-09-14 15:48
    Thanks Tracy ,


    Mark.
Sign In or Register to comment.