PDA

View Full Version : Basic Stamp EEPROM Decompiler?



Amnoid
03-02-2005, 06:01 AM
Apologies if this has been dealt with in the past- but the forum search does not seem to work.

A student of mine has lost their .bas code and do not want to rewrite it. Is there a way to read the tokenized code off of the stamp (BS1 rev D)?

kb2hap
03-02-2005, 06:23 AM
it has been talked about in the past as far as I know Its not easy and you code will not look like the way you originally wrote it .just the commands. Someone else may be able to tell you more on who does this.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ

Jon Williams
03-02-2005, 06:33 AM
You're his teacher, right? Make him write it 100 times for NOT wanting to rewrite it (and making it better)-- just like when my teacher used to make me write on the board "I will not tell jokes in class" http://forums.parallax.com/images/smilies/tongue.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX USA

Jim McCorison
03-02-2005, 08:41 AM
After decades of programming, and constantly repeating the mantra "Save early, save often." do you think I followed my own advice? Of course not. I'd get on a coding bender and 3 hours later have a system crash wipe everything out. It never failed that the second pass of writing what ever I was working on was always cleaner, shorter, and easier to understand. I've tried to get my bosses, and later clients, to buy off on the development concept of "Write once. Erase. Write again." They never did.

Jim

Larry
03-02-2005, 08:53 AM
Interesting-

I have had two professors tell me the same thing. Once was in a creative writing class, and was was in a programming class.

The second time around, you have a much better idea of what you are trying to do, and what is possible.


Sometimes it's pretty hard to scrap your first effort, though.
-Larry

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

The Dead Bug
03-02-2005, 09:01 AM
Sometimes it's pretty hard to scrap your first effort, though.
-Larry

No problem, the computer will do that for you! ;)

Seriously, like you, Larry, I had a teacher tell me that "There is no such thing as good writing...only good rewriting." Which is why I usually avoid using this "Quick Reply" button!
I have students who also don't want to rewrite their code. They don't want to do their homework, read their text, get to class on time, etc. etc. Life's rough! :) Tell him (her) that he (she) has our deepest sympathy...

Bruce

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Name: Bruce Clemens

Work: Clemensb@otc.edu (mailto:Clemensb@otc.edu)
Good Stuff on my Bolg: http://theDeadBug.journalspace.com (http://theDeadBug.journalspace.com)

m_fabio2
03-02-2005, 06:23 PM
I use a windows command called "xcopy" along with the task scheduler. My files are backed at whatever time intervals I want. We also utilize this on our SCADA network to save files to network drives.

Amnoid
03-03-2005, 02:21 AM
Thaks for the input- which I completely agree with. BUT- does this mean that there is no way to read and rebuild the pbasic code from an EEPROM?

allanlane5
03-03-2005, 03:43 AM
IF you were using an OEM kit version of the BS2 (or BS1 for that matter) THEN you could read out the contents of the EEPROM. If you then fed this to a program which could read the byte-codes of PBasic and translate them to equivalent PBasic text, then you could re-generate a program.

However, this program would have no meaningfull names in it. Any 'constants' defined would be present only as numbers.

I understand the program to convert byte-codes into source does exist -- but I don't know where.

IF you have to un-solder the EEPROM from the BS2 module before you do any of this -- then it's probably not worth the effort. The byte-code security of the BS2 is not huge -- but it is effective enough for a device that costs $50 and holds 2K worth of code.