Shop OBEX P1 Docs P2 Docs Learn Events
HELP! How to find name of loaded program? — Parallax Forums

HELP! How to find name of loaded program?

ITSengITSeng Posts: 5
edited 2008-09-11 04:00 in BASIC Stamp
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. redface.gif

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

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2008-09-01 22:04
    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 GreenMike Green Posts: 23,101
    edited 2008-09-01 22:06
    No, there's no way to find out without either providing for that when you wrote the program or blindly altering the program.
  • ITSengITSeng Posts: 5
    edited 2008-09-01 22:18
    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. shocked.gif

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

    Thanks for the responses.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-09-01 23:39
    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
  • ITSengITSeng Posts: 5
    edited 2008-09-02 00:43
    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.

    Done.

    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 GreenMike Green Posts: 23,101
    edited 2008-09-02 00:58
    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)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-02 02:28
    This has come up before. See this thread.

    -Phil
  • Jack JordanJack Jordan Posts: 24
    edited 2008-09-10 23:15
    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?
    Jack
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-10 23:28
    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 JordanJack Jordan Posts: 24
    edited 2008-09-10 23:39
    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.
    Jack
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-10 23:56
    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.
  • ccevtccevt Posts: 10
    edited 2008-09-11 04:00
    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.

    N1HC
Sign In or Register to comment.