View Full Version : HELP! How to find name of loaded program?

09-02-2008, 05:01 AM
Hi all, I was pretty active on these boards a few years ago but·forgot all my old log in info.

To make a long story short, I created a very complex project. A large wirelessly controlled submarine (I posted a whole bunch of pics etc. a few years ago).

I haven't touched the project in two years due to a new job, I started with it again this weekend. I must confess, I did almost no documentation on the project which is of course the root of my problem.

I got it working again today BUT I have literaly hundreds of .BS2 programs on my computer. I need to know if there is a way to find out which programs are loaded in the two BS2s I am using in the project.

So...is there a way to find out what program is loaded without altering it?

I can't believe I put myself in the position of having to reverse engineer my own work. http://forums.parallax.com/images/smilies/redface.gif

Post Edited (ITSeng) : 9/2/2008 12:26:11 AM GMT

09-02-2008, 05:04 AM
I usually put a SEROUT at the start of my program, which sends the name of the program and the date it was programmed.

If you haven't done that, I don't think there's any way of finding out.

Mike Green
09-02-2008, 05:06 AM
No, there's no way to find out without either providing for that when you wrote the program or blindly altering the program.

09-02-2008, 05:18 AM
Mike Green said...
No, there's no way to find out without either providing for that when you wrote the program or blindly altering the program.
Oh NO! lol, the price I pay I guess.

I should be happy I remebered the start-up sequence. It takes 2 laptops and 2 BS2s (all variables full on both) and a third party piece of software just to make it run. Not to mention the handfull of circuits I built from scratch.

BTW, an Optima yellow top deep cycle battery will hold almost a 100% charge for 2 years. http://forums.parallax.com/images/smilies/shocked.gif

Since i"m restarting the project...I'll be back.

Thanks for the responses.

Chris Savage
09-02-2008, 06:39 AM
Please edit your message using the pencil icon at the top-right of the message and change your subject line to a descriptive one.

Chris Savage
Parallax Engineering

09-02-2008, 07:43 AM
Chris Savage (Parallax) said...
Please edit your message using the pencil icon at the top-right of the message and change your subject line to a descriptive one.


Before I start randomly loading programs I'm going to give it a few days here, there must be a way. The concerns·I have is both programs refer to each other and the laptop serialy at diffrent baud rates calling different subroutines. I changed so many minor details in the programs I might have one that works but isn't the "final" that I created. I know the "final" is what is loaded right now. Of course the ones I want aren't the last ones I created so the alteration dates on the files don't help.


Mike Green
09-02-2008, 07:58 AM
When you download a new program to a Stamp, the reset of EEPROM is not erased. It's possible to download a small program that dumps the rest of the EEPROM to the debug window of the Stamp Editor where it can be saved to a file for later analysis. Obviously, this program has to be small and whatever memory it occupies can't be analyzed this way, but it might be enough to distinguish different programs. The original program in the EEPROM couldn't be restored unless you were able to identify it.

Phil Pilgrim (PhiPi)
09-02-2008, 09:28 AM
This has come up before. See this thread (http://forums.parallax.com/showthread.php?p=639883).


Jack Jordan
09-11-2008, 06:15 AM
Hi all.
I was under the impression that a pgm loaded into the stamp could NOT be downloaded and decoded.
Is there something more here I should know about?

Mike Green
09-11-2008, 06:28 AM
When a program is loaded into a Stamp, it's placed into the upper end of memory. Any DATA statements are placed in the lower end of memory.
If you try to load a "dump" program into the Stamp, it'll overwrite the uppermost portion of memory. There's a minimum size to such a program and you cannot "dump" the portion of memory occupied by the "dump" program. You can "dump" what's left. Decoding it is another issue. The program is compiled into undocumented byte codes. Some 3rd parties have decoded these and there are books you can buy that discuss how programs are stored in the Stamp. There are no variable names. There are no labels. A lot of the newer structured statements have been translated into simpler operations, so it's hard to figure out the program structure. Comments are stripped out by the compiler and the last part of any downloaded program is not recoverable.

Jack Jordan
09-11-2008, 06:39 AM
I relie HEAVELY on the fact that the embeded pgm is "safe", please post links to the books mentioned.

Sounds like I have some research to do.

Mike Green
09-11-2008, 06:56 AM
I don't have any links.

No program is truely "safe". It's just a matter of how difficult it is to get it. It's possible to desolder the program EEPROM from a Stamp module, hook it up in a jig and run off copies by the thousands. You'd have to be a pretty determined thief with some technical skills to do this and you might break the EEPROM as you're removing it. It's also possible to position very fine needle contacts to the pins of the EEPROM without removing it, power the Stamp, but force it into reset, and externally read the contents of the EEPROM. Again, this takes a tech-savvy determined thief.

The scheme I had described takes a bit of work and you can't determine the values of the last few bytes of the program.

For comparison, it's possible to remove the silicone package from the surface of a chip and read the chip's flash memory with an electron beam probe, this in a "locked" microcontroller's flash program memory, supposably unreadable. It requires expertise and some expensive equipment, but it's very much doable.

09-11-2008, 11:00 AM
One suggestion I don't see posted yet is to sort all your ".BS2" files on your computer by date and look for the latest dates. That should narrow the possibilities considerably. Then print the most recent versions and compare to see what your latest changes were. Then you might be able to compare the operation of the STAMP with the versions to see which version most closely matches its' functionality. Good Luck.