Go to Post Gracious professionalism is a two-way street. - Bharat Nain [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-08-2007, 13:20
Jeff 801's Avatar
Jeff 801 Jeff 801 is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jun 2006
Rookie Year: 2004
Location: Florida
Posts: 346
Jeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond repute
extracting code from robot

I know this is answered some where but i cant find it is it possible to extract the code from the robot if we don't have it any where else thanks
  #2   Spotlight this post!  
Unread 10-08-2007, 13:28
jtdowney jtdowney is offline
Boiler Up
AKA: John Downey
FRC #4302 (Robophins)
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2006
Location: Chicago
Posts: 300
jtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant future
Re: extracting code from robot

Unfortunately no, what is transfered to the robot is a form of the code translated into a language the Microcontroller understands. You could in theory disassemble a dump of the PIC and sort through it for the logic you used but you will never be able to reconstruct the code as you saw it in MPLAB.
__________________
John Downey
Lead Robot Inspector - Purdue IndianaFIRST District
Whitney Young Magnet High School/Robophins (FRC 4302) - Mentor (2013-current)
Midwest Regional Planning Committee - Member (2012-current)
Boilermaker Regional Planning Committee - Member (2011-2014)
Robot Inspector (2008-current)
Purdue FIRST Programs - Staff Advisor (2008-2011)
Lafayette-Jefferson High School/Precision Guessworks (FRC 1646) - Mentor (2006-2011)
  #3   Spotlight this post!  
Unread 10-08-2007, 15:15
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: extracting code from robot

Device Reader Ver1.0.1 (found on the IFI FRC Robot Controller (RC) page) will allow you to retrieve the ones and zeroes from the RC, so you can save them somewhere and put them back later.

Getting from the compiled binary file to usable source code is likely to be a lot harder than rewriting the code from scratch, even if you don't know how to program and have to learn it in the process.
  #4   Spotlight this post!  
Unread 10-08-2007, 15:59
Jeff 801's Avatar
Jeff 801 Jeff 801 is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jun 2006
Rookie Year: 2004
Location: Florida
Posts: 346
Jeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond reputeJeff 801 has a reputation beyond repute
Re: extracting code from robot

Quote:
Originally Posted by Alan Anderson View Post
Device Reader Ver1.0.1 (found on the IFI FRC Robot Controller (RC) page) will allow you to retrieve the ones and zeroes from the RC, so you can save them somewhere and put them back later.

Getting from the compiled binary file to usable source code is likely to be a lot harder than rewriting the code from scratch, even if you don't know how to program and have to learn it in the process.
will this be the hex
  #5   Spotlight this post!  
Unread 10-08-2007, 16:53
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: extracting code from robot

Quote:
Originally Posted by Jeff 888 View Post
will this be the hex
Yes
  #6   Spotlight this post!  
Unread 12-08-2007, 00:53
aaeamdar's Avatar
aaeamdar aaeamdar is offline
Post-A-Holic
AKA: Paul Dennis
FRC #1719 (The Umbrella Corp)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Baltimore, MD
Posts: 231
aaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant future
Re: extracting code from robot

If, and this is a significant if, If jtdowney is correct in his assertion (good word, eh?) that the code is translated into a format designed for the Microcontroller, then NO, this will not be the hex. While it might be a reversible process, the logic would be way more complex - I've spent a lot of time (for my job) parsing text files, and even fairly simple formats have challenges involved.

So, again, if jtdowney is correct, then I don't believe Mr. Anderson's approach will give you the original hex file (though he would be the best person to ask about that). Whether the binary (which is of course easily convertible to a hex, if not THE hex that you put in originally) is helpful to you or not is up to you, though I would bet that it's not, unless you have a few months on your hands to write a parser. If you do, toss it out onto the GNU !

-Paul
  #7   Spotlight this post!  
Unread 12-08-2007, 06:23
jtdowney jtdowney is offline
Boiler Up
AKA: John Downey
FRC #4302 (Robophins)
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2006
Location: Chicago
Posts: 300
jtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant future
Re: extracting code from robot

The format for the microcontroller I was speaking of is the .hex. IIRC the C18 compiler takes the code and compiles it to a COF (common object format) file which is then linked into a .hex file. Since that is what you send to the RC you should be able to dump it from the RC using the tool Alan provided. That will allow you to get the current .hex file which you can save in case you ever need it again. The executable format the microcontroller uses probably has a disassembler somewhere if not the format is generally not to bad from my experience working with Linux ELF files. Once disassembled you will have the original code in assembly language which will show you the logic you used assuming you have someone who knows PIC18 assembly.
__________________
John Downey
Lead Robot Inspector - Purdue IndianaFIRST District
Whitney Young Magnet High School/Robophins (FRC 4302) - Mentor (2013-current)
Midwest Regional Planning Committee - Member (2012-current)
Boilermaker Regional Planning Committee - Member (2011-2014)
Robot Inspector (2008-current)
Purdue FIRST Programs - Staff Advisor (2008-2011)
Lafayette-Jefferson High School/Precision Guessworks (FRC 1646) - Mentor (2006-2011)
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Download code from robot Luminous Programming 4 25-05-2005 13:32
Recovering code from the RC Orborde Programming 15 04-12-2004 20:02
Extracting Individual bits in C Noah Programming 7 08-01-2004 15:53
Autonomous Code From Experience EbonySeraphim Programming 7 14-03-2003 21:56


All times are GMT -5. The time now is 19:39.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi