Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Is it possible to download the program from netduino?


  • Please log in to reply
5 replies to this topic

#1 Eng Yousef

Eng Yousef

    New Member

  • Members
  • Pip
  • 2 posts

Posted 09 April 2013 - 11:55 PM

Hi

 

I'm using visual studio 2010 - C# to program the neduino 2 (4.2)

 

I have uploaded more 1000 line of code to the netduino... I lost the main code.. my computer crashed and I lost my hard drive... the netduino is my only hope to get my code back.

 

Any one can help me with the way to get my code back from the netduino by downloading the code back????



#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 10 April 2013 - 07:38 PM

I'm so sorry to hear that. You can certainly download from flash using the Dfuse utility from ST (the same tool used for flash uploads, i.e. reflashing). You could do a full download for safe keeping but you can also download only portions and must then know the address range to download. The latter would probably be the best option since you are only interested in the portion that is actually your application. With the relevant firmware portion at hand it should be possible to "disassemble" into somewhat readable form from which you might be able to reconstruct your original code. Your application was compiled into intermediate code before uploaded to flash, that's why you must disassemble the binary downloaded and yes, there are tools for this. As said, you need to know where exactly in the Netduino address space, your application is located. I'm sure there are guys here at the forum that know between which addresses the application sits (I don't). The same guys would also know of what tool to use for disassembly. Have you considered rewriting the whole thing from scratch? It's actually much easier the second time around. I bet you'll make many improvements over the original and end up in a much better version than the one lost. This unless, of course, you wrote the original years ago.

#3 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 10 April 2013 - 08:14 PM

With the relevant firmware portion at hand it should be possible to "disassemble" into somewhat readable form from which you might be able to reconstruct your original code. Your application was compiled into intermediate code before uploaded to flash, that's why you must disassemble the binary downloaded and yes, there are tools for this.

  .NET Micro Framework does not deploy assemblies directly, it converts them to PE format (*) first. I am not aware of any disassembly tool that can handle it, so you'd need to write your own. Unfortunately, the .NET MF PE format is not really documented, you'd need to ask Microsoft team for the official documentation or spend some time digging into .NET MF source.

 

Have you tried recovering data from the hardisk? There are specialized companies that can do very advanced recovery, even replacing broken electronics or mechanical parts, but of course that is not cheap.

 

So unless the application is critical, i.e. you cannot spend the resources by writing PE disassembler or paying for data recovery service, then probably starting from scratch is the only option (and hanzibal is right, the second pass produces better result much faster ;) )

 

(*) That is special .NET MF format, not the usual Portable Executable



#4 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 11 April 2013 - 12:03 AM

Thanks CW2 for correcting, I'm sorry for being misleading as I actually thought tinyCLR interpreted IL code.

As for data recovery, I once turned to IBAS with a harddrive where the controller had died and they could recover everything since the disks them selves were intact. Back then it was rediculously expensive but that has probably changed since IBAS had very little competition at the time. IBAS was later aquired by http://www.krollontrack.com/ so you could check them out.

I still think you should consider rewriting it all from scratch, I'm pretty sure it's not as hard as one might think.

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 April 2013 - 12:49 AM

Hi hanzibal, So you are right; technically the TinyCLR does interpret IL code. :) The .pe format is basically a stripped-down, endian-specific edition of MSIL. You know that header in all executable DLLs and EXE files that says "this program cannot run in DOS mode"? All of the parameter names included in MSIL files which aren't really useful inside NETMF? All stripped out in that process. If you want a fun exercise sometime, solder on a MiniJTAG header and then put a breakpoint inside the main MSIL interpreter loop on NETMF. It's pretty cool walking through the individual IL instruction branches. Chris

#6 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 11 April 2013 - 07:01 PM

If you want a fun exercise sometime, solder on a MiniJTAG header and then put a breakpoint inside the main MSIL interpreter loop on NETMF. It's pretty cool walking through the individual IL instruction branches.Chris

Chris, you have strange hobbies ;-) Seriously though, I really share your fascination over these things. I visualize the stuff in terms of mechanics with gears and pistons spinning and moving back and forth producing actual results in some form. Automation has always had a strong appeal to me.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.