Shop OBEX P1 Docs P2 Docs Learn Events
Pulling code off a BS2 — Parallax Forums

Pulling code off a BS2

th3jesterth3jester Posts: 81
edited 2008-11-04 01:28 in BASIC Stamp
I was working on a project a long time ago and have started it up again. Although I lost the source code on my pc. I understand not being able to pull code off a BS2 is a safety feature, yet I know there is a way to do it. Will anyone please share this with me and if you don't want it to be public then email me @ th3jester@gmail.com.

Thank you,

th3jester

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-04 00:10
    There is no way to do it. This question has been asked numerous times.· It's not a secret.

    1) You could download a very short program to the BS2 that would dump the rest of memory, but it would overlay part of what you want to get and there's no way to get around that.

    2) You could desolder the EEPROM from the Stamp module, then it's trivial to read it totally. You may or may not be able to get the Stamp to work again.

    3) You might be able to connect very fine wires to the SDA and SCL pins of the EEPROM and hold the Stamp's processor in reset so it won't try to read the EEPROM, then have some external circuitry read the EEPROM.
  • th3jesterth3jester Posts: 81
    edited 2008-11-04 00:16
    Thank you for your response. Downloading a short program to the BS2 seems like the best option, because I won't hurt the BS2 and not all my code will be lost. Thanks again,

    th3jester
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-11-04 00:31
    You'll STILL need a program on the PC, able to read "raw" BS2 tokens, and convert them back to source code. I don't know that such a program exists.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-04 00:38
    Yes, even though you can recover some of the "byte codes" for the program, there's no good documentation on decoding them and the labels in the program are not recoverable. A lot of the "meaning" of the program and its structure is lost as part of the compilation process.

    What I'm trying to say is that technically you could recover part of the program stored in the EEPROM, but it's not in a useful form and you'll never get your original source program back.
  • th3jesterth3jester Posts: 81
    edited 2008-11-04 01:01
    I see what your trying say. Seems like its going to be more trouble than just to write new code. Is Parallax thinking about adding a feature into the BS2 to be able to recover source code? Would definitely be helpful. Thank you for your help.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-04 01:23
    There is not likely to ever be such a feature for the Stamps. For one, it's impractical in that the extra information (like GOTO labels) would have to be stored somewhere and that would take away from the program storage capacity of the Stamp. In addition, as I mentioned, the compilation process removes other useful program structure information. For example, the DO ... LOOP statement gets translated into more primitive operations and the fact that it was a DO ... LOOP is lost. If it were de-compiled, it would be a combination of IF THEN and GOTO statements with dummy labels. Any variable names would be lost. They would all be shown as B3 or W5.

    The other main reason is that it would make it easier for people to steal the programs from existing products that use a Stamp. Parallax hasn't put in features that would make this deliberately difficult, but they are unlikely to spend resources and possibly lose functionality (speed or program size) to make it easy.
  • th3jesterth3jester Posts: 81
    edited 2008-11-04 01:25
    Completely understandable.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-11-04 01:28
    thejester -

    I think you're missing the point. There is no source code conveyed to the Stamp. Once the IDE loads the program into the Stamp, the Stamp has no need for source code. The IDE still has the source code, but not the Stamp. That's the point when you should back-up your program using "Save As". The Stamp only contains "byte codes".

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.
Sign In or Register to comment.